#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 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 - 1; 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 |
5 ms |
1408 KB |
Output is correct |
2 |
Correct |
4 ms |
1408 KB |
Output is correct |
3 |
Correct |
4 ms |
1408 KB |
Output is correct |
4 |
Correct |
4 ms |
1408 KB |
Output is correct |
5 |
Correct |
4 ms |
1536 KB |
Output is correct |
6 |
Incorrect |
4 ms |
1408 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1408 KB |
Output is correct |
2 |
Correct |
6 ms |
1408 KB |
Output is correct |
3 |
Correct |
4 ms |
1408 KB |
Output is correct |
4 |
Correct |
5 ms |
1408 KB |
Output is correct |
5 |
Correct |
4 ms |
1408 KB |
Output is correct |
6 |
Incorrect |
4 ms |
1380 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
1408 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1408 KB |
Output is correct |
2 |
Correct |
4 ms |
1408 KB |
Output is correct |
3 |
Correct |
4 ms |
1408 KB |
Output is correct |
4 |
Correct |
4 ms |
1408 KB |
Output is correct |
5 |
Execution timed out |
1057 ms |
1636 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |