#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 = 1; i < maxn - n - 1; i++)
{
bool ok = true;
for(int j = 0; j < n; j++)
{
if(num[i + j][v[j]] == false) ok = false;
}
if(ok)
{
cout << i << "\n";
return 0;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
234 ms |
108056 KB |
Output is correct |
2 |
Correct |
233 ms |
107908 KB |
Output is correct |
3 |
Correct |
296 ms |
108096 KB |
Output is correct |
4 |
Correct |
222 ms |
107888 KB |
Output is correct |
5 |
Correct |
270 ms |
108024 KB |
Output is correct |
6 |
Correct |
228 ms |
107896 KB |
Output is correct |
7 |
Correct |
212 ms |
108024 KB |
Output is correct |
8 |
Correct |
221 ms |
108080 KB |
Output is correct |
9 |
Correct |
210 ms |
107896 KB |
Output is correct |
10 |
Correct |
196 ms |
107896 KB |
Output is correct |
11 |
Correct |
198 ms |
108052 KB |
Output is correct |
12 |
Correct |
234 ms |
108024 KB |
Output is correct |
13 |
Correct |
197 ms |
108152 KB |
Output is correct |
14 |
Correct |
196 ms |
108024 KB |
Output is correct |
15 |
Correct |
245 ms |
108024 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
201 ms |
107980 KB |
Output is correct |
2 |
Correct |
214 ms |
108024 KB |
Output is correct |
3 |
Correct |
214 ms |
107896 KB |
Output is correct |
4 |
Correct |
233 ms |
108024 KB |
Output is correct |
5 |
Correct |
241 ms |
108024 KB |
Output is correct |
6 |
Correct |
247 ms |
108024 KB |
Output is correct |
7 |
Correct |
247 ms |
108024 KB |
Output is correct |
8 |
Correct |
228 ms |
108152 KB |
Output is correct |
9 |
Correct |
212 ms |
107896 KB |
Output is correct |
10 |
Correct |
226 ms |
107956 KB |
Output is correct |
11 |
Execution timed out |
1087 ms |
108056 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
204 ms |
107980 KB |
Output is correct |
2 |
Execution timed out |
1074 ms |
108152 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
200 ms |
108020 KB |
Output is correct |
2 |
Correct |
213 ms |
108024 KB |
Output is correct |
3 |
Correct |
212 ms |
108120 KB |
Output is correct |
4 |
Correct |
241 ms |
108028 KB |
Output is correct |
5 |
Execution timed out |
1062 ms |
108316 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |