답안 #290077

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
290077 2020-09-03T11:36:43 Z maximath_1 벽 칠하기 (APIO20_paint) C++11
100 / 100
1186 ms 265092 KB
#include "paint.h"
#include <vector>
#include <set>
#include <numeric>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
#define vi vector<int>

vector<int> adj;
vector<bool> vis;
vector<int> up;
bool ada[100005];
vector<int> col[100005];
unordered_map<int, int> check[100005];
vector<int> cntt;
int minimumInstructions(int N, int M, int K, vi C, vi A, vector<vi> B){
	cntt.assign(K, 1);
	for(int i = 0; i < M; i ++)
		for(int j = 0; j < A[i]; j ++){
			col[B[i][j]].push_back(i);
			check[B[i][j]][i] = cntt[B[i][j]];
			cntt[B[i][j]] ++;
		}
	
	up.resize(N);

	int cnt = 0;
	for(int i = 0; i < N; i ++){
		cnt += col[C[i]].size();
		up[i] = cnt - 1;
	}

	adj.assign(cnt, -1);
	vis.assign(cnt, 0);

	for(int i = 0; i < N - 1; i ++){
		int gi = (i == 0 ? 0 : up[i - 1] + 1);
	//	for(int uwu = 0; uwu < M; uwu ++)
	//		cout << check[C[i + 1]][uwu] << " "; cout << endl;
		for(int j : col[C[i]]){ 
			int gt = check[C[i + 1]][(j + 1) % M];
	//		cout << gi << " " <<  gt << endl;
			if(gt){
				int gi2 = up[i] + gt;
				adj[gi] = gi2;
			//	cout << gi << " -> " << gi2 << endl;
			}
			gi ++;
		}
	}

	int tpnw = 0;
	for(int i = 0; i < cnt; i ++){
		if(up[tpnw] < i) tpnw ++;
		if(vis[i]) continue;
		int tp = tpnw;
		if(ada[tp]) continue;
		int len = 1;
		for(int nw = i;;){
			vis[nw] = 1;
			if(adj[nw] != -1){
				len ++;
				nw = adj[nw];
			}else break;
		}
	//	cout << i << " " << tp << " " << len << endl;
		for(int j = tp; j <= min(tp + len - M, N - 1); j ++)
			ada[j] = true;
	}

	if(!ada[0]) return -1;

	vector<int> pref(N);
	for(int i = 0; i < N; i ++){
		if(ada[i]) pref[i] = i;
		else if(i == 0) pref[i] = 0;
		else pref[i] = pref[i - 1];
	}

	int ans = 0; bool you = true;
	for(int cr = 0;;){
		ans ++;

		int nx = cr + M;
		if(nx == N) break;
		
		int id = pref[nx];
		if(id == cr){
			you = false; break;
		}
		cr = id;
	}

	if(!you) return -1;
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 8192 KB Output is correct
2 Correct 6 ms 8192 KB Output is correct
3 Correct 6 ms 8320 KB Output is correct
4 Correct 6 ms 8192 KB Output is correct
5 Correct 6 ms 8192 KB Output is correct
6 Correct 6 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 6 ms 8192 KB Output is correct
9 Correct 6 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 6 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 8 ms 8576 KB Output is correct
14 Correct 7 ms 8576 KB Output is correct
15 Correct 7 ms 8704 KB Output is correct
16 Correct 7 ms 8576 KB Output is correct
17 Correct 7 ms 8576 KB Output is correct
18 Correct 7 ms 8576 KB Output is correct
19 Correct 7 ms 8704 KB Output is correct
20 Correct 7 ms 8704 KB Output is correct
21 Correct 7 ms 8704 KB Output is correct
22 Correct 79 ms 18808 KB Output is correct
23 Correct 75 ms 18808 KB Output is correct
24 Correct 81 ms 18680 KB Output is correct
25 Correct 8 ms 8576 KB Output is correct
26 Correct 8 ms 8576 KB Output is correct
27 Correct 9 ms 8448 KB Output is correct
28 Correct 9 ms 8448 KB Output is correct
29 Correct 8 ms 8448 KB Output is correct
30 Correct 9 ms 8448 KB Output is correct
31 Correct 27 ms 11136 KB Output is correct
32 Correct 27 ms 11128 KB Output is correct
33 Correct 30 ms 11136 KB Output is correct
34 Correct 29 ms 11128 KB Output is correct
35 Correct 29 ms 11128 KB Output is correct
36 Correct 29 ms 11128 KB Output is correct
37 Correct 111 ms 19832 KB Output is correct
38 Correct 133 ms 19832 KB Output is correct
39 Correct 111 ms 19832 KB Output is correct
40 Correct 20 ms 9984 KB Output is correct
41 Correct 13 ms 9376 KB Output is correct
42 Correct 20 ms 10240 KB Output is correct
43 Correct 16 ms 9216 KB Output is correct
44 Correct 15 ms 9216 KB Output is correct
45 Correct 20 ms 9856 KB Output is correct
46 Correct 123 ms 24056 KB Output is correct
47 Correct 86 ms 17656 KB Output is correct
48 Correct 76 ms 20216 KB Output is correct
49 Correct 129 ms 24040 KB Output is correct
50 Correct 139 ms 24312 KB Output is correct
51 Correct 121 ms 21192 KB Output is correct
52 Correct 19 ms 10240 KB Output is correct
53 Correct 18 ms 10240 KB Output is correct
54 Correct 21 ms 10256 KB Output is correct
55 Correct 20 ms 9856 KB Output is correct
56 Correct 20 ms 9856 KB Output is correct
57 Correct 20 ms 9856 KB Output is correct
58 Correct 162 ms 25884 KB Output is correct
59 Correct 170 ms 25868 KB Output is correct
60 Correct 151 ms 25848 KB Output is correct
61 Correct 156 ms 25860 KB Output is correct
62 Correct 155 ms 25848 KB Output is correct
63 Correct 163 ms 25836 KB Output is correct
64 Correct 175 ms 28152 KB Output is correct
65 Correct 181 ms 28148 KB Output is correct
66 Correct 177 ms 28156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 8192 KB Output is correct
2 Correct 6 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 6 ms 8192 KB Output is correct
5 Correct 6 ms 8320 KB Output is correct
6 Correct 6 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 6 ms 8192 KB Output is correct
9 Correct 6 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 6 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 7 ms 8576 KB Output is correct
17 Correct 7 ms 8704 KB Output is correct
18 Correct 7 ms 8576 KB Output is correct
19 Correct 7 ms 8576 KB Output is correct
20 Correct 7 ms 8576 KB Output is correct
21 Correct 7 ms 8704 KB Output is correct
22 Correct 7 ms 8704 KB Output is correct
23 Correct 7 ms 8704 KB Output is correct
24 Correct 6 ms 8192 KB Output is correct
25 Correct 6 ms 8192 KB Output is correct
26 Correct 6 ms 8192 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 7 ms 8192 KB Output is correct
30 Correct 6 ms 8192 KB Output is correct
31 Correct 6 ms 8192 KB Output is correct
32 Correct 6 ms 8192 KB Output is correct
33 Correct 6 ms 8576 KB Output is correct
34 Correct 6 ms 8448 KB Output is correct
35 Correct 6 ms 8448 KB Output is correct
36 Correct 7 ms 8576 KB Output is correct
37 Correct 7 ms 8576 KB Output is correct
38 Correct 7 ms 8576 KB Output is correct
39 Correct 6 ms 8224 KB Output is correct
40 Correct 7 ms 8576 KB Output is correct
41 Correct 8 ms 8192 KB Output is correct
42 Correct 7 ms 8576 KB Output is correct
43 Correct 7 ms 8576 KB Output is correct
44 Correct 7 ms 8192 KB Output is correct
45 Correct 6 ms 8192 KB Output is correct
46 Correct 6 ms 8192 KB Output is correct
47 Correct 6 ms 8192 KB Output is correct
48 Correct 7 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 7 ms 8576 KB Output is correct
51 Correct 8 ms 8576 KB Output is correct
52 Correct 7 ms 8576 KB Output is correct
53 Correct 6 ms 8576 KB Output is correct
54 Correct 7 ms 8576 KB Output is correct
55 Correct 6 ms 8576 KB Output is correct
56 Correct 7 ms 8704 KB Output is correct
57 Correct 6 ms 8192 KB Output is correct
58 Correct 8 ms 8832 KB Output is correct
59 Correct 8 ms 8192 KB Output is correct
60 Correct 7 ms 8704 KB Output is correct
61 Correct 7 ms 8192 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 8192 KB Output is correct
2 Correct 6 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 6 ms 8192 KB Output is correct
5 Correct 6 ms 8320 KB Output is correct
6 Correct 6 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 6 ms 8192 KB Output is correct
9 Correct 6 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 6 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 7 ms 8576 KB Output is correct
17 Correct 7 ms 8704 KB Output is correct
18 Correct 7 ms 8576 KB Output is correct
19 Correct 7 ms 8576 KB Output is correct
20 Correct 7 ms 8576 KB Output is correct
21 Correct 7 ms 8704 KB Output is correct
22 Correct 7 ms 8704 KB Output is correct
23 Correct 7 ms 8704 KB Output is correct
24 Correct 79 ms 18808 KB Output is correct
25 Correct 75 ms 18808 KB Output is correct
26 Correct 81 ms 18680 KB Output is correct
27 Correct 6 ms 8192 KB Output is correct
28 Correct 6 ms 8192 KB Output is correct
29 Correct 6 ms 8192 KB Output is correct
30 Correct 6 ms 8192 KB Output is correct
31 Correct 6 ms 8192 KB Output is correct
32 Correct 7 ms 8192 KB Output is correct
33 Correct 6 ms 8192 KB Output is correct
34 Correct 6 ms 8192 KB Output is correct
35 Correct 6 ms 8192 KB Output is correct
36 Correct 6 ms 8576 KB Output is correct
37 Correct 6 ms 8448 KB Output is correct
38 Correct 6 ms 8448 KB Output is correct
39 Correct 7 ms 8576 KB Output is correct
40 Correct 7 ms 8576 KB Output is correct
41 Correct 7 ms 8576 KB Output is correct
42 Correct 6 ms 8224 KB Output is correct
43 Correct 7 ms 8576 KB Output is correct
44 Correct 8 ms 8192 KB Output is correct
45 Correct 7 ms 8576 KB Output is correct
46 Correct 7 ms 8576 KB Output is correct
47 Correct 7 ms 8192 KB Output is correct
48 Correct 6 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 6 ms 8192 KB Output is correct
51 Correct 7 ms 8192 KB Output is correct
52 Correct 6 ms 8192 KB Output is correct
53 Correct 7 ms 8576 KB Output is correct
54 Correct 8 ms 8576 KB Output is correct
55 Correct 7 ms 8576 KB Output is correct
56 Correct 6 ms 8576 KB Output is correct
57 Correct 7 ms 8576 KB Output is correct
58 Correct 6 ms 8576 KB Output is correct
59 Correct 7 ms 8704 KB Output is correct
60 Correct 6 ms 8192 KB Output is correct
61 Correct 8 ms 8832 KB Output is correct
62 Correct 8 ms 8192 KB Output is correct
63 Correct 7 ms 8704 KB Output is correct
64 Correct 7 ms 8192 KB Output is correct
65 Correct 6 ms 8320 KB Output is correct
66 Correct 7 ms 8192 KB Output is correct
67 Correct 7 ms 8448 KB Output is correct
68 Correct 7 ms 8320 KB Output is correct
69 Correct 7 ms 8448 KB Output is correct
70 Correct 11 ms 9236 KB Output is correct
71 Correct 13 ms 9128 KB Output is correct
72 Correct 12 ms 9088 KB Output is correct
73 Correct 9 ms 8832 KB Output is correct
74 Correct 12 ms 9088 KB Output is correct
75 Correct 12 ms 9088 KB Output is correct
76 Correct 88 ms 16632 KB Output is correct
77 Correct 55 ms 17784 KB Output is correct
78 Correct 103 ms 19176 KB Output is correct
79 Correct 8 ms 8576 KB Output is correct
80 Correct 9 ms 8576 KB Output is correct
81 Correct 8 ms 8576 KB Output is correct
82 Correct 12 ms 8576 KB Output is correct
83 Correct 8 ms 8704 KB Output is correct
84 Correct 14 ms 9472 KB Output is correct
85 Correct 13 ms 9472 KB Output is correct
86 Correct 13 ms 9472 KB Output is correct
87 Correct 13 ms 9472 KB Output is correct
88 Correct 13 ms 9472 KB Output is correct
89 Correct 16 ms 9472 KB Output is correct
90 Correct 134 ms 20088 KB Output is correct
91 Correct 131 ms 20088 KB Output is correct
92 Correct 122 ms 20136 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 8192 KB Output is correct
2 Correct 6 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 6 ms 8192 KB Output is correct
5 Correct 6 ms 8320 KB Output is correct
6 Correct 6 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 6 ms 8192 KB Output is correct
9 Correct 6 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 6 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 7 ms 8576 KB Output is correct
17 Correct 7 ms 8704 KB Output is correct
18 Correct 7 ms 8576 KB Output is correct
19 Correct 7 ms 8576 KB Output is correct
20 Correct 7 ms 8576 KB Output is correct
21 Correct 7 ms 8704 KB Output is correct
22 Correct 7 ms 8704 KB Output is correct
23 Correct 7 ms 8704 KB Output is correct
24 Correct 79 ms 18808 KB Output is correct
25 Correct 75 ms 18808 KB Output is correct
26 Correct 81 ms 18680 KB Output is correct
27 Correct 8 ms 8576 KB Output is correct
28 Correct 8 ms 8576 KB Output is correct
29 Correct 9 ms 8448 KB Output is correct
30 Correct 9 ms 8448 KB Output is correct
31 Correct 8 ms 8448 KB Output is correct
32 Correct 9 ms 8448 KB Output is correct
33 Correct 27 ms 11136 KB Output is correct
34 Correct 27 ms 11128 KB Output is correct
35 Correct 30 ms 11136 KB Output is correct
36 Correct 29 ms 11128 KB Output is correct
37 Correct 29 ms 11128 KB Output is correct
38 Correct 29 ms 11128 KB Output is correct
39 Correct 111 ms 19832 KB Output is correct
40 Correct 133 ms 19832 KB Output is correct
41 Correct 111 ms 19832 KB Output is correct
42 Correct 6 ms 8192 KB Output is correct
43 Correct 6 ms 8192 KB Output is correct
44 Correct 6 ms 8192 KB Output is correct
45 Correct 6 ms 8192 KB Output is correct
46 Correct 6 ms 8192 KB Output is correct
47 Correct 7 ms 8192 KB Output is correct
48 Correct 6 ms 8192 KB Output is correct
49 Correct 6 ms 8192 KB Output is correct
50 Correct 6 ms 8192 KB Output is correct
51 Correct 6 ms 8576 KB Output is correct
52 Correct 6 ms 8448 KB Output is correct
53 Correct 6 ms 8448 KB Output is correct
54 Correct 7 ms 8576 KB Output is correct
55 Correct 7 ms 8576 KB Output is correct
56 Correct 7 ms 8576 KB Output is correct
57 Correct 6 ms 8224 KB Output is correct
58 Correct 7 ms 8576 KB Output is correct
59 Correct 8 ms 8192 KB Output is correct
60 Correct 7 ms 8576 KB Output is correct
61 Correct 7 ms 8576 KB Output is correct
62 Correct 7 ms 8192 KB Output is correct
63 Correct 6 ms 8192 KB Output is correct
64 Correct 6 ms 8192 KB Output is correct
65 Correct 6 ms 8192 KB Output is correct
66 Correct 7 ms 8192 KB Output is correct
67 Correct 6 ms 8192 KB Output is correct
68 Correct 7 ms 8576 KB Output is correct
69 Correct 8 ms 8576 KB Output is correct
70 Correct 7 ms 8576 KB Output is correct
71 Correct 6 ms 8576 KB Output is correct
72 Correct 7 ms 8576 KB Output is correct
73 Correct 6 ms 8576 KB Output is correct
74 Correct 7 ms 8704 KB Output is correct
75 Correct 6 ms 8192 KB Output is correct
76 Correct 8 ms 8832 KB Output is correct
77 Correct 8 ms 8192 KB Output is correct
78 Correct 7 ms 8704 KB Output is correct
79 Correct 7 ms 8192 KB Output is correct
80 Correct 6 ms 8320 KB Output is correct
81 Correct 7 ms 8192 KB Output is correct
82 Correct 7 ms 8448 KB Output is correct
83 Correct 7 ms 8320 KB Output is correct
84 Correct 7 ms 8448 KB Output is correct
85 Correct 11 ms 9236 KB Output is correct
86 Correct 13 ms 9128 KB Output is correct
87 Correct 12 ms 9088 KB Output is correct
88 Correct 9 ms 8832 KB Output is correct
89 Correct 12 ms 9088 KB Output is correct
90 Correct 12 ms 9088 KB Output is correct
91 Correct 88 ms 16632 KB Output is correct
92 Correct 55 ms 17784 KB Output is correct
93 Correct 103 ms 19176 KB Output is correct
94 Correct 8 ms 8576 KB Output is correct
95 Correct 9 ms 8576 KB Output is correct
96 Correct 8 ms 8576 KB Output is correct
97 Correct 12 ms 8576 KB Output is correct
98 Correct 8 ms 8704 KB Output is correct
99 Correct 14 ms 9472 KB Output is correct
100 Correct 13 ms 9472 KB Output is correct
101 Correct 13 ms 9472 KB Output is correct
102 Correct 13 ms 9472 KB Output is correct
103 Correct 13 ms 9472 KB Output is correct
104 Correct 16 ms 9472 KB Output is correct
105 Correct 134 ms 20088 KB Output is correct
106 Correct 131 ms 20088 KB Output is correct
107 Correct 122 ms 20136 KB Output is correct
108 Correct 9 ms 8576 KB Output is correct
109 Correct 150 ms 44664 KB Output is correct
110 Correct 138 ms 28032 KB Output is correct
111 Correct 117 ms 23036 KB Output is correct
112 Correct 140 ms 25288 KB Output is correct
113 Correct 89 ms 19584 KB Output is correct
114 Correct 51 ms 12280 KB Output is correct
115 Correct 64 ms 12868 KB Output is correct
116 Correct 73 ms 13432 KB Output is correct
117 Correct 44 ms 12032 KB Output is correct
118 Correct 58 ms 12664 KB Output is correct
119 Correct 44 ms 11904 KB Output is correct
120 Correct 90 ms 16120 KB Output is correct
121 Correct 20 ms 9984 KB Output is correct
122 Correct 112 ms 17656 KB Output is correct
123 Correct 18 ms 9856 KB Output is correct
124 Correct 120 ms 19196 KB Output is correct
125 Correct 26 ms 10872 KB Output is correct
126 Correct 24 ms 10624 KB Output is correct
127 Correct 32 ms 11256 KB Output is correct
128 Correct 25 ms 10368 KB Output is correct
129 Correct 23 ms 10368 KB Output is correct
130 Correct 8 ms 8704 KB Output is correct
131 Correct 196 ms 59640 KB Output is correct
132 Correct 254 ms 44672 KB Output is correct
133 Correct 229 ms 38268 KB Output is correct
134 Correct 194 ms 34168 KB Output is correct
135 Correct 172 ms 31588 KB Output is correct
136 Correct 90 ms 14072 KB Output is correct
137 Correct 86 ms 14072 KB Output is correct
138 Correct 76 ms 14072 KB Output is correct
139 Correct 77 ms 14072 KB Output is correct
140 Correct 86 ms 14108 KB Output is correct
141 Correct 78 ms 14072 KB Output is correct
142 Correct 169 ms 21752 KB Output is correct
143 Correct 29 ms 11256 KB Output is correct
144 Correct 167 ms 21844 KB Output is correct
145 Correct 31 ms 11256 KB Output is correct
146 Correct 163 ms 21752 KB Output is correct
147 Correct 28 ms 11256 KB Output is correct
148 Correct 36 ms 11648 KB Output is correct
149 Correct 43 ms 11640 KB Output is correct
150 Correct 36 ms 11416 KB Output is correct
151 Correct 35 ms 11392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 8192 KB Output is correct
2 Correct 6 ms 8192 KB Output is correct
3 Correct 6 ms 8192 KB Output is correct
4 Correct 6 ms 8192 KB Output is correct
5 Correct 6 ms 8320 KB Output is correct
6 Correct 6 ms 8192 KB Output is correct
7 Correct 6 ms 8192 KB Output is correct
8 Correct 6 ms 8192 KB Output is correct
9 Correct 6 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 6 ms 8192 KB Output is correct
12 Correct 6 ms 8192 KB Output is correct
13 Correct 6 ms 8192 KB Output is correct
14 Correct 6 ms 8192 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 7 ms 8576 KB Output is correct
17 Correct 7 ms 8704 KB Output is correct
18 Correct 7 ms 8576 KB Output is correct
19 Correct 7 ms 8576 KB Output is correct
20 Correct 7 ms 8576 KB Output is correct
21 Correct 7 ms 8704 KB Output is correct
22 Correct 7 ms 8704 KB Output is correct
23 Correct 7 ms 8704 KB Output is correct
24 Correct 79 ms 18808 KB Output is correct
25 Correct 75 ms 18808 KB Output is correct
26 Correct 81 ms 18680 KB Output is correct
27 Correct 8 ms 8576 KB Output is correct
28 Correct 8 ms 8576 KB Output is correct
29 Correct 9 ms 8448 KB Output is correct
30 Correct 9 ms 8448 KB Output is correct
31 Correct 8 ms 8448 KB Output is correct
32 Correct 9 ms 8448 KB Output is correct
33 Correct 27 ms 11136 KB Output is correct
34 Correct 27 ms 11128 KB Output is correct
35 Correct 30 ms 11136 KB Output is correct
36 Correct 29 ms 11128 KB Output is correct
37 Correct 29 ms 11128 KB Output is correct
38 Correct 29 ms 11128 KB Output is correct
39 Correct 111 ms 19832 KB Output is correct
40 Correct 133 ms 19832 KB Output is correct
41 Correct 111 ms 19832 KB Output is correct
42 Correct 20 ms 9984 KB Output is correct
43 Correct 13 ms 9376 KB Output is correct
44 Correct 20 ms 10240 KB Output is correct
45 Correct 16 ms 9216 KB Output is correct
46 Correct 15 ms 9216 KB Output is correct
47 Correct 20 ms 9856 KB Output is correct
48 Correct 123 ms 24056 KB Output is correct
49 Correct 86 ms 17656 KB Output is correct
50 Correct 76 ms 20216 KB Output is correct
51 Correct 129 ms 24040 KB Output is correct
52 Correct 139 ms 24312 KB Output is correct
53 Correct 121 ms 21192 KB Output is correct
54 Correct 19 ms 10240 KB Output is correct
55 Correct 18 ms 10240 KB Output is correct
56 Correct 21 ms 10256 KB Output is correct
57 Correct 20 ms 9856 KB Output is correct
58 Correct 20 ms 9856 KB Output is correct
59 Correct 20 ms 9856 KB Output is correct
60 Correct 162 ms 25884 KB Output is correct
61 Correct 170 ms 25868 KB Output is correct
62 Correct 151 ms 25848 KB Output is correct
63 Correct 156 ms 25860 KB Output is correct
64 Correct 155 ms 25848 KB Output is correct
65 Correct 163 ms 25836 KB Output is correct
66 Correct 175 ms 28152 KB Output is correct
67 Correct 181 ms 28148 KB Output is correct
68 Correct 177 ms 28156 KB Output is correct
69 Correct 6 ms 8192 KB Output is correct
70 Correct 6 ms 8192 KB Output is correct
71 Correct 6 ms 8192 KB Output is correct
72 Correct 6 ms 8192 KB Output is correct
73 Correct 6 ms 8192 KB Output is correct
74 Correct 7 ms 8192 KB Output is correct
75 Correct 6 ms 8192 KB Output is correct
76 Correct 6 ms 8192 KB Output is correct
77 Correct 6 ms 8192 KB Output is correct
78 Correct 6 ms 8576 KB Output is correct
79 Correct 6 ms 8448 KB Output is correct
80 Correct 6 ms 8448 KB Output is correct
81 Correct 7 ms 8576 KB Output is correct
82 Correct 7 ms 8576 KB Output is correct
83 Correct 7 ms 8576 KB Output is correct
84 Correct 6 ms 8224 KB Output is correct
85 Correct 7 ms 8576 KB Output is correct
86 Correct 8 ms 8192 KB Output is correct
87 Correct 7 ms 8576 KB Output is correct
88 Correct 7 ms 8576 KB Output is correct
89 Correct 7 ms 8192 KB Output is correct
90 Correct 6 ms 8192 KB Output is correct
91 Correct 6 ms 8192 KB Output is correct
92 Correct 6 ms 8192 KB Output is correct
93 Correct 7 ms 8192 KB Output is correct
94 Correct 6 ms 8192 KB Output is correct
95 Correct 7 ms 8576 KB Output is correct
96 Correct 8 ms 8576 KB Output is correct
97 Correct 7 ms 8576 KB Output is correct
98 Correct 6 ms 8576 KB Output is correct
99 Correct 7 ms 8576 KB Output is correct
100 Correct 6 ms 8576 KB Output is correct
101 Correct 7 ms 8704 KB Output is correct
102 Correct 6 ms 8192 KB Output is correct
103 Correct 8 ms 8832 KB Output is correct
104 Correct 8 ms 8192 KB Output is correct
105 Correct 7 ms 8704 KB Output is correct
106 Correct 7 ms 8192 KB Output is correct
107 Correct 6 ms 8320 KB Output is correct
108 Correct 7 ms 8192 KB Output is correct
109 Correct 7 ms 8448 KB Output is correct
110 Correct 7 ms 8320 KB Output is correct
111 Correct 7 ms 8448 KB Output is correct
112 Correct 11 ms 9236 KB Output is correct
113 Correct 13 ms 9128 KB Output is correct
114 Correct 12 ms 9088 KB Output is correct
115 Correct 9 ms 8832 KB Output is correct
116 Correct 12 ms 9088 KB Output is correct
117 Correct 12 ms 9088 KB Output is correct
118 Correct 88 ms 16632 KB Output is correct
119 Correct 55 ms 17784 KB Output is correct
120 Correct 103 ms 19176 KB Output is correct
121 Correct 8 ms 8576 KB Output is correct
122 Correct 9 ms 8576 KB Output is correct
123 Correct 8 ms 8576 KB Output is correct
124 Correct 12 ms 8576 KB Output is correct
125 Correct 8 ms 8704 KB Output is correct
126 Correct 14 ms 9472 KB Output is correct
127 Correct 13 ms 9472 KB Output is correct
128 Correct 13 ms 9472 KB Output is correct
129 Correct 13 ms 9472 KB Output is correct
130 Correct 13 ms 9472 KB Output is correct
131 Correct 16 ms 9472 KB Output is correct
132 Correct 134 ms 20088 KB Output is correct
133 Correct 131 ms 20088 KB Output is correct
134 Correct 122 ms 20136 KB Output is correct
135 Correct 9 ms 8576 KB Output is correct
136 Correct 150 ms 44664 KB Output is correct
137 Correct 138 ms 28032 KB Output is correct
138 Correct 117 ms 23036 KB Output is correct
139 Correct 140 ms 25288 KB Output is correct
140 Correct 89 ms 19584 KB Output is correct
141 Correct 51 ms 12280 KB Output is correct
142 Correct 64 ms 12868 KB Output is correct
143 Correct 73 ms 13432 KB Output is correct
144 Correct 44 ms 12032 KB Output is correct
145 Correct 58 ms 12664 KB Output is correct
146 Correct 44 ms 11904 KB Output is correct
147 Correct 90 ms 16120 KB Output is correct
148 Correct 20 ms 9984 KB Output is correct
149 Correct 112 ms 17656 KB Output is correct
150 Correct 18 ms 9856 KB Output is correct
151 Correct 120 ms 19196 KB Output is correct
152 Correct 26 ms 10872 KB Output is correct
153 Correct 24 ms 10624 KB Output is correct
154 Correct 32 ms 11256 KB Output is correct
155 Correct 25 ms 10368 KB Output is correct
156 Correct 23 ms 10368 KB Output is correct
157 Correct 8 ms 8704 KB Output is correct
158 Correct 196 ms 59640 KB Output is correct
159 Correct 254 ms 44672 KB Output is correct
160 Correct 229 ms 38268 KB Output is correct
161 Correct 194 ms 34168 KB Output is correct
162 Correct 172 ms 31588 KB Output is correct
163 Correct 90 ms 14072 KB Output is correct
164 Correct 86 ms 14072 KB Output is correct
165 Correct 76 ms 14072 KB Output is correct
166 Correct 77 ms 14072 KB Output is correct
167 Correct 86 ms 14108 KB Output is correct
168 Correct 78 ms 14072 KB Output is correct
169 Correct 169 ms 21752 KB Output is correct
170 Correct 29 ms 11256 KB Output is correct
171 Correct 167 ms 21844 KB Output is correct
172 Correct 31 ms 11256 KB Output is correct
173 Correct 163 ms 21752 KB Output is correct
174 Correct 28 ms 11256 KB Output is correct
175 Correct 36 ms 11648 KB Output is correct
176 Correct 43 ms 11640 KB Output is correct
177 Correct 36 ms 11416 KB Output is correct
178 Correct 35 ms 11392 KB Output is correct
179 Correct 15 ms 9728 KB Output is correct
180 Correct 392 ms 111196 KB Output is correct
181 Correct 757 ms 123428 KB Output is correct
182 Correct 1055 ms 151800 KB Output is correct
183 Correct 496 ms 80572 KB Output is correct
184 Correct 399 ms 67448 KB Output is correct
185 Correct 92 ms 17400 KB Output is correct
186 Correct 84 ms 18132 KB Output is correct
187 Correct 119 ms 19064 KB Output is correct
188 Correct 157 ms 23020 KB Output is correct
189 Correct 144 ms 21368 KB Output is correct
190 Correct 185 ms 26360 KB Output is correct
191 Correct 129 ms 21112 KB Output is correct
192 Correct 121 ms 20088 KB Output is correct
193 Correct 102 ms 17912 KB Output is correct
194 Correct 21 ms 10624 KB Output is correct
195 Correct 945 ms 265092 KB Output is correct
196 Correct 1186 ms 189772 KB Output is correct
197 Correct 1104 ms 157048 KB Output is correct
198 Correct 875 ms 137292 KB Output is correct
199 Correct 757 ms 123756 KB Output is correct
200 Correct 225 ms 29304 KB Output is correct
201 Correct 189 ms 29304 KB Output is correct
202 Correct 194 ms 29304 KB Output is correct
203 Correct 191 ms 29348 KB Output is correct
204 Correct 197 ms 29344 KB Output is correct
205 Correct 194 ms 29304 KB Output is correct
206 Correct 229 ms 32760 KB Output is correct
207 Correct 169 ms 28024 KB Output is correct
208 Correct 266 ms 32760 KB Output is correct
209 Correct 195 ms 28024 KB Output is correct
210 Correct 240 ms 32760 KB Output is correct
211 Correct 183 ms 28024 KB Output is correct
212 Correct 166 ms 27640 KB Output is correct
213 Correct 166 ms 24572 KB Output is correct
214 Correct 164 ms 24312 KB Output is correct
215 Correct 170 ms 24440 KB Output is correct