AC with no WA
2025-06-30 16:04:23
发布于:浙江
16阅读
0回复
0点赞
#include <iostream>
using namespace std;
int a[10001];
int main() {
int N,M, L,R;
cin >> N >> M;
while (M--){
cin >> L >> R;
for (int i = L; i <= R; i++)
a[i] = 1;
}
int cnt = 0;
for (int i = 0; i <= N; i++)
if (a[i] == 0)
cnt ++;
cout << cnt;
}
这里空空如也
有帮助,赞一个