1WA,输出7
查看原帖
1WA,输出7
534532
AnthonyEric楼主2021/9/28 23:16
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL a[114514];
int main(){
    LL m, l;
    cin >> l;
    for(int i = 1; i <= l; i++)
    	a[i] = 0;
	cin >> m;
	int r,f;
	for(int i = 1; i <= m; i++){
		cin >> r >> f;
		for(int j = r; j <= f; j++){
			a[j] = 1;
		}
	}
	int t = 0;
	for(int i = 1; i <= l; i++)
	if(a[i] != 1) t++;
	cout<<++t;
	return 0;
}
2021/9/28 23:16
加载中...