#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define fast_io ios::sync_with_stdio(false);cin.tie(0);
#define what(x) cerr << #x << " is " << x << '\n';
#define kill(x) {cout << x << '\n'; return 0;}
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define pb push_back
#define ll long long
#define F first
#define S second
const ll inf = 1e16, mod = 1e9 + 7, delta = 1e9 + 9, SQ = 450, P = 6065621;
using namespace std;
const int N = 1e7 + 10, LG = 20;
bitset<10> mark[N], f;
vector<int> v;
int a[N];
int main () {
fast_io;
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i < N; i++) {
int x = i;
while (x > 0) {
mark[i][x % 10] = true;
x /= 10;
}
}
for (int i = 1; i < N; i++) {
bool b = true;
for (int j = i; j <= n + i - 1; j++) {
if (!mark[j][a[j - i + 1]]) {b = false; break;}
}
if (b) kill(i);
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
80700 KB |
Output is correct |
2 |
Correct |
99 ms |
80724 KB |
Output is correct |
3 |
Correct |
97 ms |
80720 KB |
Output is correct |
4 |
Correct |
97 ms |
80720 KB |
Output is correct |
5 |
Correct |
100 ms |
80504 KB |
Output is correct |
6 |
Correct |
101 ms |
80720 KB |
Output is correct |
7 |
Correct |
106 ms |
80668 KB |
Output is correct |
8 |
Correct |
97 ms |
80644 KB |
Output is correct |
9 |
Correct |
110 ms |
80588 KB |
Output is correct |
10 |
Correct |
99 ms |
80544 KB |
Output is correct |
11 |
Correct |
96 ms |
80720 KB |
Output is correct |
12 |
Correct |
98 ms |
80724 KB |
Output is correct |
13 |
Correct |
98 ms |
80620 KB |
Output is correct |
14 |
Correct |
103 ms |
80628 KB |
Output is correct |
15 |
Correct |
99 ms |
80712 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
97 ms |
80720 KB |
Output is correct |
2 |
Correct |
98 ms |
80520 KB |
Output is correct |
3 |
Correct |
103 ms |
80976 KB |
Output is correct |
4 |
Correct |
96 ms |
80552 KB |
Output is correct |
5 |
Correct |
97 ms |
80524 KB |
Output is correct |
6 |
Correct |
97 ms |
80720 KB |
Output is correct |
7 |
Correct |
98 ms |
80680 KB |
Output is correct |
8 |
Correct |
98 ms |
80724 KB |
Output is correct |
9 |
Correct |
98 ms |
80720 KB |
Output is correct |
10 |
Correct |
97 ms |
80720 KB |
Output is correct |
11 |
Incorrect |
475 ms |
80720 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
96 ms |
80724 KB |
Output is correct |
2 |
Correct |
101 ms |
80976 KB |
Output is correct |
3 |
Correct |
318 ms |
80804 KB |
Output is correct |
4 |
Correct |
100 ms |
80724 KB |
Output is correct |
5 |
Correct |
370 ms |
80808 KB |
Output is correct |
6 |
Correct |
99 ms |
80608 KB |
Output is correct |
7 |
Correct |
164 ms |
83024 KB |
Output is correct |
8 |
Correct |
312 ms |
80992 KB |
Output is correct |
9 |
Correct |
229 ms |
83028 KB |
Output is correct |
10 |
Correct |
275 ms |
83024 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
104 ms |
80576 KB |
Output is correct |
2 |
Correct |
121 ms |
80720 KB |
Output is correct |
3 |
Correct |
99 ms |
80644 KB |
Output is correct |
4 |
Correct |
117 ms |
80716 KB |
Output is correct |
5 |
Incorrect |
140 ms |
80832 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |