#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define sz(x) int((x).size())
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
template<class X, class Y>
inline bool maximize(X &x, const Y &y) {return (x < y ? x = y, 1 : 0);}
template<class X, class Y>
inline bool minimize(X &x, const Y &y) {return (x > y ? x = y, 1 : 0);}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int Random(int l, int r) {
return uniform_int_distribution<int>(l, r)(rng);
}
const int MAXN = 100005;
const int MAXM = 50004;
vector<int> B[MAXM], C[MAXN];
int f[20004][2003];
int colNeed[MAXN], dp[MAXN], sum[MAXN], nArr, mArr, numCol;
bool dx[2003][MAXN], ok[MAXN];
int sub1(void) {
for (int i = 1; i <= nArr; ++i) {
if(sz(C[colNeed[i]]) == 0)
return -1;
dp[i] = C[colNeed[i]][0];
sum[i] = sum[i - 1] + (i > 1 && (dp[i - 1] + 1) % mArr == dp[i]);
}
int res(0), maxi(1), lastok(-mArr);
for (int i = 1; i <= nArr; ++i) {
if(sum[i + mArr - 1] - sum[i] == mArr - 1 && (dp[i + mArr - 1] + 1) % mArr == dp[i])
lastok = i;
if(i == maxi) {
if(lastok + mArr <= i)
return -1;
maxi = lastok + mArr;
++res;
}
}
return res;
}
int sub3(void) {
for (int j = 0; j < mArr; ++j) {
for (int it = 0; it < sz(B[j]); ++it)
dx[j][B[j][it]] = 1;
}
for (int i = 1; i + mArr - 1 <= nArr; ++i) {
ok[i] = 0;
for (int j = 0; j < mArr; ++j) {
ok[i] = 1;
for (int k = 0; k < mArr; ++k)
ok[i] &= (dx[(j + k) % mArr][colNeed[i + k]]);
if(ok[i])
break;
}
}
int res(0), maxi(1), lastok(-mArr);
for (int i = 1; i <= nArr; ++i) {
if(ok[i])
lastok = i;
if(i == maxi) {
if(lastok + mArr <= i)
return -1;
maxi = lastok + mArr;
++res;
}
}
return res;
}
int sub4(void) {
for (int j = 0; j < mArr; ++j) {
for (int it = 0; it < sz(B[j]); ++it)
dx[j][B[j][it]] = 1;
}
for (int i = nArr; i > 0; --i) {
for (int j = mArr; j > 0; --j)
f[i][j] = f[i + 1][j + 1] + (dx[j - 1][colNeed[i]]);
}
for (int i = 1; i + mArr - 1 <= nArr; ++i) {
for (int j = 0; j < mArr; ++j) {
ok[i] = (f[i][j + 1] + f[i + mArr - j][1] - f[i + mArr][j + 1] == mArr);
if(ok[i])
break;
}
}
int res(0), maxi(1), lastok(-mArr);
for (int i = 1; i <= nArr; ++i) {
if(ok[i])
lastok = i;
if(i == maxi) {
if(lastok + mArr <= i)
return -1;
maxi = lastok + mArr;
++res;
}
}
return res;
}
int minimumInstructions(int _N, int _M, int _K, vector<int> _C, vector<int> _A, vector<vector<int>> _B) {
nArr = _N, mArr = _M, numCol = _K;
for (int i = 1; i <= nArr; ++i) {
colNeed[i] = _C[i - 1];
C[i].clear();
}
int maxf(0);
for (int i = 0; i < mArr; ++i) {
int szlike(_A[i]);
B[i].clear();
for (int j = 0; j < szlike; ++j) {
B[i].push_back(_B[i][j]);
C[_B[i][j]].push_back(i);
maxf = max(maxf, sz(C[_B[i][j]]));
}
}
if(maxf <= 1)
return sub1();
if(nArr <= 500)
return sub3();
if(nArr <= 20000 && mArr <= 2000)
return sub4();
return -1;
}
#ifdef Nhoksocqt1
int main(void) {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define TASK "paint"
if(fopen(TASK".inp", "r")) {
freopen(TASK".inp", "r", stdin);
freopen(TASK".out", "w", stdout);
}
vector<int> _A, _C;
vector<vector<int>> _B;
int _N, _M, _K;
cin >> _N >> _M >> _K;
_C.resize(_N);
for (int i = 0; i < _N; ++i) {
cin >> _C[i];
_C[i] = Random(0, _K - 1); cout << _C[i] << " \n"[i + 1 == _N];
}
vector<int> col; for (int i = 0; i < _K; ++i) col.push_back(i);
_A.resize(_M), _B.resize(_M);
for (int i = 0; i < _M; ++i) {
cin >> _A[i];
_A[i] = Random(1, _K); cout << _A[i] << ' ';
_B[i].resize(_A[i]);
shuffle(col.begin(), col.end(), rng);
for (int j = 0; j < _A[i]; ++j) {
cin >> _B[i][j];
_B[i][j] = col[j]; cout << _B[i][j] << " \n"[j + 1 == _A[i]];
}
}
int ans = minimumInstructions(_N, _M, _K, _C, _A, _B);
cout << "ANSWER: " << ans << '\n';
return 0;
}
#endif // Nhoksocqt1
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6744 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
3 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6744 KB |
Output is correct |
10 |
Correct |
2 ms |
7004 KB |
Output is correct |
11 |
Correct |
1 ms |
6748 KB |
Output is correct |
12 |
Correct |
1 ms |
7004 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
7000 KB |
Output is correct |
16 |
Correct |
2 ms |
7000 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
7004 KB |
Output is correct |
20 |
Correct |
2 ms |
7004 KB |
Output is correct |
21 |
Correct |
2 ms |
6844 KB |
Output is correct |
22 |
Correct |
14 ms |
11356 KB |
Output is correct |
23 |
Correct |
15 ms |
11404 KB |
Output is correct |
24 |
Correct |
14 ms |
11352 KB |
Output is correct |
25 |
Correct |
3 ms |
7004 KB |
Output is correct |
26 |
Correct |
3 ms |
7004 KB |
Output is correct |
27 |
Correct |
3 ms |
7000 KB |
Output is correct |
28 |
Correct |
3 ms |
7004 KB |
Output is correct |
29 |
Correct |
3 ms |
7004 KB |
Output is correct |
30 |
Correct |
3 ms |
7000 KB |
Output is correct |
31 |
Correct |
7 ms |
8024 KB |
Output is correct |
32 |
Correct |
6 ms |
8028 KB |
Output is correct |
33 |
Correct |
7 ms |
8028 KB |
Output is correct |
34 |
Correct |
6 ms |
8028 KB |
Output is correct |
35 |
Correct |
7 ms |
8028 KB |
Output is correct |
36 |
Correct |
7 ms |
8028 KB |
Output is correct |
37 |
Correct |
17 ms |
11612 KB |
Output is correct |
38 |
Correct |
17 ms |
11608 KB |
Output is correct |
39 |
Correct |
17 ms |
11612 KB |
Output is correct |
40 |
Correct |
8 ms |
9564 KB |
Output is correct |
41 |
Correct |
5 ms |
7260 KB |
Output is correct |
42 |
Correct |
9 ms |
9696 KB |
Output is correct |
43 |
Correct |
7 ms |
7260 KB |
Output is correct |
44 |
Correct |
6 ms |
7260 KB |
Output is correct |
45 |
Correct |
10 ms |
9820 KB |
Output is correct |
46 |
Correct |
33 ms |
19540 KB |
Output is correct |
47 |
Correct |
21 ms |
12636 KB |
Output is correct |
48 |
Correct |
25 ms |
15844 KB |
Output is correct |
49 |
Correct |
42 ms |
15708 KB |
Output is correct |
50 |
Correct |
31 ms |
15164 KB |
Output is correct |
51 |
Correct |
23 ms |
12636 KB |
Output is correct |
52 |
Correct |
8 ms |
9820 KB |
Output is correct |
53 |
Correct |
9 ms |
9840 KB |
Output is correct |
54 |
Correct |
10 ms |
9820 KB |
Output is correct |
55 |
Correct |
9 ms |
9820 KB |
Output is correct |
56 |
Correct |
11 ms |
9692 KB |
Output is correct |
57 |
Correct |
9 ms |
9816 KB |
Output is correct |
58 |
Correct |
36 ms |
20308 KB |
Output is correct |
59 |
Correct |
46 ms |
20316 KB |
Output is correct |
60 |
Correct |
37 ms |
20392 KB |
Output is correct |
61 |
Correct |
37 ms |
20308 KB |
Output is correct |
62 |
Correct |
37 ms |
20312 KB |
Output is correct |
63 |
Correct |
38 ms |
20168 KB |
Output is correct |
64 |
Correct |
38 ms |
19292 KB |
Output is correct |
65 |
Correct |
37 ms |
19280 KB |
Output is correct |
66 |
Correct |
38 ms |
19284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6744 KB |
Output is correct |
2 |
Correct |
2 ms |
6748 KB |
Output is correct |
3 |
Correct |
3 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6744 KB |
Output is correct |
10 |
Correct |
2 ms |
7004 KB |
Output is correct |
11 |
Correct |
1 ms |
6748 KB |
Output is correct |
12 |
Correct |
1 ms |
7004 KB |
Output is correct |
13 |
Correct |
2 ms |
7000 KB |
Output is correct |
14 |
Correct |
2 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
7000 KB |
Output is correct |
16 |
Correct |
2 ms |
7000 KB |
Output is correct |
17 |
Correct |
2 ms |
7004 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
7004 KB |
Output is correct |
20 |
Correct |
2 ms |
7004 KB |
Output is correct |
21 |
Correct |
2 ms |
6844 KB |
Output is correct |
22 |
Correct |
2 ms |
9048 KB |
Output is correct |
23 |
Correct |
2 ms |
9052 KB |
Output is correct |
24 |
Correct |
2 ms |
8796 KB |
Output is correct |
25 |
Correct |
2 ms |
9052 KB |
Output is correct |
26 |
Correct |
2 ms |
8796 KB |
Output is correct |
27 |
Correct |
2 ms |
9052 KB |
Output is correct |
28 |
Correct |
2 ms |
11100 KB |
Output is correct |
29 |
Correct |
3 ms |
11100 KB |
Output is correct |
30 |
Correct |
3 ms |
11100 KB |
Output is correct |
31 |
Correct |
2 ms |
9052 KB |
Output is correct |
32 |
Correct |
5 ms |
13148 KB |
Output is correct |
33 |
Correct |
17 ms |
23388 KB |
Output is correct |
34 |
Correct |
20 ms |
23460 KB |
Output is correct |
35 |
Correct |
10 ms |
21340 KB |
Output is correct |
36 |
Correct |
16 ms |
23448 KB |
Output is correct |
37 |
Correct |
15 ms |
25512 KB |
Output is correct |
38 |
Correct |
2 ms |
9032 KB |
Output is correct |
39 |
Correct |
2 ms |
9052 KB |
Output is correct |
40 |
Correct |
23 ms |
23488 KB |
Output is correct |
41 |
Correct |
14 ms |
23440 KB |
Output is correct |
42 |
Correct |
13 ms |
15192 KB |
Output is correct |
43 |
Correct |
5 ms |
13148 KB |
Output is correct |
44 |
Correct |
2 ms |
9052 KB |
Output is correct |
45 |
Correct |
2 ms |
11100 KB |
Output is correct |
46 |
Correct |
6 ms |
11112 KB |
Output is correct |
47 |
Correct |
8 ms |
13148 KB |
Output is correct |
48 |
Correct |
8 ms |
13400 KB |
Output is correct |
49 |
Correct |
10 ms |
13148 KB |
Output is correct |
50 |
Correct |
45 ms |
27484 KB |
Output is correct |
51 |
Correct |
40 ms |
27484 KB |
Output is correct |
52 |
Correct |
32 ms |
27480 KB |
Output is correct |
53 |
Correct |
37 ms |
27484 KB |
Output is correct |
54 |
Correct |
35 ms |
27484 KB |
Output is correct |
55 |
Correct |
35 ms |
27480 KB |
Output is correct |
56 |
Correct |
64 ms |
27480 KB |
Output is correct |
57 |
Correct |
27 ms |
27480 KB |
Output is correct |
58 |
Correct |
61 ms |
27484 KB |
Output is correct |
59 |
Correct |
31 ms |
27728 KB |
Output is correct |
60 |
Correct |
62 ms |
27484 KB |
Output is correct |
61 |
Correct |
33 ms |
27484 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9048 KB |
Output is correct |
2 |
Correct |
2 ms |
9052 KB |
Output is correct |
3 |
Correct |
1 ms |
6744 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
3 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6744 KB |
Output is correct |
12 |
Correct |
2 ms |
7004 KB |
Output is correct |
13 |
Correct |
1 ms |
6748 KB |
Output is correct |
14 |
Correct |
1 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
7000 KB |
Output is correct |
16 |
Correct |
2 ms |
7004 KB |
Output is correct |
17 |
Correct |
2 ms |
7000 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
7004 KB |
Output is correct |
20 |
Correct |
2 ms |
7000 KB |
Output is correct |
21 |
Correct |
2 ms |
7004 KB |
Output is correct |
22 |
Correct |
2 ms |
7004 KB |
Output is correct |
23 |
Correct |
2 ms |
6844 KB |
Output is correct |
24 |
Correct |
14 ms |
11356 KB |
Output is correct |
25 |
Correct |
15 ms |
11404 KB |
Output is correct |
26 |
Correct |
14 ms |
11352 KB |
Output is correct |
27 |
Correct |
2 ms |
8796 KB |
Output is correct |
28 |
Correct |
2 ms |
9052 KB |
Output is correct |
29 |
Correct |
2 ms |
8796 KB |
Output is correct |
30 |
Correct |
2 ms |
9052 KB |
Output is correct |
31 |
Correct |
2 ms |
11100 KB |
Output is correct |
32 |
Correct |
3 ms |
11100 KB |
Output is correct |
33 |
Correct |
3 ms |
11100 KB |
Output is correct |
34 |
Correct |
2 ms |
9052 KB |
Output is correct |
35 |
Correct |
5 ms |
13148 KB |
Output is correct |
36 |
Correct |
17 ms |
23388 KB |
Output is correct |
37 |
Correct |
20 ms |
23460 KB |
Output is correct |
38 |
Correct |
10 ms |
21340 KB |
Output is correct |
39 |
Correct |
16 ms |
23448 KB |
Output is correct |
40 |
Correct |
15 ms |
25512 KB |
Output is correct |
41 |
Correct |
2 ms |
9032 KB |
Output is correct |
42 |
Correct |
2 ms |
9052 KB |
Output is correct |
43 |
Correct |
23 ms |
23488 KB |
Output is correct |
44 |
Correct |
14 ms |
23440 KB |
Output is correct |
45 |
Correct |
13 ms |
15192 KB |
Output is correct |
46 |
Correct |
5 ms |
13148 KB |
Output is correct |
47 |
Correct |
2 ms |
9052 KB |
Output is correct |
48 |
Correct |
2 ms |
11100 KB |
Output is correct |
49 |
Correct |
6 ms |
11112 KB |
Output is correct |
50 |
Correct |
8 ms |
13148 KB |
Output is correct |
51 |
Correct |
8 ms |
13400 KB |
Output is correct |
52 |
Correct |
10 ms |
13148 KB |
Output is correct |
53 |
Correct |
45 ms |
27484 KB |
Output is correct |
54 |
Correct |
40 ms |
27484 KB |
Output is correct |
55 |
Correct |
32 ms |
27480 KB |
Output is correct |
56 |
Correct |
37 ms |
27484 KB |
Output is correct |
57 |
Correct |
35 ms |
27484 KB |
Output is correct |
58 |
Correct |
35 ms |
27480 KB |
Output is correct |
59 |
Correct |
64 ms |
27480 KB |
Output is correct |
60 |
Correct |
27 ms |
27480 KB |
Output is correct |
61 |
Correct |
61 ms |
27484 KB |
Output is correct |
62 |
Correct |
31 ms |
27728 KB |
Output is correct |
63 |
Correct |
62 ms |
27484 KB |
Output is correct |
64 |
Correct |
33 ms |
27484 KB |
Output is correct |
65 |
Correct |
4 ms |
25436 KB |
Output is correct |
66 |
Correct |
2 ms |
11100 KB |
Output is correct |
67 |
Correct |
3 ms |
19288 KB |
Output is correct |
68 |
Correct |
3 ms |
15196 KB |
Output is correct |
69 |
Correct |
4 ms |
19292 KB |
Output is correct |
70 |
Correct |
15 ms |
25784 KB |
Output is correct |
71 |
Correct |
10 ms |
23640 KB |
Output is correct |
72 |
Correct |
4 ms |
15448 KB |
Output is correct |
73 |
Correct |
2 ms |
9052 KB |
Output is correct |
74 |
Correct |
5 ms |
19564 KB |
Output is correct |
75 |
Correct |
15 ms |
25692 KB |
Output is correct |
76 |
Correct |
28 ms |
22540 KB |
Output is correct |
77 |
Correct |
16 ms |
12756 KB |
Output is correct |
78 |
Correct |
21 ms |
15192 KB |
Output is correct |
79 |
Correct |
4 ms |
27484 KB |
Output is correct |
80 |
Correct |
4 ms |
27484 KB |
Output is correct |
81 |
Correct |
4 ms |
27484 KB |
Output is correct |
82 |
Correct |
4 ms |
27484 KB |
Output is correct |
83 |
Correct |
4 ms |
27484 KB |
Output is correct |
84 |
Correct |
16 ms |
27740 KB |
Output is correct |
85 |
Correct |
21 ms |
27740 KB |
Output is correct |
86 |
Correct |
15 ms |
27736 KB |
Output is correct |
87 |
Correct |
17 ms |
27736 KB |
Output is correct |
88 |
Correct |
13 ms |
27736 KB |
Output is correct |
89 |
Correct |
15 ms |
27920 KB |
Output is correct |
90 |
Correct |
91 ms |
32088 KB |
Output is correct |
91 |
Correct |
91 ms |
32080 KB |
Output is correct |
92 |
Correct |
88 ms |
32128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9048 KB |
Output is correct |
2 |
Correct |
2 ms |
9052 KB |
Output is correct |
3 |
Correct |
1 ms |
6744 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
3 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6744 KB |
Output is correct |
12 |
Correct |
2 ms |
7004 KB |
Output is correct |
13 |
Correct |
1 ms |
6748 KB |
Output is correct |
14 |
Correct |
1 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
7000 KB |
Output is correct |
16 |
Correct |
2 ms |
7004 KB |
Output is correct |
17 |
Correct |
2 ms |
7000 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
7004 KB |
Output is correct |
20 |
Correct |
2 ms |
7000 KB |
Output is correct |
21 |
Correct |
2 ms |
7004 KB |
Output is correct |
22 |
Correct |
2 ms |
7004 KB |
Output is correct |
23 |
Correct |
2 ms |
6844 KB |
Output is correct |
24 |
Correct |
14 ms |
11356 KB |
Output is correct |
25 |
Correct |
15 ms |
11404 KB |
Output is correct |
26 |
Correct |
14 ms |
11352 KB |
Output is correct |
27 |
Correct |
3 ms |
7004 KB |
Output is correct |
28 |
Correct |
3 ms |
7004 KB |
Output is correct |
29 |
Correct |
3 ms |
7000 KB |
Output is correct |
30 |
Correct |
3 ms |
7004 KB |
Output is correct |
31 |
Correct |
3 ms |
7004 KB |
Output is correct |
32 |
Correct |
3 ms |
7000 KB |
Output is correct |
33 |
Correct |
7 ms |
8024 KB |
Output is correct |
34 |
Correct |
6 ms |
8028 KB |
Output is correct |
35 |
Correct |
7 ms |
8028 KB |
Output is correct |
36 |
Correct |
6 ms |
8028 KB |
Output is correct |
37 |
Correct |
7 ms |
8028 KB |
Output is correct |
38 |
Correct |
7 ms |
8028 KB |
Output is correct |
39 |
Correct |
17 ms |
11612 KB |
Output is correct |
40 |
Correct |
17 ms |
11608 KB |
Output is correct |
41 |
Correct |
17 ms |
11612 KB |
Output is correct |
42 |
Correct |
2 ms |
8796 KB |
Output is correct |
43 |
Correct |
2 ms |
9052 KB |
Output is correct |
44 |
Correct |
2 ms |
8796 KB |
Output is correct |
45 |
Correct |
2 ms |
9052 KB |
Output is correct |
46 |
Correct |
2 ms |
11100 KB |
Output is correct |
47 |
Correct |
3 ms |
11100 KB |
Output is correct |
48 |
Correct |
3 ms |
11100 KB |
Output is correct |
49 |
Correct |
2 ms |
9052 KB |
Output is correct |
50 |
Correct |
5 ms |
13148 KB |
Output is correct |
51 |
Correct |
17 ms |
23388 KB |
Output is correct |
52 |
Correct |
20 ms |
23460 KB |
Output is correct |
53 |
Correct |
10 ms |
21340 KB |
Output is correct |
54 |
Correct |
16 ms |
23448 KB |
Output is correct |
55 |
Correct |
15 ms |
25512 KB |
Output is correct |
56 |
Correct |
2 ms |
9032 KB |
Output is correct |
57 |
Correct |
2 ms |
9052 KB |
Output is correct |
58 |
Correct |
23 ms |
23488 KB |
Output is correct |
59 |
Correct |
14 ms |
23440 KB |
Output is correct |
60 |
Correct |
13 ms |
15192 KB |
Output is correct |
61 |
Correct |
5 ms |
13148 KB |
Output is correct |
62 |
Correct |
2 ms |
9052 KB |
Output is correct |
63 |
Correct |
2 ms |
11100 KB |
Output is correct |
64 |
Correct |
6 ms |
11112 KB |
Output is correct |
65 |
Correct |
8 ms |
13148 KB |
Output is correct |
66 |
Correct |
8 ms |
13400 KB |
Output is correct |
67 |
Correct |
10 ms |
13148 KB |
Output is correct |
68 |
Correct |
45 ms |
27484 KB |
Output is correct |
69 |
Correct |
40 ms |
27484 KB |
Output is correct |
70 |
Correct |
32 ms |
27480 KB |
Output is correct |
71 |
Correct |
37 ms |
27484 KB |
Output is correct |
72 |
Correct |
35 ms |
27484 KB |
Output is correct |
73 |
Correct |
35 ms |
27480 KB |
Output is correct |
74 |
Correct |
64 ms |
27480 KB |
Output is correct |
75 |
Correct |
27 ms |
27480 KB |
Output is correct |
76 |
Correct |
61 ms |
27484 KB |
Output is correct |
77 |
Correct |
31 ms |
27728 KB |
Output is correct |
78 |
Correct |
62 ms |
27484 KB |
Output is correct |
79 |
Correct |
33 ms |
27484 KB |
Output is correct |
80 |
Correct |
4 ms |
25436 KB |
Output is correct |
81 |
Correct |
2 ms |
11100 KB |
Output is correct |
82 |
Correct |
3 ms |
19288 KB |
Output is correct |
83 |
Correct |
3 ms |
15196 KB |
Output is correct |
84 |
Correct |
4 ms |
19292 KB |
Output is correct |
85 |
Correct |
15 ms |
25784 KB |
Output is correct |
86 |
Correct |
10 ms |
23640 KB |
Output is correct |
87 |
Correct |
4 ms |
15448 KB |
Output is correct |
88 |
Correct |
2 ms |
9052 KB |
Output is correct |
89 |
Correct |
5 ms |
19564 KB |
Output is correct |
90 |
Correct |
15 ms |
25692 KB |
Output is correct |
91 |
Correct |
28 ms |
22540 KB |
Output is correct |
92 |
Correct |
16 ms |
12756 KB |
Output is correct |
93 |
Correct |
21 ms |
15192 KB |
Output is correct |
94 |
Correct |
4 ms |
27484 KB |
Output is correct |
95 |
Correct |
4 ms |
27484 KB |
Output is correct |
96 |
Correct |
4 ms |
27484 KB |
Output is correct |
97 |
Correct |
4 ms |
27484 KB |
Output is correct |
98 |
Correct |
4 ms |
27484 KB |
Output is correct |
99 |
Correct |
16 ms |
27740 KB |
Output is correct |
100 |
Correct |
21 ms |
27740 KB |
Output is correct |
101 |
Correct |
15 ms |
27736 KB |
Output is correct |
102 |
Correct |
17 ms |
27736 KB |
Output is correct |
103 |
Correct |
13 ms |
27736 KB |
Output is correct |
104 |
Correct |
15 ms |
27920 KB |
Output is correct |
105 |
Correct |
91 ms |
32088 KB |
Output is correct |
106 |
Correct |
91 ms |
32080 KB |
Output is correct |
107 |
Correct |
88 ms |
32128 KB |
Output is correct |
108 |
Correct |
53 ms |
138876 KB |
Output is correct |
109 |
Correct |
42 ms |
170836 KB |
Output is correct |
110 |
Correct |
49 ms |
158804 KB |
Output is correct |
111 |
Correct |
48 ms |
158040 KB |
Output is correct |
112 |
Correct |
64 ms |
189396 KB |
Output is correct |
113 |
Correct |
74 ms |
184916 KB |
Output is correct |
114 |
Correct |
163 ms |
193616 KB |
Output is correct |
115 |
Correct |
24 ms |
95008 KB |
Output is correct |
116 |
Correct |
195 ms |
209988 KB |
Output is correct |
117 |
Correct |
125 ms |
155288 KB |
Output is correct |
118 |
Correct |
33 ms |
117588 KB |
Output is correct |
119 |
Correct |
323 ms |
256768 KB |
Output is correct |
120 |
Correct |
375 ms |
263748 KB |
Output is correct |
121 |
Correct |
276 ms |
220996 KB |
Output is correct |
122 |
Correct |
114 ms |
148196 KB |
Output is correct |
123 |
Correct |
52 ms |
145440 KB |
Output is correct |
124 |
Correct |
66 ms |
151376 KB |
Output is correct |
125 |
Correct |
38 ms |
149256 KB |
Output is correct |
126 |
Correct |
25 ms |
125276 KB |
Output is correct |
127 |
Correct |
146 ms |
187220 KB |
Output is correct |
128 |
Correct |
35 ms |
123992 KB |
Output is correct |
129 |
Correct |
41 ms |
130380 KB |
Output is correct |
130 |
Correct |
23 ms |
142016 KB |
Output is correct |
131 |
Correct |
54 ms |
206584 KB |
Output is correct |
132 |
Correct |
87 ms |
231760 KB |
Output is correct |
133 |
Correct |
105 ms |
248460 KB |
Output is correct |
134 |
Correct |
104 ms |
261456 KB |
Output is correct |
135 |
Correct |
109 ms |
267604 KB |
Output is correct |
136 |
Correct |
611 ms |
343924 KB |
Output is correct |
137 |
Correct |
623 ms |
344164 KB |
Output is correct |
138 |
Correct |
626 ms |
344372 KB |
Output is correct |
139 |
Correct |
635 ms |
344056 KB |
Output is correct |
140 |
Correct |
607 ms |
343900 KB |
Output is correct |
141 |
Correct |
617 ms |
344208 KB |
Output is correct |
142 |
Correct |
682 ms |
359696 KB |
Output is correct |
143 |
Correct |
560 ms |
290800 KB |
Output is correct |
144 |
Correct |
662 ms |
359252 KB |
Output is correct |
145 |
Correct |
508 ms |
290900 KB |
Output is correct |
146 |
Correct |
663 ms |
359280 KB |
Output is correct |
147 |
Correct |
484 ms |
290728 KB |
Output is correct |
148 |
Correct |
642 ms |
314360 KB |
Output is correct |
149 |
Correct |
290 ms |
262736 KB |
Output is correct |
150 |
Correct |
199 ms |
212816 KB |
Output is correct |
151 |
Correct |
141 ms |
191720 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
9048 KB |
Output is correct |
2 |
Correct |
2 ms |
9052 KB |
Output is correct |
3 |
Correct |
1 ms |
6744 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
3 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6744 KB |
Output is correct |
12 |
Correct |
2 ms |
7004 KB |
Output is correct |
13 |
Correct |
1 ms |
6748 KB |
Output is correct |
14 |
Correct |
1 ms |
7004 KB |
Output is correct |
15 |
Correct |
2 ms |
7000 KB |
Output is correct |
16 |
Correct |
2 ms |
7004 KB |
Output is correct |
17 |
Correct |
2 ms |
7000 KB |
Output is correct |
18 |
Correct |
2 ms |
7000 KB |
Output is correct |
19 |
Correct |
2 ms |
7004 KB |
Output is correct |
20 |
Correct |
2 ms |
7000 KB |
Output is correct |
21 |
Correct |
2 ms |
7004 KB |
Output is correct |
22 |
Correct |
2 ms |
7004 KB |
Output is correct |
23 |
Correct |
2 ms |
6844 KB |
Output is correct |
24 |
Correct |
14 ms |
11356 KB |
Output is correct |
25 |
Correct |
15 ms |
11404 KB |
Output is correct |
26 |
Correct |
14 ms |
11352 KB |
Output is correct |
27 |
Correct |
3 ms |
7004 KB |
Output is correct |
28 |
Correct |
3 ms |
7004 KB |
Output is correct |
29 |
Correct |
3 ms |
7000 KB |
Output is correct |
30 |
Correct |
3 ms |
7004 KB |
Output is correct |
31 |
Correct |
3 ms |
7004 KB |
Output is correct |
32 |
Correct |
3 ms |
7000 KB |
Output is correct |
33 |
Correct |
7 ms |
8024 KB |
Output is correct |
34 |
Correct |
6 ms |
8028 KB |
Output is correct |
35 |
Correct |
7 ms |
8028 KB |
Output is correct |
36 |
Correct |
6 ms |
8028 KB |
Output is correct |
37 |
Correct |
7 ms |
8028 KB |
Output is correct |
38 |
Correct |
7 ms |
8028 KB |
Output is correct |
39 |
Correct |
17 ms |
11612 KB |
Output is correct |
40 |
Correct |
17 ms |
11608 KB |
Output is correct |
41 |
Correct |
17 ms |
11612 KB |
Output is correct |
42 |
Correct |
8 ms |
9564 KB |
Output is correct |
43 |
Correct |
5 ms |
7260 KB |
Output is correct |
44 |
Correct |
9 ms |
9696 KB |
Output is correct |
45 |
Correct |
7 ms |
7260 KB |
Output is correct |
46 |
Correct |
6 ms |
7260 KB |
Output is correct |
47 |
Correct |
10 ms |
9820 KB |
Output is correct |
48 |
Correct |
33 ms |
19540 KB |
Output is correct |
49 |
Correct |
21 ms |
12636 KB |
Output is correct |
50 |
Correct |
25 ms |
15844 KB |
Output is correct |
51 |
Correct |
42 ms |
15708 KB |
Output is correct |
52 |
Correct |
31 ms |
15164 KB |
Output is correct |
53 |
Correct |
23 ms |
12636 KB |
Output is correct |
54 |
Correct |
8 ms |
9820 KB |
Output is correct |
55 |
Correct |
9 ms |
9840 KB |
Output is correct |
56 |
Correct |
10 ms |
9820 KB |
Output is correct |
57 |
Correct |
9 ms |
9820 KB |
Output is correct |
58 |
Correct |
11 ms |
9692 KB |
Output is correct |
59 |
Correct |
9 ms |
9816 KB |
Output is correct |
60 |
Correct |
36 ms |
20308 KB |
Output is correct |
61 |
Correct |
46 ms |
20316 KB |
Output is correct |
62 |
Correct |
37 ms |
20392 KB |
Output is correct |
63 |
Correct |
37 ms |
20308 KB |
Output is correct |
64 |
Correct |
37 ms |
20312 KB |
Output is correct |
65 |
Correct |
38 ms |
20168 KB |
Output is correct |
66 |
Correct |
38 ms |
19292 KB |
Output is correct |
67 |
Correct |
37 ms |
19280 KB |
Output is correct |
68 |
Correct |
38 ms |
19284 KB |
Output is correct |
69 |
Correct |
2 ms |
8796 KB |
Output is correct |
70 |
Correct |
2 ms |
9052 KB |
Output is correct |
71 |
Correct |
2 ms |
8796 KB |
Output is correct |
72 |
Correct |
2 ms |
9052 KB |
Output is correct |
73 |
Correct |
2 ms |
11100 KB |
Output is correct |
74 |
Correct |
3 ms |
11100 KB |
Output is correct |
75 |
Correct |
3 ms |
11100 KB |
Output is correct |
76 |
Correct |
2 ms |
9052 KB |
Output is correct |
77 |
Correct |
5 ms |
13148 KB |
Output is correct |
78 |
Correct |
17 ms |
23388 KB |
Output is correct |
79 |
Correct |
20 ms |
23460 KB |
Output is correct |
80 |
Correct |
10 ms |
21340 KB |
Output is correct |
81 |
Correct |
16 ms |
23448 KB |
Output is correct |
82 |
Correct |
15 ms |
25512 KB |
Output is correct |
83 |
Correct |
2 ms |
9032 KB |
Output is correct |
84 |
Correct |
2 ms |
9052 KB |
Output is correct |
85 |
Correct |
23 ms |
23488 KB |
Output is correct |
86 |
Correct |
14 ms |
23440 KB |
Output is correct |
87 |
Correct |
13 ms |
15192 KB |
Output is correct |
88 |
Correct |
5 ms |
13148 KB |
Output is correct |
89 |
Correct |
2 ms |
9052 KB |
Output is correct |
90 |
Correct |
2 ms |
11100 KB |
Output is correct |
91 |
Correct |
6 ms |
11112 KB |
Output is correct |
92 |
Correct |
8 ms |
13148 KB |
Output is correct |
93 |
Correct |
8 ms |
13400 KB |
Output is correct |
94 |
Correct |
10 ms |
13148 KB |
Output is correct |
95 |
Correct |
45 ms |
27484 KB |
Output is correct |
96 |
Correct |
40 ms |
27484 KB |
Output is correct |
97 |
Correct |
32 ms |
27480 KB |
Output is correct |
98 |
Correct |
37 ms |
27484 KB |
Output is correct |
99 |
Correct |
35 ms |
27484 KB |
Output is correct |
100 |
Correct |
35 ms |
27480 KB |
Output is correct |
101 |
Correct |
64 ms |
27480 KB |
Output is correct |
102 |
Correct |
27 ms |
27480 KB |
Output is correct |
103 |
Correct |
61 ms |
27484 KB |
Output is correct |
104 |
Correct |
31 ms |
27728 KB |
Output is correct |
105 |
Correct |
62 ms |
27484 KB |
Output is correct |
106 |
Correct |
33 ms |
27484 KB |
Output is correct |
107 |
Correct |
4 ms |
25436 KB |
Output is correct |
108 |
Correct |
2 ms |
11100 KB |
Output is correct |
109 |
Correct |
3 ms |
19288 KB |
Output is correct |
110 |
Correct |
3 ms |
15196 KB |
Output is correct |
111 |
Correct |
4 ms |
19292 KB |
Output is correct |
112 |
Correct |
15 ms |
25784 KB |
Output is correct |
113 |
Correct |
10 ms |
23640 KB |
Output is correct |
114 |
Correct |
4 ms |
15448 KB |
Output is correct |
115 |
Correct |
2 ms |
9052 KB |
Output is correct |
116 |
Correct |
5 ms |
19564 KB |
Output is correct |
117 |
Correct |
15 ms |
25692 KB |
Output is correct |
118 |
Correct |
28 ms |
22540 KB |
Output is correct |
119 |
Correct |
16 ms |
12756 KB |
Output is correct |
120 |
Correct |
21 ms |
15192 KB |
Output is correct |
121 |
Correct |
4 ms |
27484 KB |
Output is correct |
122 |
Correct |
4 ms |
27484 KB |
Output is correct |
123 |
Correct |
4 ms |
27484 KB |
Output is correct |
124 |
Correct |
4 ms |
27484 KB |
Output is correct |
125 |
Correct |
4 ms |
27484 KB |
Output is correct |
126 |
Correct |
16 ms |
27740 KB |
Output is correct |
127 |
Correct |
21 ms |
27740 KB |
Output is correct |
128 |
Correct |
15 ms |
27736 KB |
Output is correct |
129 |
Correct |
17 ms |
27736 KB |
Output is correct |
130 |
Correct |
13 ms |
27736 KB |
Output is correct |
131 |
Correct |
15 ms |
27920 KB |
Output is correct |
132 |
Correct |
91 ms |
32088 KB |
Output is correct |
133 |
Correct |
91 ms |
32080 KB |
Output is correct |
134 |
Correct |
88 ms |
32128 KB |
Output is correct |
135 |
Correct |
53 ms |
138876 KB |
Output is correct |
136 |
Correct |
42 ms |
170836 KB |
Output is correct |
137 |
Correct |
49 ms |
158804 KB |
Output is correct |
138 |
Correct |
48 ms |
158040 KB |
Output is correct |
139 |
Correct |
64 ms |
189396 KB |
Output is correct |
140 |
Correct |
74 ms |
184916 KB |
Output is correct |
141 |
Correct |
163 ms |
193616 KB |
Output is correct |
142 |
Correct |
24 ms |
95008 KB |
Output is correct |
143 |
Correct |
195 ms |
209988 KB |
Output is correct |
144 |
Correct |
125 ms |
155288 KB |
Output is correct |
145 |
Correct |
33 ms |
117588 KB |
Output is correct |
146 |
Correct |
323 ms |
256768 KB |
Output is correct |
147 |
Correct |
375 ms |
263748 KB |
Output is correct |
148 |
Correct |
276 ms |
220996 KB |
Output is correct |
149 |
Correct |
114 ms |
148196 KB |
Output is correct |
150 |
Correct |
52 ms |
145440 KB |
Output is correct |
151 |
Correct |
66 ms |
151376 KB |
Output is correct |
152 |
Correct |
38 ms |
149256 KB |
Output is correct |
153 |
Correct |
25 ms |
125276 KB |
Output is correct |
154 |
Correct |
146 ms |
187220 KB |
Output is correct |
155 |
Correct |
35 ms |
123992 KB |
Output is correct |
156 |
Correct |
41 ms |
130380 KB |
Output is correct |
157 |
Correct |
23 ms |
142016 KB |
Output is correct |
158 |
Correct |
54 ms |
206584 KB |
Output is correct |
159 |
Correct |
87 ms |
231760 KB |
Output is correct |
160 |
Correct |
105 ms |
248460 KB |
Output is correct |
161 |
Correct |
104 ms |
261456 KB |
Output is correct |
162 |
Correct |
109 ms |
267604 KB |
Output is correct |
163 |
Correct |
611 ms |
343924 KB |
Output is correct |
164 |
Correct |
623 ms |
344164 KB |
Output is correct |
165 |
Correct |
626 ms |
344372 KB |
Output is correct |
166 |
Correct |
635 ms |
344056 KB |
Output is correct |
167 |
Correct |
607 ms |
343900 KB |
Output is correct |
168 |
Correct |
617 ms |
344208 KB |
Output is correct |
169 |
Correct |
682 ms |
359696 KB |
Output is correct |
170 |
Correct |
560 ms |
290800 KB |
Output is correct |
171 |
Correct |
662 ms |
359252 KB |
Output is correct |
172 |
Correct |
508 ms |
290900 KB |
Output is correct |
173 |
Correct |
663 ms |
359280 KB |
Output is correct |
174 |
Correct |
484 ms |
290728 KB |
Output is correct |
175 |
Correct |
642 ms |
314360 KB |
Output is correct |
176 |
Correct |
290 ms |
262736 KB |
Output is correct |
177 |
Correct |
199 ms |
212816 KB |
Output is correct |
178 |
Correct |
141 ms |
191720 KB |
Output is correct |
179 |
Incorrect |
5 ms |
7260 KB |
Output isn't correct |
180 |
Halted |
0 ms |
0 KB |
- |