Submission #320955

# Submission time Handle Problem Language Result Execution time Memory
320955 2020-11-10T10:48:49 Z prarie Painting Walls (APIO20_paint) C++14
100 / 100
1191 ms 15512 KB
#include "paint.h"

#include <bits/stdc++.h>

using namespace std;

vector<int> col[100005]; // 색 k 를 좋아하는 일꾼의 집합
bool wall[100005]; // 벽 i 를 칠할 수 있는가?
int dp[100005];
int con[2][50005];
// 벽 i 를 칠할 수 있을 때
// [0 ... i] 까지 칠하는 최소 횟수

int minimumInstructions(
    int N, int M, int K, std::vector<int> C,
    std::vector<int> A, std::vector<std::vector<int>> B) {

	for (int i = 0; i < M; i++) {
		for (auto &m : B[i]) col[m].push_back(i);
	}
	for (int i = 0; i < N; i++) {
		int now = (i & 1), bef = (now ^ 1);
		for (auto &n : col[C[i]]) {
			con[now][n] = con[bef][(n - 1 + M) % M] + 1;
			if (con[now][n] == M) {
				wall[i] = true;
				con[now][n] = M - 1;
			}
		}
		memset(con[bef], 0, sizeof(con[bef]));
	}
	memset(dp, -0x2f, sizeof dp);
	deque<pair<int, int>> dq;
	if (wall[M - 1]) {
		dp[M - 1] = 1;
		dq.emplace_back(M - 1, 1);
	}
	for (int i = M; i < N; i++) {
		if (!wall[i]) continue;
		while (dq.size() && dq.back().first < i - M) dq.pop_back();
		if (dq.empty()) break;
		dp[i] = dq.back().second + 1;
		while (dq.size() && dq.front().second >= dp[i]) dq.pop_front();
		dq.emplace_front(i, dp[i]);
	}
	return (dp[N - 1] < 0 ? -1 : dp[N - 1]);
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3308 KB Output is correct
2 Correct 2 ms 3436 KB Output is correct
3 Correct 2 ms 3436 KB Output is correct
4 Correct 3 ms 3436 KB Output is correct
5 Correct 3 ms 3436 KB Output is correct
6 Correct 2 ms 3436 KB Output is correct
7 Correct 6 ms 3436 KB Output is correct
8 Correct 7 ms 3436 KB Output is correct
9 Correct 6 ms 3436 KB Output is correct
10 Correct 6 ms 3436 KB Output is correct
11 Correct 6 ms 3436 KB Output is correct
12 Correct 6 ms 3436 KB Output is correct
13 Correct 6 ms 3436 KB Output is correct
14 Correct 7 ms 3436 KB Output is correct
15 Correct 6 ms 3436 KB Output is correct
16 Correct 7 ms 3436 KB Output is correct
17 Correct 6 ms 3564 KB Output is correct
18 Correct 7 ms 3436 KB Output is correct
19 Correct 7 ms 3692 KB Output is correct
20 Correct 6 ms 3564 KB Output is correct
21 Correct 6 ms 3564 KB Output is correct
22 Correct 29 ms 8044 KB Output is correct
23 Correct 31 ms 7916 KB Output is correct
24 Correct 32 ms 7908 KB Output is correct
25 Correct 140 ms 3684 KB Output is correct
26 Correct 142 ms 3812 KB Output is correct
27 Correct 140 ms 3684 KB Output is correct
28 Correct 145 ms 3624 KB Output is correct
29 Correct 139 ms 3684 KB Output is correct
30 Correct 139 ms 3684 KB Output is correct
31 Correct 151 ms 4836 KB Output is correct
32 Correct 157 ms 4708 KB Output is correct
33 Correct 154 ms 4836 KB Output is correct
34 Correct 162 ms 4836 KB Output is correct
35 Correct 149 ms 4972 KB Output is correct
36 Correct 151 ms 4836 KB Output is correct
37 Correct 169 ms 8548 KB Output is correct
38 Correct 170 ms 8548 KB Output is correct
39 Correct 177 ms 8448 KB Output is correct
40 Correct 626 ms 4452 KB Output is correct
41 Correct 395 ms 4196 KB Output is correct
42 Correct 682 ms 4708 KB Output is correct
43 Correct 457 ms 4196 KB Output is correct
44 Correct 422 ms 4108 KB Output is correct
45 Correct 695 ms 4620 KB Output is correct
46 Correct 644 ms 13796 KB Output is correct
47 Correct 415 ms 9444 KB Output is correct
48 Correct 436 ms 12004 KB Output is correct
49 Correct 479 ms 12132 KB Output is correct
50 Correct 535 ms 11792 KB Output is correct
51 Correct 555 ms 9572 KB Output is correct
52 Correct 705 ms 4840 KB Output is correct
53 Correct 702 ms 4580 KB Output is correct
54 Correct 709 ms 4580 KB Output is correct
55 Correct 696 ms 4580 KB Output is correct
56 Correct 688 ms 4608 KB Output is correct
57 Correct 697 ms 4580 KB Output is correct
58 Correct 752 ms 14692 KB Output is correct
59 Correct 749 ms 14820 KB Output is correct
60 Correct 743 ms 14564 KB Output is correct
61 Correct 741 ms 14812 KB Output is correct
62 Correct 744 ms 14692 KB Output is correct
63 Correct 741 ms 14620 KB Output is correct
64 Correct 753 ms 13924 KB Output is correct
65 Correct 753 ms 13796 KB Output is correct
66 Correct 757 ms 13884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3436 KB Output is correct
2 Correct 2 ms 3436 KB Output is correct
3 Correct 2 ms 3308 KB Output is correct
4 Correct 2 ms 3436 KB Output is correct
5 Correct 2 ms 3436 KB Output is correct
6 Correct 3 ms 3436 KB Output is correct
7 Correct 3 ms 3436 KB Output is correct
8 Correct 2 ms 3436 KB Output is correct
9 Correct 6 ms 3436 KB Output is correct
10 Correct 7 ms 3436 KB Output is correct
11 Correct 6 ms 3436 KB Output is correct
12 Correct 6 ms 3436 KB Output is correct
13 Correct 6 ms 3436 KB Output is correct
14 Correct 6 ms 3436 KB Output is correct
15 Correct 6 ms 3436 KB Output is correct
16 Correct 7 ms 3436 KB Output is correct
17 Correct 6 ms 3436 KB Output is correct
18 Correct 7 ms 3436 KB Output is correct
19 Correct 6 ms 3564 KB Output is correct
20 Correct 7 ms 3436 KB Output is correct
21 Correct 7 ms 3692 KB Output is correct
22 Correct 6 ms 3564 KB Output is correct
23 Correct 6 ms 3564 KB Output is correct
24 Correct 2 ms 3436 KB Output is correct
25 Correct 3 ms 3564 KB Output is correct
26 Correct 2 ms 3436 KB Output is correct
27 Correct 5 ms 3436 KB Output is correct
28 Correct 5 ms 3432 KB Output is correct
29 Correct 5 ms 3436 KB Output is correct
30 Correct 5 ms 3568 KB Output is correct
31 Correct 7 ms 3436 KB Output is correct
32 Correct 5 ms 3436 KB Output is correct
33 Correct 6 ms 3436 KB Output is correct
34 Correct 6 ms 3436 KB Output is correct
35 Correct 5 ms 3436 KB Output is correct
36 Correct 5 ms 3436 KB Output is correct
37 Correct 5 ms 3436 KB Output is correct
38 Correct 5 ms 3436 KB Output is correct
39 Correct 5 ms 3436 KB Output is correct
40 Correct 5 ms 3564 KB Output is correct
41 Correct 5 ms 3436 KB Output is correct
42 Correct 6 ms 3436 KB Output is correct
43 Correct 5 ms 3436 KB Output is correct
44 Correct 6 ms 3436 KB Output is correct
45 Correct 6 ms 3436 KB Output is correct
46 Correct 6 ms 3436 KB Output is correct
47 Correct 6 ms 3436 KB Output is correct
48 Correct 6 ms 3436 KB Output is correct
49 Correct 6 ms 3436 KB Output is correct
50 Correct 6 ms 3712 KB Output is correct
51 Correct 6 ms 3436 KB Output is correct
52 Correct 6 ms 3436 KB Output is correct
53 Correct 6 ms 3436 KB Output is correct
54 Correct 6 ms 3564 KB Output is correct
55 Correct 6 ms 3436 KB Output is correct
56 Correct 6 ms 3564 KB Output is correct
57 Correct 6 ms 3436 KB Output is correct
58 Correct 6 ms 3564 KB Output is correct
59 Correct 6 ms 3436 KB Output is correct
60 Correct 6 ms 3564 KB Output is correct
61 Correct 6 ms 3436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3436 KB Output is correct
2 Correct 2 ms 3436 KB Output is correct
3 Correct 2 ms 3308 KB Output is correct
4 Correct 2 ms 3436 KB Output is correct
5 Correct 2 ms 3436 KB Output is correct
6 Correct 3 ms 3436 KB Output is correct
7 Correct 3 ms 3436 KB Output is correct
8 Correct 2 ms 3436 KB Output is correct
9 Correct 6 ms 3436 KB Output is correct
10 Correct 7 ms 3436 KB Output is correct
11 Correct 6 ms 3436 KB Output is correct
12 Correct 6 ms 3436 KB Output is correct
13 Correct 6 ms 3436 KB Output is correct
14 Correct 6 ms 3436 KB Output is correct
15 Correct 6 ms 3436 KB Output is correct
16 Correct 7 ms 3436 KB Output is correct
17 Correct 6 ms 3436 KB Output is correct
18 Correct 7 ms 3436 KB Output is correct
19 Correct 6 ms 3564 KB Output is correct
20 Correct 7 ms 3436 KB Output is correct
21 Correct 7 ms 3692 KB Output is correct
22 Correct 6 ms 3564 KB Output is correct
23 Correct 6 ms 3564 KB Output is correct
24 Correct 29 ms 8044 KB Output is correct
25 Correct 31 ms 7916 KB Output is correct
26 Correct 32 ms 7908 KB Output is correct
27 Correct 2 ms 3436 KB Output is correct
28 Correct 3 ms 3564 KB Output is correct
29 Correct 2 ms 3436 KB Output is correct
30 Correct 5 ms 3436 KB Output is correct
31 Correct 5 ms 3432 KB Output is correct
32 Correct 5 ms 3436 KB Output is correct
33 Correct 5 ms 3568 KB Output is correct
34 Correct 7 ms 3436 KB Output is correct
35 Correct 5 ms 3436 KB Output is correct
36 Correct 6 ms 3436 KB Output is correct
37 Correct 6 ms 3436 KB Output is correct
38 Correct 5 ms 3436 KB Output is correct
39 Correct 5 ms 3436 KB Output is correct
40 Correct 5 ms 3436 KB Output is correct
41 Correct 5 ms 3436 KB Output is correct
42 Correct 5 ms 3436 KB Output is correct
43 Correct 5 ms 3564 KB Output is correct
44 Correct 5 ms 3436 KB Output is correct
45 Correct 6 ms 3436 KB Output is correct
46 Correct 5 ms 3436 KB Output is correct
47 Correct 6 ms 3436 KB Output is correct
48 Correct 6 ms 3436 KB Output is correct
49 Correct 6 ms 3436 KB Output is correct
50 Correct 6 ms 3436 KB Output is correct
51 Correct 6 ms 3436 KB Output is correct
52 Correct 6 ms 3436 KB Output is correct
53 Correct 6 ms 3712 KB Output is correct
54 Correct 6 ms 3436 KB Output is correct
55 Correct 6 ms 3436 KB Output is correct
56 Correct 6 ms 3436 KB Output is correct
57 Correct 6 ms 3564 KB Output is correct
58 Correct 6 ms 3436 KB Output is correct
59 Correct 6 ms 3564 KB Output is correct
60 Correct 6 ms 3436 KB Output is correct
61 Correct 6 ms 3564 KB Output is correct
62 Correct 6 ms 3436 KB Output is correct
63 Correct 6 ms 3564 KB Output is correct
64 Correct 6 ms 3436 KB Output is correct
65 Correct 5 ms 3436 KB Output is correct
66 Correct 8 ms 3636 KB Output is correct
67 Correct 10 ms 3436 KB Output is correct
68 Correct 10 ms 3436 KB Output is correct
69 Correct 9 ms 3436 KB Output is correct
70 Correct 7 ms 3692 KB Output is correct
71 Correct 9 ms 3692 KB Output is correct
72 Correct 9 ms 3692 KB Output is correct
73 Correct 8 ms 3564 KB Output is correct
74 Correct 7 ms 3692 KB Output is correct
75 Correct 6 ms 3820 KB Output is correct
76 Correct 32 ms 6756 KB Output is correct
77 Correct 28 ms 7396 KB Output is correct
78 Correct 38 ms 7780 KB Output is correct
79 Correct 7 ms 3436 KB Output is correct
80 Correct 7 ms 3436 KB Output is correct
81 Correct 7 ms 3436 KB Output is correct
82 Correct 7 ms 3436 KB Output is correct
83 Correct 7 ms 3436 KB Output is correct
84 Correct 8 ms 3820 KB Output is correct
85 Correct 10 ms 3820 KB Output is correct
86 Correct 9 ms 3968 KB Output is correct
87 Correct 9 ms 3820 KB Output is correct
88 Correct 9 ms 3820 KB Output is correct
89 Correct 9 ms 3820 KB Output is correct
90 Correct 43 ms 8168 KB Output is correct
91 Correct 42 ms 8164 KB Output is correct
92 Correct 44 ms 8172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3436 KB Output is correct
2 Correct 2 ms 3436 KB Output is correct
3 Correct 2 ms 3308 KB Output is correct
4 Correct 2 ms 3436 KB Output is correct
5 Correct 2 ms 3436 KB Output is correct
6 Correct 3 ms 3436 KB Output is correct
7 Correct 3 ms 3436 KB Output is correct
8 Correct 2 ms 3436 KB Output is correct
9 Correct 6 ms 3436 KB Output is correct
10 Correct 7 ms 3436 KB Output is correct
11 Correct 6 ms 3436 KB Output is correct
12 Correct 6 ms 3436 KB Output is correct
13 Correct 6 ms 3436 KB Output is correct
14 Correct 6 ms 3436 KB Output is correct
15 Correct 6 ms 3436 KB Output is correct
16 Correct 7 ms 3436 KB Output is correct
17 Correct 6 ms 3436 KB Output is correct
18 Correct 7 ms 3436 KB Output is correct
19 Correct 6 ms 3564 KB Output is correct
20 Correct 7 ms 3436 KB Output is correct
21 Correct 7 ms 3692 KB Output is correct
22 Correct 6 ms 3564 KB Output is correct
23 Correct 6 ms 3564 KB Output is correct
24 Correct 29 ms 8044 KB Output is correct
25 Correct 31 ms 7916 KB Output is correct
26 Correct 32 ms 7908 KB Output is correct
27 Correct 140 ms 3684 KB Output is correct
28 Correct 142 ms 3812 KB Output is correct
29 Correct 140 ms 3684 KB Output is correct
30 Correct 145 ms 3624 KB Output is correct
31 Correct 139 ms 3684 KB Output is correct
32 Correct 139 ms 3684 KB Output is correct
33 Correct 151 ms 4836 KB Output is correct
34 Correct 157 ms 4708 KB Output is correct
35 Correct 154 ms 4836 KB Output is correct
36 Correct 162 ms 4836 KB Output is correct
37 Correct 149 ms 4972 KB Output is correct
38 Correct 151 ms 4836 KB Output is correct
39 Correct 169 ms 8548 KB Output is correct
40 Correct 170 ms 8548 KB Output is correct
41 Correct 177 ms 8448 KB Output is correct
42 Correct 2 ms 3436 KB Output is correct
43 Correct 3 ms 3564 KB Output is correct
44 Correct 2 ms 3436 KB Output is correct
45 Correct 5 ms 3436 KB Output is correct
46 Correct 5 ms 3432 KB Output is correct
47 Correct 5 ms 3436 KB Output is correct
48 Correct 5 ms 3568 KB Output is correct
49 Correct 7 ms 3436 KB Output is correct
50 Correct 5 ms 3436 KB Output is correct
51 Correct 6 ms 3436 KB Output is correct
52 Correct 6 ms 3436 KB Output is correct
53 Correct 5 ms 3436 KB Output is correct
54 Correct 5 ms 3436 KB Output is correct
55 Correct 5 ms 3436 KB Output is correct
56 Correct 5 ms 3436 KB Output is correct
57 Correct 5 ms 3436 KB Output is correct
58 Correct 5 ms 3564 KB Output is correct
59 Correct 5 ms 3436 KB Output is correct
60 Correct 6 ms 3436 KB Output is correct
61 Correct 5 ms 3436 KB Output is correct
62 Correct 6 ms 3436 KB Output is correct
63 Correct 6 ms 3436 KB Output is correct
64 Correct 6 ms 3436 KB Output is correct
65 Correct 6 ms 3436 KB Output is correct
66 Correct 6 ms 3436 KB Output is correct
67 Correct 6 ms 3436 KB Output is correct
68 Correct 6 ms 3712 KB Output is correct
69 Correct 6 ms 3436 KB Output is correct
70 Correct 6 ms 3436 KB Output is correct
71 Correct 6 ms 3436 KB Output is correct
72 Correct 6 ms 3564 KB Output is correct
73 Correct 6 ms 3436 KB Output is correct
74 Correct 6 ms 3564 KB Output is correct
75 Correct 6 ms 3436 KB Output is correct
76 Correct 6 ms 3564 KB Output is correct
77 Correct 6 ms 3436 KB Output is correct
78 Correct 6 ms 3564 KB Output is correct
79 Correct 6 ms 3436 KB Output is correct
80 Correct 5 ms 3436 KB Output is correct
81 Correct 8 ms 3636 KB Output is correct
82 Correct 10 ms 3436 KB Output is correct
83 Correct 10 ms 3436 KB Output is correct
84 Correct 9 ms 3436 KB Output is correct
85 Correct 7 ms 3692 KB Output is correct
86 Correct 9 ms 3692 KB Output is correct
87 Correct 9 ms 3692 KB Output is correct
88 Correct 8 ms 3564 KB Output is correct
89 Correct 7 ms 3692 KB Output is correct
90 Correct 6 ms 3820 KB Output is correct
91 Correct 32 ms 6756 KB Output is correct
92 Correct 28 ms 7396 KB Output is correct
93 Correct 38 ms 7780 KB Output is correct
94 Correct 7 ms 3436 KB Output is correct
95 Correct 7 ms 3436 KB Output is correct
96 Correct 7 ms 3436 KB Output is correct
97 Correct 7 ms 3436 KB Output is correct
98 Correct 7 ms 3436 KB Output is correct
99 Correct 8 ms 3820 KB Output is correct
100 Correct 10 ms 3820 KB Output is correct
101 Correct 9 ms 3968 KB Output is correct
102 Correct 9 ms 3820 KB Output is correct
103 Correct 9 ms 3820 KB Output is correct
104 Correct 9 ms 3820 KB Output is correct
105 Correct 43 ms 8168 KB Output is correct
106 Correct 42 ms 8164 KB Output is correct
107 Correct 44 ms 8172 KB Output is correct
108 Correct 139 ms 3688 KB Output is correct
109 Correct 168 ms 3680 KB Output is correct
110 Correct 114 ms 3684 KB Output is correct
111 Correct 103 ms 3700 KB Output is correct
112 Correct 131 ms 3684 KB Output is correct
113 Correct 94 ms 3684 KB Output is correct
114 Correct 94 ms 5172 KB Output is correct
115 Correct 88 ms 4968 KB Output is correct
116 Correct 145 ms 5348 KB Output is correct
117 Correct 90 ms 5092 KB Output is correct
118 Correct 106 ms 5220 KB Output is correct
119 Correct 113 ms 4836 KB Output is correct
120 Correct 107 ms 6500 KB Output is correct
121 Correct 89 ms 4068 KB Output is correct
122 Correct 107 ms 7012 KB Output is correct
123 Correct 91 ms 4068 KB Output is correct
124 Correct 170 ms 7608 KB Output is correct
125 Correct 140 ms 4324 KB Output is correct
126 Correct 117 ms 4484 KB Output is correct
127 Correct 147 ms 4796 KB Output is correct
128 Correct 105 ms 4324 KB Output is correct
129 Correct 107 ms 4452 KB Output is correct
130 Correct 139 ms 3684 KB Output is correct
131 Correct 231 ms 4068 KB Output is correct
132 Correct 192 ms 3800 KB Output is correct
133 Correct 181 ms 3812 KB Output is correct
134 Correct 175 ms 3812 KB Output is correct
135 Correct 173 ms 3940 KB Output is correct
136 Correct 165 ms 5604 KB Output is correct
137 Correct 167 ms 5732 KB Output is correct
138 Correct 162 ms 5732 KB Output is correct
139 Correct 167 ms 5732 KB Output is correct
140 Correct 161 ms 5604 KB Output is correct
141 Correct 160 ms 5604 KB Output is correct
142 Correct 187 ms 8676 KB Output is correct
143 Correct 161 ms 4580 KB Output is correct
144 Correct 183 ms 8548 KB Output is correct
145 Correct 157 ms 4580 KB Output is correct
146 Correct 189 ms 8556 KB Output is correct
147 Correct 148 ms 4580 KB Output is correct
148 Correct 152 ms 4964 KB Output is correct
149 Correct 154 ms 4836 KB Output is correct
150 Correct 151 ms 4836 KB Output is correct
151 Correct 151 ms 4836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3436 KB Output is correct
2 Correct 2 ms 3436 KB Output is correct
3 Correct 2 ms 3308 KB Output is correct
4 Correct 2 ms 3436 KB Output is correct
5 Correct 2 ms 3436 KB Output is correct
6 Correct 3 ms 3436 KB Output is correct
7 Correct 3 ms 3436 KB Output is correct
8 Correct 2 ms 3436 KB Output is correct
9 Correct 6 ms 3436 KB Output is correct
10 Correct 7 ms 3436 KB Output is correct
11 Correct 6 ms 3436 KB Output is correct
12 Correct 6 ms 3436 KB Output is correct
13 Correct 6 ms 3436 KB Output is correct
14 Correct 6 ms 3436 KB Output is correct
15 Correct 6 ms 3436 KB Output is correct
16 Correct 7 ms 3436 KB Output is correct
17 Correct 6 ms 3436 KB Output is correct
18 Correct 7 ms 3436 KB Output is correct
19 Correct 6 ms 3564 KB Output is correct
20 Correct 7 ms 3436 KB Output is correct
21 Correct 7 ms 3692 KB Output is correct
22 Correct 6 ms 3564 KB Output is correct
23 Correct 6 ms 3564 KB Output is correct
24 Correct 29 ms 8044 KB Output is correct
25 Correct 31 ms 7916 KB Output is correct
26 Correct 32 ms 7908 KB Output is correct
27 Correct 140 ms 3684 KB Output is correct
28 Correct 142 ms 3812 KB Output is correct
29 Correct 140 ms 3684 KB Output is correct
30 Correct 145 ms 3624 KB Output is correct
31 Correct 139 ms 3684 KB Output is correct
32 Correct 139 ms 3684 KB Output is correct
33 Correct 151 ms 4836 KB Output is correct
34 Correct 157 ms 4708 KB Output is correct
35 Correct 154 ms 4836 KB Output is correct
36 Correct 162 ms 4836 KB Output is correct
37 Correct 149 ms 4972 KB Output is correct
38 Correct 151 ms 4836 KB Output is correct
39 Correct 169 ms 8548 KB Output is correct
40 Correct 170 ms 8548 KB Output is correct
41 Correct 177 ms 8448 KB Output is correct
42 Correct 626 ms 4452 KB Output is correct
43 Correct 395 ms 4196 KB Output is correct
44 Correct 682 ms 4708 KB Output is correct
45 Correct 457 ms 4196 KB Output is correct
46 Correct 422 ms 4108 KB Output is correct
47 Correct 695 ms 4620 KB Output is correct
48 Correct 644 ms 13796 KB Output is correct
49 Correct 415 ms 9444 KB Output is correct
50 Correct 436 ms 12004 KB Output is correct
51 Correct 479 ms 12132 KB Output is correct
52 Correct 535 ms 11792 KB Output is correct
53 Correct 555 ms 9572 KB Output is correct
54 Correct 705 ms 4840 KB Output is correct
55 Correct 702 ms 4580 KB Output is correct
56 Correct 709 ms 4580 KB Output is correct
57 Correct 696 ms 4580 KB Output is correct
58 Correct 688 ms 4608 KB Output is correct
59 Correct 697 ms 4580 KB Output is correct
60 Correct 752 ms 14692 KB Output is correct
61 Correct 749 ms 14820 KB Output is correct
62 Correct 743 ms 14564 KB Output is correct
63 Correct 741 ms 14812 KB Output is correct
64 Correct 744 ms 14692 KB Output is correct
65 Correct 741 ms 14620 KB Output is correct
66 Correct 753 ms 13924 KB Output is correct
67 Correct 753 ms 13796 KB Output is correct
68 Correct 757 ms 13884 KB Output is correct
69 Correct 2 ms 3436 KB Output is correct
70 Correct 3 ms 3564 KB Output is correct
71 Correct 2 ms 3436 KB Output is correct
72 Correct 5 ms 3436 KB Output is correct
73 Correct 5 ms 3432 KB Output is correct
74 Correct 5 ms 3436 KB Output is correct
75 Correct 5 ms 3568 KB Output is correct
76 Correct 7 ms 3436 KB Output is correct
77 Correct 5 ms 3436 KB Output is correct
78 Correct 6 ms 3436 KB Output is correct
79 Correct 6 ms 3436 KB Output is correct
80 Correct 5 ms 3436 KB Output is correct
81 Correct 5 ms 3436 KB Output is correct
82 Correct 5 ms 3436 KB Output is correct
83 Correct 5 ms 3436 KB Output is correct
84 Correct 5 ms 3436 KB Output is correct
85 Correct 5 ms 3564 KB Output is correct
86 Correct 5 ms 3436 KB Output is correct
87 Correct 6 ms 3436 KB Output is correct
88 Correct 5 ms 3436 KB Output is correct
89 Correct 6 ms 3436 KB Output is correct
90 Correct 6 ms 3436 KB Output is correct
91 Correct 6 ms 3436 KB Output is correct
92 Correct 6 ms 3436 KB Output is correct
93 Correct 6 ms 3436 KB Output is correct
94 Correct 6 ms 3436 KB Output is correct
95 Correct 6 ms 3712 KB Output is correct
96 Correct 6 ms 3436 KB Output is correct
97 Correct 6 ms 3436 KB Output is correct
98 Correct 6 ms 3436 KB Output is correct
99 Correct 6 ms 3564 KB Output is correct
100 Correct 6 ms 3436 KB Output is correct
101 Correct 6 ms 3564 KB Output is correct
102 Correct 6 ms 3436 KB Output is correct
103 Correct 6 ms 3564 KB Output is correct
104 Correct 6 ms 3436 KB Output is correct
105 Correct 6 ms 3564 KB Output is correct
106 Correct 6 ms 3436 KB Output is correct
107 Correct 5 ms 3436 KB Output is correct
108 Correct 8 ms 3636 KB Output is correct
109 Correct 10 ms 3436 KB Output is correct
110 Correct 10 ms 3436 KB Output is correct
111 Correct 9 ms 3436 KB Output is correct
112 Correct 7 ms 3692 KB Output is correct
113 Correct 9 ms 3692 KB Output is correct
114 Correct 9 ms 3692 KB Output is correct
115 Correct 8 ms 3564 KB Output is correct
116 Correct 7 ms 3692 KB Output is correct
117 Correct 6 ms 3820 KB Output is correct
118 Correct 32 ms 6756 KB Output is correct
119 Correct 28 ms 7396 KB Output is correct
120 Correct 38 ms 7780 KB Output is correct
121 Correct 7 ms 3436 KB Output is correct
122 Correct 7 ms 3436 KB Output is correct
123 Correct 7 ms 3436 KB Output is correct
124 Correct 7 ms 3436 KB Output is correct
125 Correct 7 ms 3436 KB Output is correct
126 Correct 8 ms 3820 KB Output is correct
127 Correct 10 ms 3820 KB Output is correct
128 Correct 9 ms 3968 KB Output is correct
129 Correct 9 ms 3820 KB Output is correct
130 Correct 9 ms 3820 KB Output is correct
131 Correct 9 ms 3820 KB Output is correct
132 Correct 43 ms 8168 KB Output is correct
133 Correct 42 ms 8164 KB Output is correct
134 Correct 44 ms 8172 KB Output is correct
135 Correct 139 ms 3688 KB Output is correct
136 Correct 168 ms 3680 KB Output is correct
137 Correct 114 ms 3684 KB Output is correct
138 Correct 103 ms 3700 KB Output is correct
139 Correct 131 ms 3684 KB Output is correct
140 Correct 94 ms 3684 KB Output is correct
141 Correct 94 ms 5172 KB Output is correct
142 Correct 88 ms 4968 KB Output is correct
143 Correct 145 ms 5348 KB Output is correct
144 Correct 90 ms 5092 KB Output is correct
145 Correct 106 ms 5220 KB Output is correct
146 Correct 113 ms 4836 KB Output is correct
147 Correct 107 ms 6500 KB Output is correct
148 Correct 89 ms 4068 KB Output is correct
149 Correct 107 ms 7012 KB Output is correct
150 Correct 91 ms 4068 KB Output is correct
151 Correct 170 ms 7608 KB Output is correct
152 Correct 140 ms 4324 KB Output is correct
153 Correct 117 ms 4484 KB Output is correct
154 Correct 147 ms 4796 KB Output is correct
155 Correct 105 ms 4324 KB Output is correct
156 Correct 107 ms 4452 KB Output is correct
157 Correct 139 ms 3684 KB Output is correct
158 Correct 231 ms 4068 KB Output is correct
159 Correct 192 ms 3800 KB Output is correct
160 Correct 181 ms 3812 KB Output is correct
161 Correct 175 ms 3812 KB Output is correct
162 Correct 173 ms 3940 KB Output is correct
163 Correct 165 ms 5604 KB Output is correct
164 Correct 167 ms 5732 KB Output is correct
165 Correct 162 ms 5732 KB Output is correct
166 Correct 167 ms 5732 KB Output is correct
167 Correct 161 ms 5604 KB Output is correct
168 Correct 160 ms 5604 KB Output is correct
169 Correct 187 ms 8676 KB Output is correct
170 Correct 161 ms 4580 KB Output is correct
171 Correct 183 ms 8548 KB Output is correct
172 Correct 157 ms 4580 KB Output is correct
173 Correct 189 ms 8556 KB Output is correct
174 Correct 148 ms 4580 KB Output is correct
175 Correct 152 ms 4964 KB Output is correct
176 Correct 154 ms 4836 KB Output is correct
177 Correct 151 ms 4836 KB Output is correct
178 Correct 151 ms 4836 KB Output is correct
179 Correct 429 ms 4068 KB Output is correct
180 Correct 551 ms 4068 KB Output is correct
181 Correct 704 ms 4356 KB Output is correct
182 Correct 898 ms 4604 KB Output is correct
183 Correct 568 ms 4288 KB Output is correct
184 Correct 529 ms 4280 KB Output is correct
185 Correct 391 ms 7832 KB Output is correct
186 Correct 477 ms 9176 KB Output is correct
187 Correct 488 ms 8548 KB Output is correct
188 Correct 667 ms 8072 KB Output is correct
189 Correct 666 ms 7904 KB Output is correct
190 Correct 587 ms 9156 KB Output is correct
191 Correct 598 ms 8812 KB Output is correct
192 Correct 498 ms 7396 KB Output is correct
193 Correct 509 ms 6756 KB Output is correct
194 Correct 714 ms 4580 KB Output is correct
195 Correct 1191 ms 4600 KB Output is correct
196 Correct 932 ms 4600 KB Output is correct
197 Correct 934 ms 4636 KB Output is correct
198 Correct 889 ms 4668 KB Output is correct
199 Correct 864 ms 4680 KB Output is correct
200 Correct 797 ms 15268 KB Output is correct
201 Correct 799 ms 15264 KB Output is correct
202 Correct 768 ms 15428 KB Output is correct
203 Correct 780 ms 15136 KB Output is correct
204 Correct 775 ms 15512 KB Output is correct
205 Correct 811 ms 15332 KB Output is correct
206 Correct 774 ms 14088 KB Output is correct
207 Correct 782 ms 13668 KB Output is correct
208 Correct 766 ms 14076 KB Output is correct
209 Correct 754 ms 13420 KB Output is correct
210 Correct 774 ms 14056 KB Output is correct
211 Correct 751 ms 13412 KB Output is correct
212 Correct 763 ms 15076 KB Output is correct
213 Correct 750 ms 12132 KB Output is correct
214 Correct 755 ms 11748 KB Output is correct
215 Correct 759 ms 11364 KB Output is correct