#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 |
104 ms |
80664 KB |
Output is correct |
2 |
Correct |
105 ms |
80572 KB |
Output is correct |
3 |
Correct |
105 ms |
80532 KB |
Output is correct |
4 |
Correct |
114 ms |
80684 KB |
Output is correct |
5 |
Correct |
106 ms |
80572 KB |
Output is correct |
6 |
Correct |
110 ms |
80688 KB |
Output is correct |
7 |
Correct |
106 ms |
80624 KB |
Output is correct |
8 |
Correct |
106 ms |
80720 KB |
Output is correct |
9 |
Correct |
110 ms |
80556 KB |
Output is correct |
10 |
Correct |
110 ms |
80572 KB |
Output is correct |
11 |
Correct |
105 ms |
80660 KB |
Output is correct |
12 |
Correct |
109 ms |
80532 KB |
Output is correct |
13 |
Correct |
106 ms |
80636 KB |
Output is correct |
14 |
Correct |
110 ms |
80772 KB |
Output is correct |
15 |
Correct |
105 ms |
80500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
80592 KB |
Output is correct |
2 |
Correct |
115 ms |
80676 KB |
Output is correct |
3 |
Correct |
108 ms |
80972 KB |
Output is correct |
4 |
Correct |
106 ms |
80568 KB |
Output is correct |
5 |
Correct |
105 ms |
80488 KB |
Output is correct |
6 |
Correct |
104 ms |
80540 KB |
Output is correct |
7 |
Correct |
107 ms |
80576 KB |
Output is correct |
8 |
Correct |
110 ms |
80552 KB |
Output is correct |
9 |
Correct |
106 ms |
80724 KB |
Output is correct |
10 |
Correct |
105 ms |
80680 KB |
Output is correct |
11 |
Incorrect |
676 ms |
80724 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
106 ms |
80720 KB |
Output is correct |
2 |
Correct |
109 ms |
80720 KB |
Output is correct |
3 |
Correct |
431 ms |
80724 KB |
Output is correct |
4 |
Correct |
112 ms |
80636 KB |
Output is correct |
5 |
Correct |
481 ms |
80780 KB |
Output is correct |
6 |
Correct |
106 ms |
80532 KB |
Output is correct |
7 |
Correct |
206 ms |
82968 KB |
Output is correct |
8 |
Correct |
429 ms |
80916 KB |
Output is correct |
9 |
Correct |
307 ms |
82964 KB |
Output is correct |
10 |
Correct |
372 ms |
83204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
80596 KB |
Output is correct |
2 |
Correct |
106 ms |
80724 KB |
Output is correct |
3 |
Correct |
106 ms |
80612 KB |
Output is correct |
4 |
Correct |
109 ms |
80644 KB |
Output is correct |
5 |
Incorrect |
142 ms |
80860 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |