wa on #3求调
查看原帖
wa on #3求调
1265632
xhxxwcr楼主2024/8/18 11:53
#include<bits/stdc++.h>
using namespace std;
#define int long long
int ans;
int a[1010],b[1010];
signed main(){
	int n,x,k;
	cin >> n >> x >> k;
	int r = n;
	for(int i = 1;i <= x;i++){
		cin >> a[i] >> b[i];
		r -= a[i] - b[i - 1];
//		cout << r << endl;
		r += b[i] - a[i];
//		cout << a[i] << " " << b[i] << endl;
//		cout << r << endl;
	}
	r -= (k - b[x] + 1);
//	cout << r << endl;
	if(r <= 0){
		cout << "No" << endl;
	}else{
		cout << "Yes" << endl;
	}
	return 0;
}

2024/8/18 11:53
加载中...