QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21082 | #2649. Ants | iterater# | AC ✓ | 1634ms | 81688kb | C++14 | 563b | 2022-02-27 14:38:54 | 2022-05-08 01:59:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n;
map <string, bool> h;
inline string trans(int ans)
{
if (ans == 0) return "0";
string st = "";
while (ans) { st = st + (char) (ans % 10 + '0'); ans /= 10; }
reverse(st.begin(), st.end());
return st;
}
int main()
{
ios::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++)
{
string st;
cin >> st;
if (st[0] == '-') continue;
if ((int) st.size() > 8) continue;
h[st] = 1;
}
int ans = 0;
while (h.count(trans(ans))) ans++;
cout << ans << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3536kb
input:
5 1 -1 0 3 10
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
5 0 1 2 3 4
output:
5
result:
ok single line: '5'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3700kb
input:
0
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
5 1 2 3 4 5
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
4 0 -8976139763967139761397639613763 3 1
output:
2
result:
ok single line: '2'
Test #6:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
3 2 896978568758758758657546353653476487589759756789 0
output:
1
result:
ok single line: '1'
Test #7:
score: 0
Accepted
time: 1243ms
memory: 81688kb
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: 3ms
memory: 3724kb
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: 3ms
memory: 3596kb
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: 1634ms
memory: 81664kb
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'