QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#692008#6530. Programming ContestReiko#AC ✓0ms3656kbC++17486b2024-10-31 13:37:382024-10-31 13:37:39

Judging History

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

  • [2024-10-31 13:37:39]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3656kb
  • [2024-10-31 13:37:38]
  • 提交

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];
	s[n+1]=10000;
	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;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

input:

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

output:

20
1
1112
5

result:

ok 4 number(s): "20 1 1112 5"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

20
2072
52 2084 2341 2425 2528 3075 3263 3445 3452 3544 3594 3751 4301 4370 4577 4616 4790 4810 5138 5249 5455 5537 5735 5884 6169 6199 6215 6283 6312 6318 6334 6955 6988 7023 7031 7157 7277 7297 7410 7466 7482 7708 8021 8505 8833 8835 8857 9339 9406 9469 9621 9637 9717
8623
2193
61 2224 2499 2659 2...

output:

6509
851
2465
152
3958
4199
2875
7068
2540
7019
368
4325
4018
7734
7371
6203
1
1
3818
5754

result:

ok 20 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

20
2033
96 2137 2424 2441 2576 2815 2855 2869 3007 3334 3570 3647 3943 3976 4057 4064 4104 4258 4303 4360 4368 4424 4470 4474 4509 4631 4640 4872 4911 4980 5051 5136 5162 5209 5303 5305 5316 5326 5346 5396 5464 5483 5489 5546 5680 5784 5935 6152 6355 6433 6463 6659 6714 6756 6912 7089 7271 7306 7349...

output:

115
5189
2919
733
5777
6049
4446
1452
274
6212
305
176
4342
18
961
914
130
1
1253
460

result:

ok 20 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

20
2184
37 2424 2479 2543 2786 2942 3037 3149 3340 3628 3643 3696 3798 3903 4050 4097 4158 4321 4553 4690 5877 6694 6756 7169 7405 7422 7554 7668 8310 8374 8417 8752 9031 9210 9245 9311 9596 9958
7567
2049
50 2336 2576 2736 2812 2998 3355 3464 3499 3508 3522 3898 4159 4664 4743 5147 5579 5752 5789 5...

output:

5358
896
3904
2540
1
2574
4547
2847
4152
4994
1305
2463
3357
7192
6311
594
1
6462
5761
1

result:

ok 20 numbers