P9690 [GDCPC2023] Programming Contest 题解
qinshi0308 · · 题解
思路
首先我们知道,第
然后我们可以按顺序枚举停办年份,每枚举到一个小于
代码:
# include <bits/stdc++.h>
using namespace std;
int arr[110];
int main(){
int t;
cin>>t;
for(int i=0;i<t;i++){
int x,y,n;
cin>>x>>n;
for(int j=0;j<n;j++){
cin>>arr[j];
}
cin>>y;
int ans=y-x+1;
for(int j=0;j<n&&arr[j]<y;j++){
ans--;
}
cout<<ans<<endl;
}
}