QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#390073#2649. Antskevinyang#AC ✓679ms50716kbC++17413b2024-04-15 02:12:092024-04-15 02:12:09

Judging History

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

  • [2024-04-15 02:12:09]
  • 评测
  • 测评结果:AC
  • 用时:679ms
  • 内存:50716kb
  • [2024-04-15 02:12:09]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	set<int>s;
	int n;
	cin >> n;
	for(int i = 0; i<n; i++){
		string str;
		cin >> str;
		if(str[0]=='-')continue;
		if(str.size() >= 8)continue;
		int v = stoll(str);
		s.insert(v);
	}
	int mex = 0;
	while(s.find(mex)!=s.end())mex++;
	cout << mex << '\n';
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1
-1
0
3
10

output:

2

result:

ok single line: '2'

Test #2:

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

input:

5
0
1
2
3
4

output:

5

result:

ok single line: '5'

Test #3:

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

input:

0

output:

0

result:

ok single line: '0'

Test #4:

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

input:

5
1
2
3
4
5

output:

0

result:

ok single line: '0'

Test #5:

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

input:

4
0
-8976139763967139761397639613763
3
1

output:

2

result:

ok single line: '2'

Test #6:

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

input:

3
2
896978568758758758657546353653476487589759756789
0

output:

1

result:

ok single line: '1'

Test #7:

score: 0
Accepted
time: 546ms
memory: 50452kb

input:

1000000
819985
413173
507234
485036
715163
980236
573149
821056
87438
823214
815492
83793
669653
760587
411169
891513
317723
141058
434175
221383
945688
591353
535468
20972
169333
403370
715063
521317
438362
39224
121244
185360
557988
527169
223095
524391
993517
347952
192253
671244
554420
143028
14...

output:

8940

result:

ok single line: '8940'

Test #8:

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

input:

246
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
268435456
536870912
1073741824
2147483648
4294967296
8589934592
17179869184
34359738368
68719476736
137438953472
274877906944
549755813888
1099511627776
2199023255552
4...

output:

0

result:

ok single line: '0'

Test #9:

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

input:

23
-1000000
-9223372036854775807
9223372036854775807
9223372036854775808
-9223372036854775808
12
11
1000000
1000001
3
1000002
18446744073709551616
-1844674407370955161618446744073709551616184467440737095516161844674407370955161618446744073709551
8
1844674407370955161618446744073709551616184467440737...

output:

10

result:

ok single line: '10'

Test #10:

score: 0
Accepted
time: 679ms
memory: 50716kb

input:

1000000
855522
161377
436739
165149
534095
726464
960943
111158
718329
412431
446189
314493
748441
550748
767736
874927
981620
598895
537856
270137
643386
947212
66681
958643
812628
689868
41432
151175
215353
381503
315944
170255
412206
353425
936709
797559
703982
717564
780694
732818
87134
16111
58...

output:

1000000

result:

ok single line: '1000000'