- 题解
there
- 2025-7-8 17:39:15 @
#include<bits/stdc++.h> using namespace std; int a[10005]; int main(){ int L; cin>>L; for(int i=0;i<=L;i++){ a[i]=1; } int M; cin>>M; for(int i=1;i<=M;i++){ int c,d; cin>>c>>d; for(int j=c;j<=d;j++){ a[j]=0; } } int x; x=0; for(int j=0;j<=L;j++){ if(a[j]==1){ x++; } } printf("%d",x); return 0; }
0 条评论
目前还没有评论...