#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 10, maxm = 1e5 + 10;
bool num[maxn][11];
int n, v[maxm];
int main()
{
ios::sync_with_stdio(false), cin.tie(nullptr);
num[0][0] = true;
for(int i = 1; i < maxn; i++)
{
int p = i;
while(p)
{
num[i][p%10] = true;
p /= 10;
}
}
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> v[i];
}
for(int i = 0; i < maxn - n; i++)
{
bool ok = true;
for(int j = 0; j < n; j++)
{
if(!num[i + j][v[j]]) ok = false;
}
if(ok)
{
cout << i << "\n";
return 0;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
223 ms |
108024 KB |
Output is correct |
2 |
Correct |
212 ms |
107900 KB |
Output is correct |
3 |
Correct |
204 ms |
108024 KB |
Output is correct |
4 |
Correct |
211 ms |
108024 KB |
Output is correct |
5 |
Correct |
221 ms |
108020 KB |
Output is correct |
6 |
Incorrect |
283 ms |
108000 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
224 ms |
107928 KB |
Output is correct |
2 |
Correct |
235 ms |
107980 KB |
Output is correct |
3 |
Correct |
221 ms |
108024 KB |
Output is correct |
4 |
Correct |
268 ms |
108132 KB |
Output is correct |
5 |
Correct |
202 ms |
108024 KB |
Output is correct |
6 |
Incorrect |
198 ms |
108152 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
210 ms |
108084 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
202 ms |
107996 KB |
Output is correct |
2 |
Correct |
243 ms |
108024 KB |
Output is correct |
3 |
Correct |
203 ms |
108024 KB |
Output is correct |
4 |
Correct |
211 ms |
108144 KB |
Output is correct |
5 |
Execution timed out |
1069 ms |
108280 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |