QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#691955#6530. Programming ContestReiko#WA 0ms3564kbC++17469b2024-10-31 13:31:502024-10-31 13:31:51

Judging History

你现在查看的是最新测评结果

  • [2024-10-31 13:31:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3564kb
  • [2024-10-31 13:31:50]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
int s[105];
void solve(){
	int y1, n, y2;
	cin>>y1;
	cin>>n;
	for(int i=1; i<=n; i++)
		cin>>s[i];
	cin>>y2;
	int x=0;
	for(int i=1; i<n; i++){
		if(y2>=s[i] && y2<=s[i+1]){
			x=i;
			break;
		}
	}
	cout<<y2-y1+1-x<<endl;
}
int main(){
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int T=1;
	cin>>T;
	while(T--)
		solve(); 
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3564kb

input:

4
2003
1 2020
2023
2003
1 2020
2003
2345
0
3456
3000
4 3001 3003 3004 3008
3007

output:

21
1
1112
5

result:

wrong answer 1st numbers differ - expected: '20', found: '21'