# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
294916 | 2020-09-09T10:41:57 Z | Berted | Painting Walls (APIO20_paint) | C++14 | 766 ms | 268036 KB |
#include "paint.h" #include <vector> #include <algorithm> #include <iostream> #define vi vector<int> using namespace std; const int INF = 1e9; vi clr[100001]; vi pos[100001]; int dp[100001][633]; bool f[100001]; int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) { for (int i = 0; i < N; i++) {clr[C[i]].push_back(i);} for (int i = 0; i < M; i++) { for (int j = 0; j < A[i]; j++) { pos[B[i][j]].push_back(i); } } for (int i = 0; i < K; i++) { sort(pos[i].begin(), pos[i].end()); pos[i].resize(unique(pos[i].begin(), pos[i].end()) - pos[i].begin()); for (int j = 0; j < clr[i].size(); j++) { for (int k = 0; k < pos[i].size(); k++) {dp[clr[i][j]][k] = 1;} } } if (M == 1) {f[0] = 1;} for (int i = 1; i < N; i++) { int k = 0; int pi = C[i - 1], ci = C[i]; for (int j = 0; j < pos[ci].size(); j++) { if (j && pos[ci][j - 1] == 0) {k = 0;} for (; k < pos[pi].size() && pos[pi][k] < (pos[ci][j] + M - 1) % M; k++); if (k < pos[pi].size() && pos[pi][k] == (pos[ci][j] + M - 1) % M) { dp[i][j] = max(dp[i][j], dp[i - 1][k] + 1); } if (dp[i][j] >= M) {f[i] = 1;} } } vector<int> allow; for (int i = 0; i < N; i++) { if (f[i]) { // cout << i << " is allowed\n"; allow.push_back(i); } } int ret = INF; if (f[M - 1]) { int cur = M - 1, cnt = 1; while (cur < N - 1) { auto it = upper_bound(allow.begin(), allow.end(), min(N - 1, cur + M)); it = prev(it); if (*it != cur) {cnt++; cur = *it;} else {break;} } if (cur == N - 1) {ret = min(ret, cnt);} } if (ret == INF) return -1; else return ret; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 4992 KB | Output is correct |
2 | Correct | 3 ms | 4992 KB | Output is correct |
3 | Correct | 4 ms | 4992 KB | Output is correct |
4 | Correct | 3 ms | 4992 KB | Output is correct |
5 | Correct | 4 ms | 4992 KB | Output is correct |
6 | Correct | 3 ms | 4992 KB | Output is correct |
7 | Correct | 4 ms | 6272 KB | Output is correct |
8 | Correct | 4 ms | 6272 KB | Output is correct |
9 | Correct | 5 ms | 6272 KB | Output is correct |
10 | Correct | 4 ms | 6272 KB | Output is correct |
11 | Correct | 5 ms | 6272 KB | Output is correct |
12 | Correct | 4 ms | 6272 KB | Output is correct |
13 | Correct | 5 ms | 6272 KB | Output is correct |
14 | Correct | 5 ms | 6272 KB | Output is correct |
15 | Correct | 5 ms | 6272 KB | Output is correct |
16 | Correct | 5 ms | 6272 KB | Output is correct |
17 | Correct | 5 ms | 6272 KB | Output is correct |
18 | Correct | 5 ms | 6272 KB | Output is correct |
19 | Correct | 4 ms | 5120 KB | Output is correct |
20 | Correct | 5 ms | 5120 KB | Output is correct |
21 | Correct | 4 ms | 5120 KB | Output is correct |
22 | Correct | 33 ms | 10752 KB | Output is correct |
23 | Correct | 42 ms | 10744 KB | Output is correct |
24 | Correct | 32 ms | 10744 KB | Output is correct |
25 | Correct | 32 ms | 55040 KB | Output is correct |
26 | Correct | 33 ms | 55032 KB | Output is correct |
27 | Correct | 32 ms | 55032 KB | Output is correct |
28 | Correct | 32 ms | 54904 KB | Output is correct |
29 | Correct | 32 ms | 54912 KB | Output is correct |
30 | Correct | 32 ms | 54904 KB | Output is correct |
31 | Correct | 47 ms | 56696 KB | Output is correct |
32 | Correct | 47 ms | 56828 KB | Output is correct |
33 | Correct | 46 ms | 56696 KB | Output is correct |
34 | Correct | 47 ms | 56696 KB | Output is correct |
35 | Correct | 46 ms | 56704 KB | Output is correct |
36 | Correct | 46 ms | 56696 KB | Output is correct |
37 | Correct | 68 ms | 60024 KB | Output is correct |
38 | Correct | 69 ms | 60024 KB | Output is correct |
39 | Correct | 69 ms | 60024 KB | Output is correct |
40 | Correct | 131 ms | 231920 KB | Output is correct |
41 | Correct | 89 ms | 146932 KB | Output is correct |
42 | Correct | 139 ms | 250740 KB | Output is correct |
43 | Correct | 95 ms | 168184 KB | Output is correct |
44 | Correct | 86 ms | 153212 KB | Output is correct |
45 | Correct | 137 ms | 254100 KB | Output is correct |
46 | Correct | 195 ms | 232056 KB | Output is correct |
47 | Correct | 126 ms | 150264 KB | Output is correct |
48 | Correct | 135 ms | 152952 KB | Output is correct |
49 | Correct | 150 ms | 165112 KB | Output is correct |
50 | Correct | 166 ms | 188152 KB | Output is correct |
51 | Correct | 160 ms | 195064 KB | Output is correct |
52 | Correct | 143 ms | 254960 KB | Output is correct |
53 | Correct | 143 ms | 254960 KB | Output is correct |
54 | Correct | 138 ms | 254624 KB | Output is correct |
55 | Correct | 137 ms | 254580 KB | Output is correct |
56 | Correct | 142 ms | 254332 KB | Output is correct |
57 | Correct | 138 ms | 254456 KB | Output is correct |
58 | Correct | 219 ms | 267384 KB | Output is correct |
59 | Correct | 219 ms | 267640 KB | Output is correct |
60 | Correct | 221 ms | 267384 KB | Output is correct |
61 | Correct | 214 ms | 267384 KB | Output is correct |
62 | Correct | 219 ms | 267384 KB | Output is correct |
63 | Correct | 216 ms | 267400 KB | Output is correct |
64 | Correct | 225 ms | 265080 KB | Output is correct |
65 | Correct | 234 ms | 264988 KB | Output is correct |
66 | Correct | 222 ms | 264984 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 4992 KB | Output is correct |
2 | Correct | 4 ms | 4992 KB | Output is correct |
3 | Correct | 4 ms | 4992 KB | Output is correct |
4 | Correct | 3 ms | 4992 KB | Output is correct |
5 | Correct | 4 ms | 4992 KB | Output is correct |
6 | Correct | 3 ms | 4992 KB | Output is correct |
7 | Correct | 4 ms | 4992 KB | Output is correct |
8 | Correct | 3 ms | 4992 KB | Output is correct |
9 | Correct | 4 ms | 6272 KB | Output is correct |
10 | Correct | 4 ms | 6272 KB | Output is correct |
11 | Correct | 5 ms | 6272 KB | Output is correct |
12 | Correct | 4 ms | 6272 KB | Output is correct |
13 | Correct | 5 ms | 6272 KB | Output is correct |
14 | Correct | 4 ms | 6272 KB | Output is correct |
15 | Correct | 5 ms | 6272 KB | Output is correct |
16 | Correct | 5 ms | 6272 KB | Output is correct |
17 | Correct | 5 ms | 6272 KB | Output is correct |
18 | Correct | 5 ms | 6272 KB | Output is correct |
19 | Correct | 5 ms | 6272 KB | Output is correct |
20 | Correct | 5 ms | 6272 KB | Output is correct |
21 | Correct | 4 ms | 5120 KB | Output is correct |
22 | Correct | 5 ms | 5120 KB | Output is correct |
23 | Correct | 4 ms | 5120 KB | Output is correct |
24 | Correct | 4 ms | 4992 KB | Output is correct |
25 | Correct | 4 ms | 4992 KB | Output is correct |
26 | Correct | 3 ms | 4992 KB | Output is correct |
27 | Correct | 4 ms | 5760 KB | Output is correct |
28 | Correct | 4 ms | 5888 KB | Output is correct |
29 | Correct | 5 ms | 5632 KB | Output is correct |
30 | Correct | 4 ms | 5888 KB | Output is correct |
31 | Correct | 4 ms | 6144 KB | Output is correct |
32 | Correct | 4 ms | 5888 KB | Output is correct |
33 | Correct | 5 ms | 6016 KB | Output is correct |
34 | Correct | 5 ms | 6144 KB | Output is correct |
35 | Correct | 5 ms | 5760 KB | Output is correct |
36 | Correct | 5 ms | 6016 KB | Output is correct |
37 | Correct | 5 ms | 5888 KB | Output is correct |
38 | Correct | 4 ms | 5120 KB | Output is correct |
39 | Correct | 4 ms | 5760 KB | Output is correct |
40 | Correct | 4 ms | 5120 KB | Output is correct |
41 | Correct | 4 ms | 5888 KB | Output is correct |
42 | Correct | 4 ms | 5120 KB | Output is correct |
43 | Correct | 5 ms | 5888 KB | Output is correct |
44 | Correct | 4 ms | 6272 KB | Output is correct |
45 | Correct | 4 ms | 6272 KB | Output is correct |
46 | Correct | 5 ms | 6272 KB | Output is correct |
47 | Correct | 4 ms | 6272 KB | Output is correct |
48 | Correct | 5 ms | 6272 KB | Output is correct |
49 | Correct | 4 ms | 6272 KB | Output is correct |
50 | Correct | 5 ms | 6272 KB | Output is correct |
51 | Correct | 5 ms | 6272 KB | Output is correct |
52 | Correct | 5 ms | 6272 KB | Output is correct |
53 | Correct | 5 ms | 6272 KB | Output is correct |
54 | Correct | 5 ms | 6272 KB | Output is correct |
55 | Correct | 5 ms | 6272 KB | Output is correct |
56 | Correct | 4 ms | 5120 KB | Output is correct |
57 | Correct | 5 ms | 6272 KB | Output is correct |
58 | Correct | 4 ms | 5120 KB | Output is correct |
59 | Correct | 5 ms | 6272 KB | Output is correct |
60 | Correct | 5 ms | 5120 KB | Output is correct |
61 | Correct | 4 ms | 6272 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 4992 KB | Output is correct |
2 | Correct | 4 ms | 4992 KB | Output is correct |
3 | Correct | 4 ms | 4992 KB | Output is correct |
4 | Correct | 3 ms | 4992 KB | Output is correct |
5 | Correct | 4 ms | 4992 KB | Output is correct |
6 | Correct | 3 ms | 4992 KB | Output is correct |
7 | Correct | 4 ms | 4992 KB | Output is correct |
8 | Correct | 3 ms | 4992 KB | Output is correct |
9 | Correct | 4 ms | 6272 KB | Output is correct |
10 | Correct | 4 ms | 6272 KB | Output is correct |
11 | Correct | 5 ms | 6272 KB | Output is correct |
12 | Correct | 4 ms | 6272 KB | Output is correct |
13 | Correct | 5 ms | 6272 KB | Output is correct |
14 | Correct | 4 ms | 6272 KB | Output is correct |
15 | Correct | 5 ms | 6272 KB | Output is correct |
16 | Correct | 5 ms | 6272 KB | Output is correct |
17 | Correct | 5 ms | 6272 KB | Output is correct |
18 | Correct | 5 ms | 6272 KB | Output is correct |
19 | Correct | 5 ms | 6272 KB | Output is correct |
20 | Correct | 5 ms | 6272 KB | Output is correct |
21 | Correct | 4 ms | 5120 KB | Output is correct |
22 | Correct | 5 ms | 5120 KB | Output is correct |
23 | Correct | 4 ms | 5120 KB | Output is correct |
24 | Correct | 33 ms | 10752 KB | Output is correct |
25 | Correct | 42 ms | 10744 KB | Output is correct |
26 | Correct | 32 ms | 10744 KB | Output is correct |
27 | Correct | 4 ms | 4992 KB | Output is correct |
28 | Correct | 4 ms | 4992 KB | Output is correct |
29 | Correct | 3 ms | 4992 KB | Output is correct |
30 | Correct | 4 ms | 5760 KB | Output is correct |
31 | Correct | 4 ms | 5888 KB | Output is correct |
32 | Correct | 5 ms | 5632 KB | Output is correct |
33 | Correct | 4 ms | 5888 KB | Output is correct |
34 | Correct | 4 ms | 6144 KB | Output is correct |
35 | Correct | 4 ms | 5888 KB | Output is correct |
36 | Correct | 5 ms | 6016 KB | Output is correct |
37 | Correct | 5 ms | 6144 KB | Output is correct |
38 | Correct | 5 ms | 5760 KB | Output is correct |
39 | Correct | 5 ms | 6016 KB | Output is correct |
40 | Correct | 5 ms | 5888 KB | Output is correct |
41 | Correct | 4 ms | 5120 KB | Output is correct |
42 | Correct | 4 ms | 5760 KB | Output is correct |
43 | Correct | 4 ms | 5120 KB | Output is correct |
44 | Correct | 4 ms | 5888 KB | Output is correct |
45 | Correct | 4 ms | 5120 KB | Output is correct |
46 | Correct | 5 ms | 5888 KB | Output is correct |
47 | Correct | 4 ms | 6272 KB | Output is correct |
48 | Correct | 4 ms | 6272 KB | Output is correct |
49 | Correct | 5 ms | 6272 KB | Output is correct |
50 | Correct | 4 ms | 6272 KB | Output is correct |
51 | Correct | 5 ms | 6272 KB | Output is correct |
52 | Correct | 4 ms | 6272 KB | Output is correct |
53 | Correct | 5 ms | 6272 KB | Output is correct |
54 | Correct | 5 ms | 6272 KB | Output is correct |
55 | Correct | 5 ms | 6272 KB | Output is correct |
56 | Correct | 5 ms | 6272 KB | Output is correct |
57 | Correct | 5 ms | 6272 KB | Output is correct |
58 | Correct | 5 ms | 6272 KB | Output is correct |
59 | Correct | 4 ms | 5120 KB | Output is correct |
60 | Correct | 5 ms | 6272 KB | Output is correct |
61 | Correct | 4 ms | 5120 KB | Output is correct |
62 | Correct | 5 ms | 6272 KB | Output is correct |
63 | Correct | 5 ms | 5120 KB | Output is correct |
64 | Correct | 4 ms | 6272 KB | Output is correct |
65 | Correct | 5 ms | 5632 KB | Output is correct |
66 | Correct | 5 ms | 6272 KB | Output is correct |
67 | Correct | 5 ms | 6272 KB | Output is correct |
68 | Correct | 5 ms | 6272 KB | Output is correct |
69 | Correct | 5 ms | 6144 KB | Output is correct |
70 | Correct | 7 ms | 6272 KB | Output is correct |
71 | Correct | 7 ms | 6272 KB | Output is correct |
72 | Correct | 7 ms | 6272 KB | Output is correct |
73 | Correct | 6 ms | 6144 KB | Output is correct |
74 | Correct | 7 ms | 6144 KB | Output is correct |
75 | Correct | 7 ms | 6144 KB | Output is correct |
76 | Correct | 34 ms | 8952 KB | Output is correct |
77 | Correct | 32 ms | 9592 KB | Output is correct |
78 | Correct | 42 ms | 10112 KB | Output is correct |
79 | Correct | 5 ms | 6272 KB | Output is correct |
80 | Correct | 6 ms | 6272 KB | Output is correct |
81 | Correct | 6 ms | 6272 KB | Output is correct |
82 | Correct | 5 ms | 6272 KB | Output is correct |
83 | Correct | 6 ms | 6272 KB | Output is correct |
84 | Correct | 8 ms | 6656 KB | Output is correct |
85 | Correct | 8 ms | 6656 KB | Output is correct |
86 | Correct | 8 ms | 6656 KB | Output is correct |
87 | Correct | 8 ms | 6656 KB | Output is correct |
88 | Correct | 8 ms | 6656 KB | Output is correct |
89 | Correct | 9 ms | 6656 KB | Output is correct |
90 | Correct | 50 ms | 10872 KB | Output is correct |
91 | Correct | 50 ms | 10752 KB | Output is correct |
92 | Correct | 49 ms | 10872 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 4992 KB | Output is correct |
2 | Correct | 4 ms | 4992 KB | Output is correct |
3 | Correct | 4 ms | 4992 KB | Output is correct |
4 | Correct | 3 ms | 4992 KB | Output is correct |
5 | Correct | 4 ms | 4992 KB | Output is correct |
6 | Correct | 3 ms | 4992 KB | Output is correct |
7 | Correct | 4 ms | 4992 KB | Output is correct |
8 | Correct | 3 ms | 4992 KB | Output is correct |
9 | Correct | 4 ms | 6272 KB | Output is correct |
10 | Correct | 4 ms | 6272 KB | Output is correct |
11 | Correct | 5 ms | 6272 KB | Output is correct |
12 | Correct | 4 ms | 6272 KB | Output is correct |
13 | Correct | 5 ms | 6272 KB | Output is correct |
14 | Correct | 4 ms | 6272 KB | Output is correct |
15 | Correct | 5 ms | 6272 KB | Output is correct |
16 | Correct | 5 ms | 6272 KB | Output is correct |
17 | Correct | 5 ms | 6272 KB | Output is correct |
18 | Correct | 5 ms | 6272 KB | Output is correct |
19 | Correct | 5 ms | 6272 KB | Output is correct |
20 | Correct | 5 ms | 6272 KB | Output is correct |
21 | Correct | 4 ms | 5120 KB | Output is correct |
22 | Correct | 5 ms | 5120 KB | Output is correct |
23 | Correct | 4 ms | 5120 KB | Output is correct |
24 | Correct | 33 ms | 10752 KB | Output is correct |
25 | Correct | 42 ms | 10744 KB | Output is correct |
26 | Correct | 32 ms | 10744 KB | Output is correct |
27 | Correct | 32 ms | 55040 KB | Output is correct |
28 | Correct | 33 ms | 55032 KB | Output is correct |
29 | Correct | 32 ms | 55032 KB | Output is correct |
30 | Correct | 32 ms | 54904 KB | Output is correct |
31 | Correct | 32 ms | 54912 KB | Output is correct |
32 | Correct | 32 ms | 54904 KB | Output is correct |
33 | Correct | 47 ms | 56696 KB | Output is correct |
34 | Correct | 47 ms | 56828 KB | Output is correct |
35 | Correct | 46 ms | 56696 KB | Output is correct |
36 | Correct | 47 ms | 56696 KB | Output is correct |
37 | Correct | 46 ms | 56704 KB | Output is correct |
38 | Correct | 46 ms | 56696 KB | Output is correct |
39 | Correct | 68 ms | 60024 KB | Output is correct |
40 | Correct | 69 ms | 60024 KB | Output is correct |
41 | Correct | 69 ms | 60024 KB | Output is correct |
42 | Correct | 4 ms | 4992 KB | Output is correct |
43 | Correct | 4 ms | 4992 KB | Output is correct |
44 | Correct | 3 ms | 4992 KB | Output is correct |
45 | Correct | 4 ms | 5760 KB | Output is correct |
46 | Correct | 4 ms | 5888 KB | Output is correct |
47 | Correct | 5 ms | 5632 KB | Output is correct |
48 | Correct | 4 ms | 5888 KB | Output is correct |
49 | Correct | 4 ms | 6144 KB | Output is correct |
50 | Correct | 4 ms | 5888 KB | Output is correct |
51 | Correct | 5 ms | 6016 KB | Output is correct |
52 | Correct | 5 ms | 6144 KB | Output is correct |
53 | Correct | 5 ms | 5760 KB | Output is correct |
54 | Correct | 5 ms | 6016 KB | Output is correct |
55 | Correct | 5 ms | 5888 KB | Output is correct |
56 | Correct | 4 ms | 5120 KB | Output is correct |
57 | Correct | 4 ms | 5760 KB | Output is correct |
58 | Correct | 4 ms | 5120 KB | Output is correct |
59 | Correct | 4 ms | 5888 KB | Output is correct |
60 | Correct | 4 ms | 5120 KB | Output is correct |
61 | Correct | 5 ms | 5888 KB | Output is correct |
62 | Correct | 4 ms | 6272 KB | Output is correct |
63 | Correct | 4 ms | 6272 KB | Output is correct |
64 | Correct | 5 ms | 6272 KB | Output is correct |
65 | Correct | 4 ms | 6272 KB | Output is correct |
66 | Correct | 5 ms | 6272 KB | Output is correct |
67 | Correct | 4 ms | 6272 KB | Output is correct |
68 | Correct | 5 ms | 6272 KB | Output is correct |
69 | Correct | 5 ms | 6272 KB | Output is correct |
70 | Correct | 5 ms | 6272 KB | Output is correct |
71 | Correct | 5 ms | 6272 KB | Output is correct |
72 | Correct | 5 ms | 6272 KB | Output is correct |
73 | Correct | 5 ms | 6272 KB | Output is correct |
74 | Correct | 4 ms | 5120 KB | Output is correct |
75 | Correct | 5 ms | 6272 KB | Output is correct |
76 | Correct | 4 ms | 5120 KB | Output is correct |
77 | Correct | 5 ms | 6272 KB | Output is correct |
78 | Correct | 5 ms | 5120 KB | Output is correct |
79 | Correct | 4 ms | 6272 KB | Output is correct |
80 | Correct | 5 ms | 5632 KB | Output is correct |
81 | Correct | 5 ms | 6272 KB | Output is correct |
82 | Correct | 5 ms | 6272 KB | Output is correct |
83 | Correct | 5 ms | 6272 KB | Output is correct |
84 | Correct | 5 ms | 6144 KB | Output is correct |
85 | Correct | 7 ms | 6272 KB | Output is correct |
86 | Correct | 7 ms | 6272 KB | Output is correct |
87 | Correct | 7 ms | 6272 KB | Output is correct |
88 | Correct | 6 ms | 6144 KB | Output is correct |
89 | Correct | 7 ms | 6144 KB | Output is correct |
90 | Correct | 7 ms | 6144 KB | Output is correct |
91 | Correct | 34 ms | 8952 KB | Output is correct |
92 | Correct | 32 ms | 9592 KB | Output is correct |
93 | Correct | 42 ms | 10112 KB | Output is correct |
94 | Correct | 5 ms | 6272 KB | Output is correct |
95 | Correct | 6 ms | 6272 KB | Output is correct |
96 | Correct | 6 ms | 6272 KB | Output is correct |
97 | Correct | 5 ms | 6272 KB | Output is correct |
98 | Correct | 6 ms | 6272 KB | Output is correct |
99 | Correct | 8 ms | 6656 KB | Output is correct |
100 | Correct | 8 ms | 6656 KB | Output is correct |
101 | Correct | 8 ms | 6656 KB | Output is correct |
102 | Correct | 8 ms | 6656 KB | Output is correct |
103 | Correct | 8 ms | 6656 KB | Output is correct |
104 | Correct | 9 ms | 6656 KB | Output is correct |
105 | Correct | 50 ms | 10872 KB | Output is correct |
106 | Correct | 50 ms | 10752 KB | Output is correct |
107 | Correct | 49 ms | 10872 KB | Output is correct |
108 | Correct | 33 ms | 54780 KB | Output is correct |
109 | Correct | 116 ms | 41336 KB | Output is correct |
110 | Correct | 85 ms | 35832 KB | Output is correct |
111 | Correct | 72 ms | 33784 KB | Output is correct |
112 | Correct | 93 ms | 43384 KB | Output is correct |
113 | Correct | 72 ms | 32104 KB | Output is correct |
114 | Correct | 41 ms | 34552 KB | Output is correct |
115 | Correct | 38 ms | 31864 KB | Output is correct |
116 | Correct | 60 ms | 52728 KB | Output is correct |
117 | Correct | 40 ms | 33912 KB | Output is correct |
118 | Correct | 45 ms | 38520 KB | Output is correct |
119 | Correct | 43 ms | 42364 KB | Output is correct |
120 | Correct | 52 ms | 33784 KB | Output is correct |
121 | Correct | 27 ms | 35328 KB | Output is correct |
122 | Correct | 59 ms | 35448 KB | Output is correct |
123 | Correct | 28 ms | 34296 KB | Output is correct |
124 | Correct | 76 ms | 50936 KB | Output is correct |
125 | Correct | 41 ms | 52728 KB | Output is correct |
126 | Correct | 41 ms | 44928 KB | Output is correct |
127 | Correct | 49 ms | 52728 KB | Output is correct |
128 | Correct | 36 ms | 39800 KB | Output is correct |
129 | Correct | 37 ms | 41184 KB | Output is correct |
130 | Correct | 36 ms | 55072 KB | Output is correct |
131 | Correct | 161 ms | 55176 KB | Output is correct |
132 | Correct | 140 ms | 55160 KB | Output is correct |
133 | Correct | 145 ms | 55032 KB | Output is correct |
134 | Correct | 131 ms | 55036 KB | Output is correct |
135 | Correct | 128 ms | 55056 KB | Output is correct |
136 | Correct | 67 ms | 57596 KB | Output is correct |
137 | Correct | 65 ms | 57596 KB | Output is correct |
138 | Correct | 64 ms | 57592 KB | Output is correct |
139 | Correct | 65 ms | 57592 KB | Output is correct |
140 | Correct | 73 ms | 57548 KB | Output is correct |
141 | Correct | 64 ms | 57592 KB | Output is correct |
142 | Correct | 89 ms | 55036 KB | Output is correct |
143 | Correct | 44 ms | 56240 KB | Output is correct |
144 | Correct | 89 ms | 54648 KB | Output is correct |
145 | Correct | 45 ms | 56240 KB | Output is correct |
146 | Correct | 86 ms | 55032 KB | Output is correct |
147 | Correct | 44 ms | 56184 KB | Output is correct |
148 | Correct | 50 ms | 56696 KB | Output is correct |
149 | Correct | 49 ms | 56624 KB | Output is correct |
150 | Correct | 48 ms | 56600 KB | Output is correct |
151 | Correct | 48 ms | 56568 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 4992 KB | Output is correct |
2 | Correct | 4 ms | 4992 KB | Output is correct |
3 | Correct | 4 ms | 4992 KB | Output is correct |
4 | Correct | 3 ms | 4992 KB | Output is correct |
5 | Correct | 4 ms | 4992 KB | Output is correct |
6 | Correct | 3 ms | 4992 KB | Output is correct |
7 | Correct | 4 ms | 4992 KB | Output is correct |
8 | Correct | 3 ms | 4992 KB | Output is correct |
9 | Correct | 4 ms | 6272 KB | Output is correct |
10 | Correct | 4 ms | 6272 KB | Output is correct |
11 | Correct | 5 ms | 6272 KB | Output is correct |
12 | Correct | 4 ms | 6272 KB | Output is correct |
13 | Correct | 5 ms | 6272 KB | Output is correct |
14 | Correct | 4 ms | 6272 KB | Output is correct |
15 | Correct | 5 ms | 6272 KB | Output is correct |
16 | Correct | 5 ms | 6272 KB | Output is correct |
17 | Correct | 5 ms | 6272 KB | Output is correct |
18 | Correct | 5 ms | 6272 KB | Output is correct |
19 | Correct | 5 ms | 6272 KB | Output is correct |
20 | Correct | 5 ms | 6272 KB | Output is correct |
21 | Correct | 4 ms | 5120 KB | Output is correct |
22 | Correct | 5 ms | 5120 KB | Output is correct |
23 | Correct | 4 ms | 5120 KB | Output is correct |
24 | Correct | 33 ms | 10752 KB | Output is correct |
25 | Correct | 42 ms | 10744 KB | Output is correct |
26 | Correct | 32 ms | 10744 KB | Output is correct |
27 | Correct | 32 ms | 55040 KB | Output is correct |
28 | Correct | 33 ms | 55032 KB | Output is correct |
29 | Correct | 32 ms | 55032 KB | Output is correct |
30 | Correct | 32 ms | 54904 KB | Output is correct |
31 | Correct | 32 ms | 54912 KB | Output is correct |
32 | Correct | 32 ms | 54904 KB | Output is correct |
33 | Correct | 47 ms | 56696 KB | Output is correct |
34 | Correct | 47 ms | 56828 KB | Output is correct |
35 | Correct | 46 ms | 56696 KB | Output is correct |
36 | Correct | 47 ms | 56696 KB | Output is correct |
37 | Correct | 46 ms | 56704 KB | Output is correct |
38 | Correct | 46 ms | 56696 KB | Output is correct |
39 | Correct | 68 ms | 60024 KB | Output is correct |
40 | Correct | 69 ms | 60024 KB | Output is correct |
41 | Correct | 69 ms | 60024 KB | Output is correct |
42 | Correct | 131 ms | 231920 KB | Output is correct |
43 | Correct | 89 ms | 146932 KB | Output is correct |
44 | Correct | 139 ms | 250740 KB | Output is correct |
45 | Correct | 95 ms | 168184 KB | Output is correct |
46 | Correct | 86 ms | 153212 KB | Output is correct |
47 | Correct | 137 ms | 254100 KB | Output is correct |
48 | Correct | 195 ms | 232056 KB | Output is correct |
49 | Correct | 126 ms | 150264 KB | Output is correct |
50 | Correct | 135 ms | 152952 KB | Output is correct |
51 | Correct | 150 ms | 165112 KB | Output is correct |
52 | Correct | 166 ms | 188152 KB | Output is correct |
53 | Correct | 160 ms | 195064 KB | Output is correct |
54 | Correct | 143 ms | 254960 KB | Output is correct |
55 | Correct | 143 ms | 254960 KB | Output is correct |
56 | Correct | 138 ms | 254624 KB | Output is correct |
57 | Correct | 137 ms | 254580 KB | Output is correct |
58 | Correct | 142 ms | 254332 KB | Output is correct |
59 | Correct | 138 ms | 254456 KB | Output is correct |
60 | Correct | 219 ms | 267384 KB | Output is correct |
61 | Correct | 219 ms | 267640 KB | Output is correct |
62 | Correct | 221 ms | 267384 KB | Output is correct |
63 | Correct | 214 ms | 267384 KB | Output is correct |
64 | Correct | 219 ms | 267384 KB | Output is correct |
65 | Correct | 216 ms | 267400 KB | Output is correct |
66 | Correct | 225 ms | 265080 KB | Output is correct |
67 | Correct | 234 ms | 264988 KB | Output is correct |
68 | Correct | 222 ms | 264984 KB | Output is correct |
69 | Correct | 4 ms | 4992 KB | Output is correct |
70 | Correct | 4 ms | 4992 KB | Output is correct |
71 | Correct | 3 ms | 4992 KB | Output is correct |
72 | Correct | 4 ms | 5760 KB | Output is correct |
73 | Correct | 4 ms | 5888 KB | Output is correct |
74 | Correct | 5 ms | 5632 KB | Output is correct |
75 | Correct | 4 ms | 5888 KB | Output is correct |
76 | Correct | 4 ms | 6144 KB | Output is correct |
77 | Correct | 4 ms | 5888 KB | Output is correct |
78 | Correct | 5 ms | 6016 KB | Output is correct |
79 | Correct | 5 ms | 6144 KB | Output is correct |
80 | Correct | 5 ms | 5760 KB | Output is correct |
81 | Correct | 5 ms | 6016 KB | Output is correct |
82 | Correct | 5 ms | 5888 KB | Output is correct |
83 | Correct | 4 ms | 5120 KB | Output is correct |
84 | Correct | 4 ms | 5760 KB | Output is correct |
85 | Correct | 4 ms | 5120 KB | Output is correct |
86 | Correct | 4 ms | 5888 KB | Output is correct |
87 | Correct | 4 ms | 5120 KB | Output is correct |
88 | Correct | 5 ms | 5888 KB | Output is correct |
89 | Correct | 4 ms | 6272 KB | Output is correct |
90 | Correct | 4 ms | 6272 KB | Output is correct |
91 | Correct | 5 ms | 6272 KB | Output is correct |
92 | Correct | 4 ms | 6272 KB | Output is correct |
93 | Correct | 5 ms | 6272 KB | Output is correct |
94 | Correct | 4 ms | 6272 KB | Output is correct |
95 | Correct | 5 ms | 6272 KB | Output is correct |
96 | Correct | 5 ms | 6272 KB | Output is correct |
97 | Correct | 5 ms | 6272 KB | Output is correct |
98 | Correct | 5 ms | 6272 KB | Output is correct |
99 | Correct | 5 ms | 6272 KB | Output is correct |
100 | Correct | 5 ms | 6272 KB | Output is correct |
101 | Correct | 4 ms | 5120 KB | Output is correct |
102 | Correct | 5 ms | 6272 KB | Output is correct |
103 | Correct | 4 ms | 5120 KB | Output is correct |
104 | Correct | 5 ms | 6272 KB | Output is correct |
105 | Correct | 5 ms | 5120 KB | Output is correct |
106 | Correct | 4 ms | 6272 KB | Output is correct |
107 | Correct | 5 ms | 5632 KB | Output is correct |
108 | Correct | 5 ms | 6272 KB | Output is correct |
109 | Correct | 5 ms | 6272 KB | Output is correct |
110 | Correct | 5 ms | 6272 KB | Output is correct |
111 | Correct | 5 ms | 6144 KB | Output is correct |
112 | Correct | 7 ms | 6272 KB | Output is correct |
113 | Correct | 7 ms | 6272 KB | Output is correct |
114 | Correct | 7 ms | 6272 KB | Output is correct |
115 | Correct | 6 ms | 6144 KB | Output is correct |
116 | Correct | 7 ms | 6144 KB | Output is correct |
117 | Correct | 7 ms | 6144 KB | Output is correct |
118 | Correct | 34 ms | 8952 KB | Output is correct |
119 | Correct | 32 ms | 9592 KB | Output is correct |
120 | Correct | 42 ms | 10112 KB | Output is correct |
121 | Correct | 5 ms | 6272 KB | Output is correct |
122 | Correct | 6 ms | 6272 KB | Output is correct |
123 | Correct | 6 ms | 6272 KB | Output is correct |
124 | Correct | 5 ms | 6272 KB | Output is correct |
125 | Correct | 6 ms | 6272 KB | Output is correct |
126 | Correct | 8 ms | 6656 KB | Output is correct |
127 | Correct | 8 ms | 6656 KB | Output is correct |
128 | Correct | 8 ms | 6656 KB | Output is correct |
129 | Correct | 8 ms | 6656 KB | Output is correct |
130 | Correct | 8 ms | 6656 KB | Output is correct |
131 | Correct | 9 ms | 6656 KB | Output is correct |
132 | Correct | 50 ms | 10872 KB | Output is correct |
133 | Correct | 50 ms | 10752 KB | Output is correct |
134 | Correct | 49 ms | 10872 KB | Output is correct |
135 | Correct | 33 ms | 54780 KB | Output is correct |
136 | Correct | 116 ms | 41336 KB | Output is correct |
137 | Correct | 85 ms | 35832 KB | Output is correct |
138 | Correct | 72 ms | 33784 KB | Output is correct |
139 | Correct | 93 ms | 43384 KB | Output is correct |
140 | Correct | 72 ms | 32104 KB | Output is correct |
141 | Correct | 41 ms | 34552 KB | Output is correct |
142 | Correct | 38 ms | 31864 KB | Output is correct |
143 | Correct | 60 ms | 52728 KB | Output is correct |
144 | Correct | 40 ms | 33912 KB | Output is correct |
145 | Correct | 45 ms | 38520 KB | Output is correct |
146 | Correct | 43 ms | 42364 KB | Output is correct |
147 | Correct | 52 ms | 33784 KB | Output is correct |
148 | Correct | 27 ms | 35328 KB | Output is correct |
149 | Correct | 59 ms | 35448 KB | Output is correct |
150 | Correct | 28 ms | 34296 KB | Output is correct |
151 | Correct | 76 ms | 50936 KB | Output is correct |
152 | Correct | 41 ms | 52728 KB | Output is correct |
153 | Correct | 41 ms | 44928 KB | Output is correct |
154 | Correct | 49 ms | 52728 KB | Output is correct |
155 | Correct | 36 ms | 39800 KB | Output is correct |
156 | Correct | 37 ms | 41184 KB | Output is correct |
157 | Correct | 36 ms | 55072 KB | Output is correct |
158 | Correct | 161 ms | 55176 KB | Output is correct |
159 | Correct | 140 ms | 55160 KB | Output is correct |
160 | Correct | 145 ms | 55032 KB | Output is correct |
161 | Correct | 131 ms | 55036 KB | Output is correct |
162 | Correct | 128 ms | 55056 KB | Output is correct |
163 | Correct | 67 ms | 57596 KB | Output is correct |
164 | Correct | 65 ms | 57596 KB | Output is correct |
165 | Correct | 64 ms | 57592 KB | Output is correct |
166 | Correct | 65 ms | 57592 KB | Output is correct |
167 | Correct | 73 ms | 57548 KB | Output is correct |
168 | Correct | 64 ms | 57592 KB | Output is correct |
169 | Correct | 89 ms | 55036 KB | Output is correct |
170 | Correct | 44 ms | 56240 KB | Output is correct |
171 | Correct | 89 ms | 54648 KB | Output is correct |
172 | Correct | 45 ms | 56240 KB | Output is correct |
173 | Correct | 86 ms | 55032 KB | Output is correct |
174 | Correct | 44 ms | 56184 KB | Output is correct |
175 | Correct | 50 ms | 56696 KB | Output is correct |
176 | Correct | 49 ms | 56624 KB | Output is correct |
177 | Correct | 48 ms | 56600 KB | Output is correct |
178 | Correct | 48 ms | 56568 KB | Output is correct |
179 | Correct | 85 ms | 159988 KB | Output is correct |
180 | Correct | 339 ms | 135156 KB | Output is correct |
181 | Correct | 480 ms | 192884 KB | Output is correct |
182 | Correct | 650 ms | 252404 KB | Output is correct |
183 | Correct | 360 ms | 167544 KB | Output is correct |
184 | Correct | 324 ms | 160744 KB | Output is correct |
185 | Correct | 126 ms | 139260 KB | Output is correct |
186 | Correct | 137 ms | 170908 KB | Output is correct |
187 | Correct | 149 ms | 163836 KB | Output is correct |
188 | Correct | 168 ms | 200952 KB | Output is correct |
189 | Correct | 201 ms | 229624 KB | Output is correct |
190 | Correct | 170 ms | 194424 KB | Output is correct |
191 | Correct | 188 ms | 204536 KB | Output is correct |
192 | Correct | 130 ms | 149240 KB | Output is correct |
193 | Correct | 145 ms | 173816 KB | Output is correct |
194 | Correct | 138 ms | 254960 KB | Output is correct |
195 | Correct | 766 ms | 255240 KB | Output is correct |
196 | Correct | 720 ms | 254420 KB | Output is correct |
197 | Correct | 666 ms | 254540 KB | Output is correct |
198 | Correct | 636 ms | 254612 KB | Output is correct |
199 | Correct | 600 ms | 254656 KB | Output is correct |
200 | Correct | 272 ms | 267908 KB | Output is correct |
201 | Correct | 265 ms | 267908 KB | Output is correct |
202 | Correct | 269 ms | 268036 KB | Output is correct |
203 | Correct | 307 ms | 267908 KB | Output is correct |
204 | Correct | 280 ms | 267936 KB | Output is correct |
205 | Correct | 273 ms | 267904 KB | Output is correct |
206 | Correct | 244 ms | 238840 KB | Output is correct |
207 | Correct | 227 ms | 265080 KB | Output is correct |
208 | Correct | 264 ms | 238712 KB | Output is correct |
209 | Correct | 234 ms | 265148 KB | Output is correct |
210 | Correct | 234 ms | 239096 KB | Output is correct |
211 | Correct | 227 ms | 265036 KB | Output is correct |
212 | Correct | 243 ms | 267276 KB | Output is correct |
213 | Correct | 264 ms | 264248 KB | Output is correct |
214 | Correct | 235 ms | 263804 KB | Output is correct |
215 | Correct | 243 ms | 263584 KB | Output is correct |