# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697507 | 2023-02-10T07:05:59 Z | sharaelong | Painting Walls (APIO20_paint) | C++17 | 1500 ms | 314728 KB |
#pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include "paint.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX_N = 1e5 + 1; bool processed[MAX_N][633]; int minimumInstructions(int n, int m, int k, vector<int> C, vector<int> A, vector<vector<int>> B) { vector<vector<int>> likes(k); for (int i=0; i<m; ++i) { for (int j=0; j<A[i]; ++j) { likes[B[i][j]].push_back(i); } } // for (int i=0; i<k; ++i) { // for (int x: likes[i]) cout << x << ' '; // cout << endl; // } vector<vector<int>> nxt(n); // vector<vector<bool>> processed(n); for (int i=0; i<n; ++i) { nxt[i].resize(likes[C[i]].size(), -1); // processed[i].resize(likes[C[i]].size(), false); } // vector<int> pnt(n, 0); for (int i=0; i+1<n; ++i) { int pnt = 0; const vector<int>& cands = likes[C[i+1]]; for (int j=0; j<likes[C[i]].size(); ++j) { int x = likes[C[i]][j]; if (x+1 < m) { while (pnt < cands.size() && cands[pnt] <= x) pnt++; if (pnt < cands.size() && cands[pnt] == x+1) nxt[i][j] = pnt; } else { if (!cands.empty() && cands[0] == 0) nxt[i][j] = 0; } } } // for (int i=0; i<n; ++i) { // for (int x: nxt[i]) cout << x << ' '; // cout << endl; // } vector<int> okay(n+1, 0); for (int i=0; i<n; ++i) { for (int j=0; j<likes[C[i]].size(); ++j) { if (!processed[i][j]) { processed[i][j] = true; int ii = i, jj = j; while (ii < n && nxt[ii][jj] != -1) { jj = nxt[ii][jj]; ii++; processed[ii][jj] = true; } if (ii == n) ii--; if (ii-i+1 >= m) { okay[i]++; okay[ii-m+2]--; } } } } for (int i=1; i<okay.size(); ++i) okay[i] += okay[i-1]; // for (int i=0; i<n; ++i) cout << okay[i] << ' '; // cout << endl; vector<int> valid_pos; for (int i=0; i<n; ++i) { if (okay[i] > 0) valid_pos.push_back(i); } if (valid_pos.empty() || valid_pos[0] > 0) return -1; int ans = 1; int curr = 0; while (curr + m < n) { auto it = upper_bound(valid_pos.begin(), valid_pos.end(), curr+m); if (*prev(it) == curr) return -1; curr = *prev(it); ans++; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 1 ms | 596 KB | Output is correct |
8 | Correct | 1 ms | 596 KB | Output is correct |
9 | Correct | 1 ms | 596 KB | Output is correct |
10 | Correct | 1 ms | 596 KB | Output is correct |
11 | Correct | 1 ms | 596 KB | Output is correct |
12 | Correct | 1 ms | 596 KB | Output is correct |
13 | Correct | 2 ms | 3028 KB | Output is correct |
14 | Correct | 2 ms | 3028 KB | Output is correct |
15 | Correct | 2 ms | 3028 KB | Output is correct |
16 | Correct | 2 ms | 3028 KB | Output is correct |
17 | Correct | 2 ms | 3028 KB | Output is correct |
18 | Correct | 2 ms | 3028 KB | Output is correct |
19 | Correct | 2 ms | 2772 KB | Output is correct |
20 | Correct | 2 ms | 2644 KB | Output is correct |
21 | Correct | 2 ms | 2644 KB | Output is correct |
22 | Correct | 18 ms | 6828 KB | Output is correct |
23 | Correct | 17 ms | 6868 KB | Output is correct |
24 | Correct | 19 ms | 6900 KB | Output is correct |
25 | Correct | 9 ms | 14164 KB | Output is correct |
26 | Correct | 9 ms | 14164 KB | Output is correct |
27 | Correct | 9 ms | 14056 KB | Output is correct |
28 | Correct | 10 ms | 14036 KB | Output is correct |
29 | Correct | 10 ms | 13984 KB | Output is correct |
30 | Correct | 10 ms | 14032 KB | Output is correct |
31 | Correct | 14 ms | 17492 KB | Output is correct |
32 | Correct | 14 ms | 17464 KB | Output is correct |
33 | Correct | 14 ms | 17440 KB | Output is correct |
34 | Correct | 16 ms | 17452 KB | Output is correct |
35 | Correct | 17 ms | 17484 KB | Output is correct |
36 | Correct | 17 ms | 17452 KB | Output is correct |
37 | Correct | 33 ms | 20352 KB | Output is correct |
38 | Correct | 54 ms | 20436 KB | Output is correct |
39 | Correct | 44 ms | 20316 KB | Output is correct |
40 | Correct | 51 ms | 63088 KB | Output is correct |
41 | Correct | 24 ms | 39612 KB | Output is correct |
42 | Correct | 45 ms | 68164 KB | Output is correct |
43 | Correct | 30 ms | 45192 KB | Output is correct |
44 | Correct | 27 ms | 40988 KB | Output is correct |
45 | Correct | 46 ms | 68684 KB | Output is correct |
46 | Correct | 65 ms | 70560 KB | Output is correct |
47 | Correct | 41 ms | 45316 KB | Output is correct |
48 | Correct | 44 ms | 47532 KB | Output is correct |
49 | Correct | 62 ms | 50988 KB | Output is correct |
50 | Correct | 69 ms | 57028 KB | Output is correct |
51 | Correct | 58 ms | 57036 KB | Output is correct |
52 | Correct | 43 ms | 69464 KB | Output is correct |
53 | Correct | 43 ms | 69528 KB | Output is correct |
54 | Correct | 45 ms | 69240 KB | Output is correct |
55 | Correct | 46 ms | 68924 KB | Output is correct |
56 | Correct | 46 ms | 68796 KB | Output is correct |
57 | Correct | 46 ms | 68812 KB | Output is correct |
58 | Correct | 73 ms | 80608 KB | Output is correct |
59 | Correct | 73 ms | 80620 KB | Output is correct |
60 | Correct | 75 ms | 80628 KB | Output is correct |
61 | Correct | 98 ms | 80584 KB | Output is correct |
62 | Correct | 72 ms | 80500 KB | Output is correct |
63 | Correct | 72 ms | 80536 KB | Output is correct |
64 | Correct | 88 ms | 79504 KB | Output is correct |
65 | Correct | 87 ms | 79344 KB | Output is correct |
66 | Correct | 88 ms | 79384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 1 ms | 596 KB | Output is correct |
8 | Correct | 1 ms | 596 KB | Output is correct |
9 | Correct | 1 ms | 596 KB | Output is correct |
10 | Correct | 1 ms | 596 KB | Output is correct |
11 | Correct | 1 ms | 596 KB | Output is correct |
12 | Correct | 1 ms | 596 KB | Output is correct |
13 | Correct | 2 ms | 3028 KB | Output is correct |
14 | Correct | 2 ms | 3028 KB | Output is correct |
15 | Correct | 2 ms | 3028 KB | Output is correct |
16 | Correct | 2 ms | 3028 KB | Output is correct |
17 | Correct | 2 ms | 3028 KB | Output is correct |
18 | Correct | 2 ms | 3028 KB | Output is correct |
19 | Correct | 2 ms | 2772 KB | Output is correct |
20 | Correct | 2 ms | 2644 KB | Output is correct |
21 | Correct | 2 ms | 2644 KB | Output is correct |
22 | Correct | 0 ms | 212 KB | Output is correct |
23 | Correct | 0 ms | 312 KB | Output is correct |
24 | Correct | 1 ms | 212 KB | Output is correct |
25 | Correct | 0 ms | 212 KB | Output is correct |
26 | Correct | 1 ms | 212 KB | Output is correct |
27 | Correct | 1 ms | 468 KB | Output is correct |
28 | Correct | 1 ms | 468 KB | Output is correct |
29 | Correct | 1 ms | 468 KB | Output is correct |
30 | Correct | 1 ms | 468 KB | Output is correct |
31 | Correct | 1 ms | 596 KB | Output is correct |
32 | Correct | 1 ms | 468 KB | Output is correct |
33 | Correct | 3 ms | 2516 KB | Output is correct |
34 | Correct | 2 ms | 2132 KB | Output is correct |
35 | Correct | 1 ms | 1748 KB | Output is correct |
36 | Correct | 2 ms | 2900 KB | Output is correct |
37 | Correct | 1 ms | 2388 KB | Output is correct |
38 | Correct | 3 ms | 2388 KB | Output is correct |
39 | Correct | 1 ms | 468 KB | Output is correct |
40 | Correct | 1 ms | 2132 KB | Output is correct |
41 | Correct | 1 ms | 468 KB | Output is correct |
42 | Correct | 2 ms | 2516 KB | Output is correct |
43 | Correct | 2 ms | 2644 KB | Output is correct |
44 | Correct | 1 ms | 596 KB | Output is correct |
45 | Correct | 1 ms | 596 KB | Output is correct |
46 | Correct | 1 ms | 596 KB | Output is correct |
47 | Correct | 1 ms | 596 KB | Output is correct |
48 | Correct | 1 ms | 596 KB | Output is correct |
49 | Correct | 1 ms | 596 KB | Output is correct |
50 | Correct | 2 ms | 3028 KB | Output is correct |
51 | Correct | 2 ms | 3028 KB | Output is correct |
52 | Correct | 2 ms | 3028 KB | Output is correct |
53 | Correct | 2 ms | 3028 KB | Output is correct |
54 | Correct | 2 ms | 3028 KB | Output is correct |
55 | Correct | 2 ms | 3028 KB | Output is correct |
56 | Correct | 2 ms | 2644 KB | Output is correct |
57 | Correct | 1 ms | 596 KB | Output is correct |
58 | Correct | 2 ms | 2644 KB | Output is correct |
59 | Correct | 1 ms | 596 KB | Output is correct |
60 | Correct | 2 ms | 2644 KB | Output is correct |
61 | Correct | 1 ms | 596 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 312 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 596 KB | Output is correct |
10 | Correct | 1 ms | 596 KB | Output is correct |
11 | Correct | 1 ms | 596 KB | Output is correct |
12 | Correct | 1 ms | 596 KB | Output is correct |
13 | Correct | 1 ms | 596 KB | Output is correct |
14 | Correct | 1 ms | 596 KB | Output is correct |
15 | Correct | 2 ms | 3028 KB | Output is correct |
16 | Correct | 2 ms | 3028 KB | Output is correct |
17 | Correct | 2 ms | 3028 KB | Output is correct |
18 | Correct | 2 ms | 3028 KB | Output is correct |
19 | Correct | 2 ms | 3028 KB | Output is correct |
20 | Correct | 2 ms | 3028 KB | Output is correct |
21 | Correct | 2 ms | 2772 KB | Output is correct |
22 | Correct | 2 ms | 2644 KB | Output is correct |
23 | Correct | 2 ms | 2644 KB | Output is correct |
24 | Correct | 18 ms | 6828 KB | Output is correct |
25 | Correct | 17 ms | 6868 KB | Output is correct |
26 | Correct | 19 ms | 6900 KB | Output is correct |
27 | Correct | 1 ms | 212 KB | Output is correct |
28 | Correct | 0 ms | 212 KB | Output is correct |
29 | Correct | 1 ms | 212 KB | Output is correct |
30 | Correct | 1 ms | 468 KB | Output is correct |
31 | Correct | 1 ms | 468 KB | Output is correct |
32 | Correct | 1 ms | 468 KB | Output is correct |
33 | Correct | 1 ms | 468 KB | Output is correct |
34 | Correct | 1 ms | 596 KB | Output is correct |
35 | Correct | 1 ms | 468 KB | Output is correct |
36 | Correct | 3 ms | 2516 KB | Output is correct |
37 | Correct | 2 ms | 2132 KB | Output is correct |
38 | Correct | 1 ms | 1748 KB | Output is correct |
39 | Correct | 2 ms | 2900 KB | Output is correct |
40 | Correct | 1 ms | 2388 KB | Output is correct |
41 | Correct | 3 ms | 2388 KB | Output is correct |
42 | Correct | 1 ms | 468 KB | Output is correct |
43 | Correct | 1 ms | 2132 KB | Output is correct |
44 | Correct | 1 ms | 468 KB | Output is correct |
45 | Correct | 2 ms | 2516 KB | Output is correct |
46 | Correct | 2 ms | 2644 KB | Output is correct |
47 | Correct | 1 ms | 596 KB | Output is correct |
48 | Correct | 1 ms | 596 KB | Output is correct |
49 | Correct | 1 ms | 596 KB | Output is correct |
50 | Correct | 1 ms | 596 KB | Output is correct |
51 | Correct | 1 ms | 596 KB | Output is correct |
52 | Correct | 1 ms | 596 KB | Output is correct |
53 | Correct | 2 ms | 3028 KB | Output is correct |
54 | Correct | 2 ms | 3028 KB | Output is correct |
55 | Correct | 2 ms | 3028 KB | Output is correct |
56 | Correct | 2 ms | 3028 KB | Output is correct |
57 | Correct | 2 ms | 3028 KB | Output is correct |
58 | Correct | 2 ms | 3028 KB | Output is correct |
59 | Correct | 2 ms | 2644 KB | Output is correct |
60 | Correct | 1 ms | 596 KB | Output is correct |
61 | Correct | 2 ms | 2644 KB | Output is correct |
62 | Correct | 1 ms | 596 KB | Output is correct |
63 | Correct | 2 ms | 2644 KB | Output is correct |
64 | Correct | 1 ms | 596 KB | Output is correct |
65 | Correct | 1 ms | 596 KB | Output is correct |
66 | Correct | 1 ms | 596 KB | Output is correct |
67 | Correct | 1 ms | 852 KB | Output is correct |
68 | Correct | 1 ms | 724 KB | Output is correct |
69 | Correct | 1 ms | 724 KB | Output is correct |
70 | Correct | 3 ms | 2772 KB | Output is correct |
71 | Correct | 3 ms | 2388 KB | Output is correct |
72 | Correct | 2 ms | 2132 KB | Output is correct |
73 | Correct | 2 ms | 2260 KB | Output is correct |
74 | Correct | 4 ms | 2516 KB | Output is correct |
75 | Correct | 3 ms | 2900 KB | Output is correct |
76 | Correct | 24 ms | 4788 KB | Output is correct |
77 | Correct | 24 ms | 5608 KB | Output is correct |
78 | Correct | 22 ms | 6252 KB | Output is correct |
79 | Correct | 2 ms | 980 KB | Output is correct |
80 | Correct | 2 ms | 980 KB | Output is correct |
81 | Correct | 2 ms | 980 KB | Output is correct |
82 | Correct | 2 ms | 980 KB | Output is correct |
83 | Correct | 2 ms | 980 KB | Output is correct |
84 | Correct | 6 ms | 3156 KB | Output is correct |
85 | Correct | 3 ms | 3156 KB | Output is correct |
86 | Correct | 4 ms | 3156 KB | Output is correct |
87 | Correct | 4 ms | 3156 KB | Output is correct |
88 | Correct | 3 ms | 3156 KB | Output is correct |
89 | Correct | 3 ms | 3156 KB | Output is correct |
90 | Correct | 28 ms | 6744 KB | Output is correct |
91 | Correct | 27 ms | 6660 KB | Output is correct |
92 | Correct | 27 ms | 6724 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 312 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 596 KB | Output is correct |
10 | Correct | 1 ms | 596 KB | Output is correct |
11 | Correct | 1 ms | 596 KB | Output is correct |
12 | Correct | 1 ms | 596 KB | Output is correct |
13 | Correct | 1 ms | 596 KB | Output is correct |
14 | Correct | 1 ms | 596 KB | Output is correct |
15 | Correct | 2 ms | 3028 KB | Output is correct |
16 | Correct | 2 ms | 3028 KB | Output is correct |
17 | Correct | 2 ms | 3028 KB | Output is correct |
18 | Correct | 2 ms | 3028 KB | Output is correct |
19 | Correct | 2 ms | 3028 KB | Output is correct |
20 | Correct | 2 ms | 3028 KB | Output is correct |
21 | Correct | 2 ms | 2772 KB | Output is correct |
22 | Correct | 2 ms | 2644 KB | Output is correct |
23 | Correct | 2 ms | 2644 KB | Output is correct |
24 | Correct | 18 ms | 6828 KB | Output is correct |
25 | Correct | 17 ms | 6868 KB | Output is correct |
26 | Correct | 19 ms | 6900 KB | Output is correct |
27 | Correct | 9 ms | 14164 KB | Output is correct |
28 | Correct | 9 ms | 14164 KB | Output is correct |
29 | Correct | 9 ms | 14056 KB | Output is correct |
30 | Correct | 10 ms | 14036 KB | Output is correct |
31 | Correct | 10 ms | 13984 KB | Output is correct |
32 | Correct | 10 ms | 14032 KB | Output is correct |
33 | Correct | 14 ms | 17492 KB | Output is correct |
34 | Correct | 14 ms | 17464 KB | Output is correct |
35 | Correct | 14 ms | 17440 KB | Output is correct |
36 | Correct | 16 ms | 17452 KB | Output is correct |
37 | Correct | 17 ms | 17484 KB | Output is correct |
38 | Correct | 17 ms | 17452 KB | Output is correct |
39 | Correct | 33 ms | 20352 KB | Output is correct |
40 | Correct | 54 ms | 20436 KB | Output is correct |
41 | Correct | 44 ms | 20316 KB | Output is correct |
42 | Correct | 1 ms | 212 KB | Output is correct |
43 | Correct | 0 ms | 212 KB | Output is correct |
44 | Correct | 1 ms | 212 KB | Output is correct |
45 | Correct | 1 ms | 468 KB | Output is correct |
46 | Correct | 1 ms | 468 KB | Output is correct |
47 | Correct | 1 ms | 468 KB | Output is correct |
48 | Correct | 1 ms | 468 KB | Output is correct |
49 | Correct | 1 ms | 596 KB | Output is correct |
50 | Correct | 1 ms | 468 KB | Output is correct |
51 | Correct | 3 ms | 2516 KB | Output is correct |
52 | Correct | 2 ms | 2132 KB | Output is correct |
53 | Correct | 1 ms | 1748 KB | Output is correct |
54 | Correct | 2 ms | 2900 KB | Output is correct |
55 | Correct | 1 ms | 2388 KB | Output is correct |
56 | Correct | 3 ms | 2388 KB | Output is correct |
57 | Correct | 1 ms | 468 KB | Output is correct |
58 | Correct | 1 ms | 2132 KB | Output is correct |
59 | Correct | 1 ms | 468 KB | Output is correct |
60 | Correct | 2 ms | 2516 KB | Output is correct |
61 | Correct | 2 ms | 2644 KB | Output is correct |
62 | Correct | 1 ms | 596 KB | Output is correct |
63 | Correct | 1 ms | 596 KB | Output is correct |
64 | Correct | 1 ms | 596 KB | Output is correct |
65 | Correct | 1 ms | 596 KB | Output is correct |
66 | Correct | 1 ms | 596 KB | Output is correct |
67 | Correct | 1 ms | 596 KB | Output is correct |
68 | Correct | 2 ms | 3028 KB | Output is correct |
69 | Correct | 2 ms | 3028 KB | Output is correct |
70 | Correct | 2 ms | 3028 KB | Output is correct |
71 | Correct | 2 ms | 3028 KB | Output is correct |
72 | Correct | 2 ms | 3028 KB | Output is correct |
73 | Correct | 2 ms | 3028 KB | Output is correct |
74 | Correct | 2 ms | 2644 KB | Output is correct |
75 | Correct | 1 ms | 596 KB | Output is correct |
76 | Correct | 2 ms | 2644 KB | Output is correct |
77 | Correct | 1 ms | 596 KB | Output is correct |
78 | Correct | 2 ms | 2644 KB | Output is correct |
79 | Correct | 1 ms | 596 KB | Output is correct |
80 | Correct | 1 ms | 596 KB | Output is correct |
81 | Correct | 1 ms | 596 KB | Output is correct |
82 | Correct | 1 ms | 852 KB | Output is correct |
83 | Correct | 1 ms | 724 KB | Output is correct |
84 | Correct | 1 ms | 724 KB | Output is correct |
85 | Correct | 3 ms | 2772 KB | Output is correct |
86 | Correct | 3 ms | 2388 KB | Output is correct |
87 | Correct | 2 ms | 2132 KB | Output is correct |
88 | Correct | 2 ms | 2260 KB | Output is correct |
89 | Correct | 4 ms | 2516 KB | Output is correct |
90 | Correct | 3 ms | 2900 KB | Output is correct |
91 | Correct | 24 ms | 4788 KB | Output is correct |
92 | Correct | 24 ms | 5608 KB | Output is correct |
93 | Correct | 22 ms | 6252 KB | Output is correct |
94 | Correct | 2 ms | 980 KB | Output is correct |
95 | Correct | 2 ms | 980 KB | Output is correct |
96 | Correct | 2 ms | 980 KB | Output is correct |
97 | Correct | 2 ms | 980 KB | Output is correct |
98 | Correct | 2 ms | 980 KB | Output is correct |
99 | Correct | 6 ms | 3156 KB | Output is correct |
100 | Correct | 3 ms | 3156 KB | Output is correct |
101 | Correct | 4 ms | 3156 KB | Output is correct |
102 | Correct | 4 ms | 3156 KB | Output is correct |
103 | Correct | 3 ms | 3156 KB | Output is correct |
104 | Correct | 3 ms | 3156 KB | Output is correct |
105 | Correct | 28 ms | 6744 KB | Output is correct |
106 | Correct | 27 ms | 6660 KB | Output is correct |
107 | Correct | 27 ms | 6724 KB | Output is correct |
108 | Correct | 9 ms | 14036 KB | Output is correct |
109 | Correct | 297 ms | 45076 KB | Output is correct |
110 | Correct | 106 ms | 27488 KB | Output is correct |
111 | Correct | 83 ms | 21968 KB | Output is correct |
112 | Correct | 98 ms | 26704 KB | Output is correct |
113 | Correct | 63 ms | 18248 KB | Output is correct |
114 | Correct | 17 ms | 11312 KB | Output is correct |
115 | Correct | 17 ms | 10284 KB | Output is correct |
116 | Correct | 25 ms | 16340 KB | Output is correct |
117 | Correct | 17 ms | 10528 KB | Output is correct |
118 | Correct | 18 ms | 12236 KB | Output is correct |
119 | Correct | 15 ms | 13284 KB | Output is correct |
120 | Correct | 22 ms | 12136 KB | Output is correct |
121 | Correct | 8 ms | 9176 KB | Output is correct |
122 | Correct | 25 ms | 11988 KB | Output is correct |
123 | Correct | 8 ms | 8920 KB | Output is correct |
124 | Correct | 31 ms | 17764 KB | Output is correct |
125 | Correct | 12 ms | 14292 KB | Output is correct |
126 | Correct | 12 ms | 12884 KB | Output is correct |
127 | Correct | 18 ms | 15700 KB | Output is correct |
128 | Correct | 11 ms | 11860 KB | Output is correct |
129 | Correct | 11 ms | 11732 KB | Output is correct |
130 | Correct | 9 ms | 14144 KB | Output is correct |
131 | Correct | 414 ms | 63464 KB | Output is correct |
132 | Correct | 192 ms | 48652 KB | Output is correct |
133 | Correct | 149 ms | 42312 KB | Output is correct |
134 | Correct | 140 ms | 38372 KB | Output is correct |
135 | Correct | 121 ms | 35728 KB | Output is correct |
136 | Correct | 24 ms | 18004 KB | Output is correct |
137 | Correct | 23 ms | 17876 KB | Output is correct |
138 | Correct | 26 ms | 17876 KB | Output is correct |
139 | Correct | 25 ms | 17948 KB | Output is correct |
140 | Correct | 25 ms | 17956 KB | Output is correct |
141 | Correct | 23 ms | 17868 KB | Output is correct |
142 | Correct | 39 ms | 20048 KB | Output is correct |
143 | Correct | 13 ms | 15408 KB | Output is correct |
144 | Correct | 38 ms | 20044 KB | Output is correct |
145 | Correct | 15 ms | 15360 KB | Output is correct |
146 | Correct | 44 ms | 20124 KB | Output is correct |
147 | Correct | 14 ms | 15316 KB | Output is correct |
148 | Correct | 15 ms | 17380 KB | Output is correct |
149 | Correct | 19 ms | 17276 KB | Output is correct |
150 | Correct | 15 ms | 17236 KB | Output is correct |
151 | Correct | 16 ms | 17220 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 312 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 596 KB | Output is correct |
10 | Correct | 1 ms | 596 KB | Output is correct |
11 | Correct | 1 ms | 596 KB | Output is correct |
12 | Correct | 1 ms | 596 KB | Output is correct |
13 | Correct | 1 ms | 596 KB | Output is correct |
14 | Correct | 1 ms | 596 KB | Output is correct |
15 | Correct | 2 ms | 3028 KB | Output is correct |
16 | Correct | 2 ms | 3028 KB | Output is correct |
17 | Correct | 2 ms | 3028 KB | Output is correct |
18 | Correct | 2 ms | 3028 KB | Output is correct |
19 | Correct | 2 ms | 3028 KB | Output is correct |
20 | Correct | 2 ms | 3028 KB | Output is correct |
21 | Correct | 2 ms | 2772 KB | Output is correct |
22 | Correct | 2 ms | 2644 KB | Output is correct |
23 | Correct | 2 ms | 2644 KB | Output is correct |
24 | Correct | 18 ms | 6828 KB | Output is correct |
25 | Correct | 17 ms | 6868 KB | Output is correct |
26 | Correct | 19 ms | 6900 KB | Output is correct |
27 | Correct | 9 ms | 14164 KB | Output is correct |
28 | Correct | 9 ms | 14164 KB | Output is correct |
29 | Correct | 9 ms | 14056 KB | Output is correct |
30 | Correct | 10 ms | 14036 KB | Output is correct |
31 | Correct | 10 ms | 13984 KB | Output is correct |
32 | Correct | 10 ms | 14032 KB | Output is correct |
33 | Correct | 14 ms | 17492 KB | Output is correct |
34 | Correct | 14 ms | 17464 KB | Output is correct |
35 | Correct | 14 ms | 17440 KB | Output is correct |
36 | Correct | 16 ms | 17452 KB | Output is correct |
37 | Correct | 17 ms | 17484 KB | Output is correct |
38 | Correct | 17 ms | 17452 KB | Output is correct |
39 | Correct | 33 ms | 20352 KB | Output is correct |
40 | Correct | 54 ms | 20436 KB | Output is correct |
41 | Correct | 44 ms | 20316 KB | Output is correct |
42 | Correct | 51 ms | 63088 KB | Output is correct |
43 | Correct | 24 ms | 39612 KB | Output is correct |
44 | Correct | 45 ms | 68164 KB | Output is correct |
45 | Correct | 30 ms | 45192 KB | Output is correct |
46 | Correct | 27 ms | 40988 KB | Output is correct |
47 | Correct | 46 ms | 68684 KB | Output is correct |
48 | Correct | 65 ms | 70560 KB | Output is correct |
49 | Correct | 41 ms | 45316 KB | Output is correct |
50 | Correct | 44 ms | 47532 KB | Output is correct |
51 | Correct | 62 ms | 50988 KB | Output is correct |
52 | Correct | 69 ms | 57028 KB | Output is correct |
53 | Correct | 58 ms | 57036 KB | Output is correct |
54 | Correct | 43 ms | 69464 KB | Output is correct |
55 | Correct | 43 ms | 69528 KB | Output is correct |
56 | Correct | 45 ms | 69240 KB | Output is correct |
57 | Correct | 46 ms | 68924 KB | Output is correct |
58 | Correct | 46 ms | 68796 KB | Output is correct |
59 | Correct | 46 ms | 68812 KB | Output is correct |
60 | Correct | 73 ms | 80608 KB | Output is correct |
61 | Correct | 73 ms | 80620 KB | Output is correct |
62 | Correct | 75 ms | 80628 KB | Output is correct |
63 | Correct | 98 ms | 80584 KB | Output is correct |
64 | Correct | 72 ms | 80500 KB | Output is correct |
65 | Correct | 72 ms | 80536 KB | Output is correct |
66 | Correct | 88 ms | 79504 KB | Output is correct |
67 | Correct | 87 ms | 79344 KB | Output is correct |
68 | Correct | 88 ms | 79384 KB | Output is correct |
69 | Correct | 1 ms | 212 KB | Output is correct |
70 | Correct | 0 ms | 212 KB | Output is correct |
71 | Correct | 1 ms | 212 KB | Output is correct |
72 | Correct | 1 ms | 468 KB | Output is correct |
73 | Correct | 1 ms | 468 KB | Output is correct |
74 | Correct | 1 ms | 468 KB | Output is correct |
75 | Correct | 1 ms | 468 KB | Output is correct |
76 | Correct | 1 ms | 596 KB | Output is correct |
77 | Correct | 1 ms | 468 KB | Output is correct |
78 | Correct | 3 ms | 2516 KB | Output is correct |
79 | Correct | 2 ms | 2132 KB | Output is correct |
80 | Correct | 1 ms | 1748 KB | Output is correct |
81 | Correct | 2 ms | 2900 KB | Output is correct |
82 | Correct | 1 ms | 2388 KB | Output is correct |
83 | Correct | 3 ms | 2388 KB | Output is correct |
84 | Correct | 1 ms | 468 KB | Output is correct |
85 | Correct | 1 ms | 2132 KB | Output is correct |
86 | Correct | 1 ms | 468 KB | Output is correct |
87 | Correct | 2 ms | 2516 KB | Output is correct |
88 | Correct | 2 ms | 2644 KB | Output is correct |
89 | Correct | 1 ms | 596 KB | Output is correct |
90 | Correct | 1 ms | 596 KB | Output is correct |
91 | Correct | 1 ms | 596 KB | Output is correct |
92 | Correct | 1 ms | 596 KB | Output is correct |
93 | Correct | 1 ms | 596 KB | Output is correct |
94 | Correct | 1 ms | 596 KB | Output is correct |
95 | Correct | 2 ms | 3028 KB | Output is correct |
96 | Correct | 2 ms | 3028 KB | Output is correct |
97 | Correct | 2 ms | 3028 KB | Output is correct |
98 | Correct | 2 ms | 3028 KB | Output is correct |
99 | Correct | 2 ms | 3028 KB | Output is correct |
100 | Correct | 2 ms | 3028 KB | Output is correct |
101 | Correct | 2 ms | 2644 KB | Output is correct |
102 | Correct | 1 ms | 596 KB | Output is correct |
103 | Correct | 2 ms | 2644 KB | Output is correct |
104 | Correct | 1 ms | 596 KB | Output is correct |
105 | Correct | 2 ms | 2644 KB | Output is correct |
106 | Correct | 1 ms | 596 KB | Output is correct |
107 | Correct | 1 ms | 596 KB | Output is correct |
108 | Correct | 1 ms | 596 KB | Output is correct |
109 | Correct | 1 ms | 852 KB | Output is correct |
110 | Correct | 1 ms | 724 KB | Output is correct |
111 | Correct | 1 ms | 724 KB | Output is correct |
112 | Correct | 3 ms | 2772 KB | Output is correct |
113 | Correct | 3 ms | 2388 KB | Output is correct |
114 | Correct | 2 ms | 2132 KB | Output is correct |
115 | Correct | 2 ms | 2260 KB | Output is correct |
116 | Correct | 4 ms | 2516 KB | Output is correct |
117 | Correct | 3 ms | 2900 KB | Output is correct |
118 | Correct | 24 ms | 4788 KB | Output is correct |
119 | Correct | 24 ms | 5608 KB | Output is correct |
120 | Correct | 22 ms | 6252 KB | Output is correct |
121 | Correct | 2 ms | 980 KB | Output is correct |
122 | Correct | 2 ms | 980 KB | Output is correct |
123 | Correct | 2 ms | 980 KB | Output is correct |
124 | Correct | 2 ms | 980 KB | Output is correct |
125 | Correct | 2 ms | 980 KB | Output is correct |
126 | Correct | 6 ms | 3156 KB | Output is correct |
127 | Correct | 3 ms | 3156 KB | Output is correct |
128 | Correct | 4 ms | 3156 KB | Output is correct |
129 | Correct | 4 ms | 3156 KB | Output is correct |
130 | Correct | 3 ms | 3156 KB | Output is correct |
131 | Correct | 3 ms | 3156 KB | Output is correct |
132 | Correct | 28 ms | 6744 KB | Output is correct |
133 | Correct | 27 ms | 6660 KB | Output is correct |
134 | Correct | 27 ms | 6724 KB | Output is correct |
135 | Correct | 9 ms | 14036 KB | Output is correct |
136 | Correct | 297 ms | 45076 KB | Output is correct |
137 | Correct | 106 ms | 27488 KB | Output is correct |
138 | Correct | 83 ms | 21968 KB | Output is correct |
139 | Correct | 98 ms | 26704 KB | Output is correct |
140 | Correct | 63 ms | 18248 KB | Output is correct |
141 | Correct | 17 ms | 11312 KB | Output is correct |
142 | Correct | 17 ms | 10284 KB | Output is correct |
143 | Correct | 25 ms | 16340 KB | Output is correct |
144 | Correct | 17 ms | 10528 KB | Output is correct |
145 | Correct | 18 ms | 12236 KB | Output is correct |
146 | Correct | 15 ms | 13284 KB | Output is correct |
147 | Correct | 22 ms | 12136 KB | Output is correct |
148 | Correct | 8 ms | 9176 KB | Output is correct |
149 | Correct | 25 ms | 11988 KB | Output is correct |
150 | Correct | 8 ms | 8920 KB | Output is correct |
151 | Correct | 31 ms | 17764 KB | Output is correct |
152 | Correct | 12 ms | 14292 KB | Output is correct |
153 | Correct | 12 ms | 12884 KB | Output is correct |
154 | Correct | 18 ms | 15700 KB | Output is correct |
155 | Correct | 11 ms | 11860 KB | Output is correct |
156 | Correct | 11 ms | 11732 KB | Output is correct |
157 | Correct | 9 ms | 14144 KB | Output is correct |
158 | Correct | 414 ms | 63464 KB | Output is correct |
159 | Correct | 192 ms | 48652 KB | Output is correct |
160 | Correct | 149 ms | 42312 KB | Output is correct |
161 | Correct | 140 ms | 38372 KB | Output is correct |
162 | Correct | 121 ms | 35728 KB | Output is correct |
163 | Correct | 24 ms | 18004 KB | Output is correct |
164 | Correct | 23 ms | 17876 KB | Output is correct |
165 | Correct | 26 ms | 17876 KB | Output is correct |
166 | Correct | 25 ms | 17948 KB | Output is correct |
167 | Correct | 25 ms | 17956 KB | Output is correct |
168 | Correct | 23 ms | 17868 KB | Output is correct |
169 | Correct | 39 ms | 20048 KB | Output is correct |
170 | Correct | 13 ms | 15408 KB | Output is correct |
171 | Correct | 38 ms | 20044 KB | Output is correct |
172 | Correct | 15 ms | 15360 KB | Output is correct |
173 | Correct | 44 ms | 20124 KB | Output is correct |
174 | Correct | 14 ms | 15316 KB | Output is correct |
175 | Correct | 15 ms | 17380 KB | Output is correct |
176 | Correct | 19 ms | 17276 KB | Output is correct |
177 | Correct | 15 ms | 17236 KB | Output is correct |
178 | Correct | 16 ms | 17220 KB | Output is correct |
179 | Correct | 27 ms | 43160 KB | Output is correct |
180 | Correct | 782 ms | 134160 KB | Output is correct |
181 | Correct | 551 ms | 160916 KB | Output is correct |
182 | Correct | 701 ms | 204320 KB | Output is correct |
183 | Correct | 317 ms | 112716 KB | Output is correct |
184 | Correct | 258 ms | 98620 KB | Output is correct |
185 | Correct | 44 ms | 40272 KB | Output is correct |
186 | Correct | 46 ms | 50456 KB | Output is correct |
187 | Correct | 60 ms | 47772 KB | Output is correct |
188 | Correct | 69 ms | 64248 KB | Output is correct |
189 | Correct | 59 ms | 65868 KB | Output is correct |
190 | Correct | 67 ms | 58412 KB | Output is correct |
191 | Correct | 62 ms | 59356 KB | Output is correct |
192 | Correct | 52 ms | 49036 KB | Output is correct |
193 | Correct | 41 ms | 49464 KB | Output is correct |
194 | Correct | 42 ms | 69484 KB | Output is correct |
195 | Execution timed out | 1597 ms | 314728 KB | Time limit exceeded |
196 | Halted | 0 ms | 0 KB | - |