QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#141030 | #6530. Programming Contest | cy1999 | AC ✓ | 2ms | 4656kb | C++ | 355b | 2023-08-17 08:04:24 | 2023-08-17 08:04:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
int t,p[100005],n,m,st,res;
signed main(){
cin>>t;
while(t--){
memset(p,0,sizeof(p));
cin>>st>>n;
for(int i=1;i<=n;i++){
int x;
scanf("%lld",&x);
p[x]=1;
}
cin>>m;
res=0;
for(int i=st;i<=m;i++)if(!p[i])res++;
printf("%lld\n",res);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 4416kb
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: 2ms
memory: 4508kb
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: 2ms
memory: 4656kb
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: 4504kb
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