답안 #650671

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
650671 2022-10-14T15:32:41 Z ymm 벽 칠하기 (APIO20_paint) C++17
100 / 100
398 ms 31660 KB
#include "paint.h"
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;

const int N = 100010;
vector<int> col2con[N];
set<int> con2col[N];
int res[N];
int lst_nonmatch[N];
int interval_match[N];
int cnt_seg, cnt_con, cnt_col;

int find_nonmatch(int seg, int con)
{
	int mod = (con - seg) % cnt_con;
	mod = mod < 0? mod + cnt_con: mod;
	if (lst_nonmatch[mod] >= seg)
		return lst_nonmatch[mod];
	Loop (i,seg,cnt_seg) {
		if (!con2col[(con+i-seg)%cnt_con].count(res[i])) {
			lst_nonmatch[mod] = i;
			return i;
		}
	}
	lst_nonmatch[mod] = cnt_seg;
	return cnt_seg;
}

int minimumInstructions(int cnt_seg, int cnt_con, int cnt_col,
                        vector<int> res, vector<int> cnt_like,
                        vector<vector<int>> likes) {
	::cnt_seg = cnt_seg;
	::cnt_con = cnt_con;
	::cnt_col = cnt_col;
	Loop (i,0,cnt_seg)
		::res[i] = res[i];
	Loop (i,0,cnt_con) {
		Loop (j,0,cnt_like[i]) {
			col2con[likes[i][j]].push_back(i);
			con2col[i].insert(likes[i][j]);
		}
	}
	memset(lst_nonmatch, -1, sizeof(lst_nonmatch));
	int lst_cover = 0;
	Loop (seg,0,cnt_seg-cnt_con+1) {
		for (int con : col2con[res[seg]]) {
			if (find_nonmatch(seg, con) >= seg + cnt_con) {
				lst_cover = seg + cnt_con;
				interval_match[seg] = 1;
				break;
			}
		}
		if (seg == lst_cover)
			return -1;
	}
	if (!interval_match[cnt_seg-cnt_con])
		return -1;
	set<int> bag;
	lst_cover = 0;
	int ans = 0;
	Loop (i,0,cnt_seg-cnt_con+1) {
		if (interval_match[i])
			bag.insert(i + cnt_con);
		if (i == lst_cover) {
			++ans;
			lst_cover = *bag.rbegin();
		}
		assert(i < lst_cover);
	}
	if (lst_cover < cnt_seg) {
		lst_cover = *bag.rbegin();
		++ans;
	}
	assert(lst_cover == cnt_seg);
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7636 KB Output is correct
2 Correct 5 ms 7732 KB Output is correct
3 Correct 5 ms 7732 KB Output is correct
4 Correct 5 ms 7636 KB Output is correct
5 Correct 4 ms 7736 KB Output is correct
6 Correct 5 ms 7636 KB Output is correct
7 Correct 6 ms 7664 KB Output is correct
8 Correct 5 ms 7764 KB Output is correct
9 Correct 4 ms 7764 KB Output is correct
10 Correct 4 ms 7636 KB Output is correct
11 Correct 5 ms 7636 KB Output is correct
12 Correct 4 ms 7736 KB Output is correct
13 Correct 6 ms 7784 KB Output is correct
14 Correct 5 ms 7740 KB Output is correct
15 Correct 5 ms 7764 KB Output is correct
16 Correct 5 ms 7764 KB Output is correct
17 Correct 5 ms 7764 KB Output is correct
18 Correct 5 ms 7764 KB Output is correct
19 Correct 5 ms 7764 KB Output is correct
20 Correct 5 ms 7764 KB Output is correct
21 Correct 5 ms 7748 KB Output is correct
22 Correct 35 ms 16824 KB Output is correct
23 Correct 35 ms 16944 KB Output is correct
24 Correct 43 ms 16844 KB Output is correct
25 Correct 10 ms 8916 KB Output is correct
26 Correct 10 ms 9028 KB Output is correct
27 Correct 6 ms 8004 KB Output is correct
28 Correct 6 ms 7984 KB Output is correct
29 Correct 6 ms 8000 KB Output is correct
30 Correct 8 ms 7892 KB Output is correct
31 Correct 24 ms 10908 KB Output is correct
32 Correct 17 ms 10956 KB Output is correct
33 Correct 17 ms 10996 KB Output is correct
34 Correct 17 ms 10864 KB Output is correct
35 Correct 17 ms 10944 KB Output is correct
36 Correct 18 ms 10864 KB Output is correct
37 Correct 39 ms 17360 KB Output is correct
38 Correct 38 ms 17392 KB Output is correct
39 Correct 37 ms 17344 KB Output is correct
40 Correct 31 ms 13468 KB Output is correct
41 Correct 21 ms 11336 KB Output is correct
42 Correct 13 ms 9044 KB Output is correct
43 Correct 9 ms 8532 KB Output is correct
44 Correct 10 ms 8476 KB Output is correct
45 Correct 12 ms 9044 KB Output is correct
46 Correct 66 ms 24136 KB Output is correct
47 Correct 47 ms 17848 KB Output is correct
48 Correct 44 ms 19332 KB Output is correct
49 Correct 45 ms 20428 KB Output is correct
50 Correct 46 ms 20268 KB Output is correct
51 Correct 37 ms 17228 KB Output is correct
52 Correct 35 ms 14084 KB Output is correct
53 Correct 34 ms 14112 KB Output is correct
54 Correct 13 ms 9020 KB Output is correct
55 Correct 14 ms 9044 KB Output is correct
56 Correct 15 ms 9096 KB Output is correct
57 Correct 14 ms 9044 KB Output is correct
58 Correct 77 ms 26368 KB Output is correct
59 Correct 74 ms 26364 KB Output is correct
60 Correct 63 ms 26300 KB Output is correct
61 Correct 69 ms 26320 KB Output is correct
62 Correct 67 ms 26292 KB Output is correct
63 Correct 64 ms 26288 KB Output is correct
64 Correct 66 ms 22988 KB Output is correct
65 Correct 63 ms 22996 KB Output is correct
66 Correct 56 ms 22972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7636 KB Output is correct
2 Correct 5 ms 7732 KB Output is correct
3 Correct 5 ms 7732 KB Output is correct
4 Correct 5 ms 7636 KB Output is correct
5 Correct 4 ms 7736 KB Output is correct
6 Correct 5 ms 7636 KB Output is correct
7 Correct 6 ms 7664 KB Output is correct
8 Correct 5 ms 7764 KB Output is correct
9 Correct 4 ms 7764 KB Output is correct
10 Correct 4 ms 7636 KB Output is correct
11 Correct 5 ms 7636 KB Output is correct
12 Correct 4 ms 7736 KB Output is correct
13 Correct 6 ms 7784 KB Output is correct
14 Correct 5 ms 7740 KB Output is correct
15 Correct 5 ms 7764 KB Output is correct
16 Correct 5 ms 7764 KB Output is correct
17 Correct 5 ms 7764 KB Output is correct
18 Correct 5 ms 7764 KB Output is correct
19 Correct 5 ms 7764 KB Output is correct
20 Correct 5 ms 7764 KB Output is correct
21 Correct 5 ms 7748 KB Output is correct
22 Correct 4 ms 7636 KB Output is correct
23 Correct 5 ms 7732 KB Output is correct
24 Correct 4 ms 7636 KB Output is correct
25 Correct 4 ms 7636 KB Output is correct
26 Correct 4 ms 7636 KB Output is correct
27 Correct 4 ms 7636 KB Output is correct
28 Correct 5 ms 7764 KB Output is correct
29 Correct 5 ms 7732 KB Output is correct
30 Correct 4 ms 7692 KB Output is correct
31 Correct 5 ms 7764 KB Output is correct
32 Correct 5 ms 7736 KB Output is correct
33 Correct 5 ms 7764 KB Output is correct
34 Correct 5 ms 7764 KB Output is correct
35 Correct 5 ms 7764 KB Output is correct
36 Correct 5 ms 7740 KB Output is correct
37 Correct 5 ms 7740 KB Output is correct
38 Correct 4 ms 7736 KB Output is correct
39 Correct 5 ms 7680 KB Output is correct
40 Correct 5 ms 7764 KB Output is correct
41 Correct 4 ms 7736 KB Output is correct
42 Correct 4 ms 7728 KB Output is correct
43 Correct 5 ms 7740 KB Output is correct
44 Correct 6 ms 7740 KB Output is correct
45 Correct 5 ms 7732 KB Output is correct
46 Correct 6 ms 7764 KB Output is correct
47 Correct 5 ms 7764 KB Output is correct
48 Correct 5 ms 7736 KB Output is correct
49 Correct 5 ms 7736 KB Output is correct
50 Correct 5 ms 7764 KB Output is correct
51 Correct 5 ms 7764 KB Output is correct
52 Correct 5 ms 7764 KB Output is correct
53 Correct 5 ms 7736 KB Output is correct
54 Correct 5 ms 7764 KB Output is correct
55 Correct 5 ms 7740 KB Output is correct
56 Correct 5 ms 7764 KB Output is correct
57 Correct 5 ms 7764 KB Output is correct
58 Correct 4 ms 7764 KB Output is correct
59 Correct 4 ms 7764 KB Output is correct
60 Correct 5 ms 7764 KB Output is correct
61 Correct 4 ms 7764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7636 KB Output is correct
2 Correct 5 ms 7732 KB Output is correct
3 Correct 4 ms 7636 KB Output is correct
4 Correct 5 ms 7732 KB Output is correct
5 Correct 5 ms 7732 KB Output is correct
6 Correct 5 ms 7636 KB Output is correct
7 Correct 4 ms 7736 KB Output is correct
8 Correct 5 ms 7636 KB Output is correct
9 Correct 6 ms 7664 KB Output is correct
10 Correct 5 ms 7764 KB Output is correct
11 Correct 4 ms 7764 KB Output is correct
12 Correct 4 ms 7636 KB Output is correct
13 Correct 5 ms 7636 KB Output is correct
14 Correct 4 ms 7736 KB Output is correct
15 Correct 6 ms 7784 KB Output is correct
16 Correct 5 ms 7740 KB Output is correct
17 Correct 5 ms 7764 KB Output is correct
18 Correct 5 ms 7764 KB Output is correct
19 Correct 5 ms 7764 KB Output is correct
20 Correct 5 ms 7764 KB Output is correct
21 Correct 5 ms 7764 KB Output is correct
22 Correct 5 ms 7764 KB Output is correct
23 Correct 5 ms 7748 KB Output is correct
24 Correct 35 ms 16824 KB Output is correct
25 Correct 35 ms 16944 KB Output is correct
26 Correct 43 ms 16844 KB Output is correct
27 Correct 4 ms 7636 KB Output is correct
28 Correct 4 ms 7636 KB Output is correct
29 Correct 4 ms 7636 KB Output is correct
30 Correct 4 ms 7636 KB Output is correct
31 Correct 5 ms 7764 KB Output is correct
32 Correct 5 ms 7732 KB Output is correct
33 Correct 4 ms 7692 KB Output is correct
34 Correct 5 ms 7764 KB Output is correct
35 Correct 5 ms 7736 KB Output is correct
36 Correct 5 ms 7764 KB Output is correct
37 Correct 5 ms 7764 KB Output is correct
38 Correct 5 ms 7764 KB Output is correct
39 Correct 5 ms 7740 KB Output is correct
40 Correct 5 ms 7740 KB Output is correct
41 Correct 4 ms 7736 KB Output is correct
42 Correct 5 ms 7680 KB Output is correct
43 Correct 5 ms 7764 KB Output is correct
44 Correct 4 ms 7736 KB Output is correct
45 Correct 4 ms 7728 KB Output is correct
46 Correct 5 ms 7740 KB Output is correct
47 Correct 6 ms 7740 KB Output is correct
48 Correct 5 ms 7732 KB Output is correct
49 Correct 6 ms 7764 KB Output is correct
50 Correct 5 ms 7764 KB Output is correct
51 Correct 5 ms 7736 KB Output is correct
52 Correct 5 ms 7736 KB Output is correct
53 Correct 5 ms 7764 KB Output is correct
54 Correct 5 ms 7764 KB Output is correct
55 Correct 5 ms 7764 KB Output is correct
56 Correct 5 ms 7736 KB Output is correct
57 Correct 5 ms 7764 KB Output is correct
58 Correct 5 ms 7740 KB Output is correct
59 Correct 5 ms 7764 KB Output is correct
60 Correct 5 ms 7764 KB Output is correct
61 Correct 4 ms 7764 KB Output is correct
62 Correct 4 ms 7764 KB Output is correct
63 Correct 5 ms 7764 KB Output is correct
64 Correct 4 ms 7764 KB Output is correct
65 Correct 5 ms 7764 KB Output is correct
66 Correct 5 ms 7764 KB Output is correct
67 Correct 5 ms 7764 KB Output is correct
68 Correct 5 ms 7764 KB Output is correct
69 Correct 5 ms 7764 KB Output is correct
70 Correct 8 ms 8404 KB Output is correct
71 Correct 8 ms 8568 KB Output is correct
72 Correct 9 ms 8404 KB Output is correct
73 Correct 7 ms 8164 KB Output is correct
74 Correct 8 ms 8396 KB Output is correct
75 Correct 7 ms 8276 KB Output is correct
76 Correct 43 ms 16284 KB Output is correct
77 Correct 44 ms 17192 KB Output is correct
78 Correct 53 ms 18796 KB Output is correct
79 Correct 5 ms 7764 KB Output is correct
80 Correct 5 ms 7764 KB Output is correct
81 Correct 5 ms 7736 KB Output is correct
82 Correct 5 ms 7764 KB Output is correct
83 Correct 7 ms 7764 KB Output is correct
84 Correct 9 ms 8644 KB Output is correct
85 Correct 8 ms 8660 KB Output is correct
86 Correct 8 ms 8644 KB Output is correct
87 Correct 8 ms 8648 KB Output is correct
88 Correct 8 ms 8660 KB Output is correct
89 Correct 8 ms 8660 KB Output is correct
90 Correct 53 ms 19684 KB Output is correct
91 Correct 58 ms 19572 KB Output is correct
92 Correct 53 ms 19712 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7636 KB Output is correct
2 Correct 5 ms 7732 KB Output is correct
3 Correct 4 ms 7636 KB Output is correct
4 Correct 5 ms 7732 KB Output is correct
5 Correct 5 ms 7732 KB Output is correct
6 Correct 5 ms 7636 KB Output is correct
7 Correct 4 ms 7736 KB Output is correct
8 Correct 5 ms 7636 KB Output is correct
9 Correct 6 ms 7664 KB Output is correct
10 Correct 5 ms 7764 KB Output is correct
11 Correct 4 ms 7764 KB Output is correct
12 Correct 4 ms 7636 KB Output is correct
13 Correct 5 ms 7636 KB Output is correct
14 Correct 4 ms 7736 KB Output is correct
15 Correct 6 ms 7784 KB Output is correct
16 Correct 5 ms 7740 KB Output is correct
17 Correct 5 ms 7764 KB Output is correct
18 Correct 5 ms 7764 KB Output is correct
19 Correct 5 ms 7764 KB Output is correct
20 Correct 5 ms 7764 KB Output is correct
21 Correct 5 ms 7764 KB Output is correct
22 Correct 5 ms 7764 KB Output is correct
23 Correct 5 ms 7748 KB Output is correct
24 Correct 35 ms 16824 KB Output is correct
25 Correct 35 ms 16944 KB Output is correct
26 Correct 43 ms 16844 KB Output is correct
27 Correct 10 ms 8916 KB Output is correct
28 Correct 10 ms 9028 KB Output is correct
29 Correct 6 ms 8004 KB Output is correct
30 Correct 6 ms 7984 KB Output is correct
31 Correct 6 ms 8000 KB Output is correct
32 Correct 8 ms 7892 KB Output is correct
33 Correct 24 ms 10908 KB Output is correct
34 Correct 17 ms 10956 KB Output is correct
35 Correct 17 ms 10996 KB Output is correct
36 Correct 17 ms 10864 KB Output is correct
37 Correct 17 ms 10944 KB Output is correct
38 Correct 18 ms 10864 KB Output is correct
39 Correct 39 ms 17360 KB Output is correct
40 Correct 38 ms 17392 KB Output is correct
41 Correct 37 ms 17344 KB Output is correct
42 Correct 4 ms 7636 KB Output is correct
43 Correct 4 ms 7636 KB Output is correct
44 Correct 4 ms 7636 KB Output is correct
45 Correct 4 ms 7636 KB Output is correct
46 Correct 5 ms 7764 KB Output is correct
47 Correct 5 ms 7732 KB Output is correct
48 Correct 4 ms 7692 KB Output is correct
49 Correct 5 ms 7764 KB Output is correct
50 Correct 5 ms 7736 KB Output is correct
51 Correct 5 ms 7764 KB Output is correct
52 Correct 5 ms 7764 KB Output is correct
53 Correct 5 ms 7764 KB Output is correct
54 Correct 5 ms 7740 KB Output is correct
55 Correct 5 ms 7740 KB Output is correct
56 Correct 4 ms 7736 KB Output is correct
57 Correct 5 ms 7680 KB Output is correct
58 Correct 5 ms 7764 KB Output is correct
59 Correct 4 ms 7736 KB Output is correct
60 Correct 4 ms 7728 KB Output is correct
61 Correct 5 ms 7740 KB Output is correct
62 Correct 6 ms 7740 KB Output is correct
63 Correct 5 ms 7732 KB Output is correct
64 Correct 6 ms 7764 KB Output is correct
65 Correct 5 ms 7764 KB Output is correct
66 Correct 5 ms 7736 KB Output is correct
67 Correct 5 ms 7736 KB Output is correct
68 Correct 5 ms 7764 KB Output is correct
69 Correct 5 ms 7764 KB Output is correct
70 Correct 5 ms 7764 KB Output is correct
71 Correct 5 ms 7736 KB Output is correct
72 Correct 5 ms 7764 KB Output is correct
73 Correct 5 ms 7740 KB Output is correct
74 Correct 5 ms 7764 KB Output is correct
75 Correct 5 ms 7764 KB Output is correct
76 Correct 4 ms 7764 KB Output is correct
77 Correct 4 ms 7764 KB Output is correct
78 Correct 5 ms 7764 KB Output is correct
79 Correct 4 ms 7764 KB Output is correct
80 Correct 5 ms 7764 KB Output is correct
81 Correct 5 ms 7764 KB Output is correct
82 Correct 5 ms 7764 KB Output is correct
83 Correct 5 ms 7764 KB Output is correct
84 Correct 5 ms 7764 KB Output is correct
85 Correct 8 ms 8404 KB Output is correct
86 Correct 8 ms 8568 KB Output is correct
87 Correct 9 ms 8404 KB Output is correct
88 Correct 7 ms 8164 KB Output is correct
89 Correct 8 ms 8396 KB Output is correct
90 Correct 7 ms 8276 KB Output is correct
91 Correct 43 ms 16284 KB Output is correct
92 Correct 44 ms 17192 KB Output is correct
93 Correct 53 ms 18796 KB Output is correct
94 Correct 5 ms 7764 KB Output is correct
95 Correct 5 ms 7764 KB Output is correct
96 Correct 5 ms 7736 KB Output is correct
97 Correct 5 ms 7764 KB Output is correct
98 Correct 7 ms 7764 KB Output is correct
99 Correct 9 ms 8644 KB Output is correct
100 Correct 8 ms 8660 KB Output is correct
101 Correct 8 ms 8644 KB Output is correct
102 Correct 8 ms 8648 KB Output is correct
103 Correct 8 ms 8660 KB Output is correct
104 Correct 8 ms 8660 KB Output is correct
105 Correct 53 ms 19684 KB Output is correct
106 Correct 58 ms 19572 KB Output is correct
107 Correct 53 ms 19712 KB Output is correct
108 Correct 10 ms 8916 KB Output is correct
109 Correct 55 ms 8680 KB Output is correct
110 Correct 5 ms 8020 KB Output is correct
111 Correct 6 ms 7928 KB Output is correct
112 Correct 7 ms 7992 KB Output is correct
113 Correct 6 ms 8020 KB Output is correct
114 Correct 26 ms 12620 KB Output is correct
115 Correct 40 ms 12724 KB Output is correct
116 Correct 39 ms 13924 KB Output is correct
117 Correct 28 ms 12516 KB Output is correct
118 Correct 35 ms 13260 KB Output is correct
119 Correct 23 ms 11760 KB Output is correct
120 Correct 35 ms 15052 KB Output is correct
121 Correct 11 ms 9408 KB Output is correct
122 Correct 46 ms 16664 KB Output is correct
123 Correct 13 ms 9428 KB Output is correct
124 Correct 43 ms 17612 KB Output is correct
125 Correct 18 ms 10472 KB Output is correct
126 Correct 16 ms 9940 KB Output is correct
127 Correct 17 ms 10452 KB Output is correct
128 Correct 13 ms 9668 KB Output is correct
129 Correct 14 ms 9788 KB Output is correct
130 Correct 9 ms 9032 KB Output is correct
131 Correct 77 ms 9004 KB Output is correct
132 Correct 6 ms 8148 KB Output is correct
133 Correct 6 ms 8148 KB Output is correct
134 Correct 7 ms 8148 KB Output is correct
135 Correct 7 ms 8148 KB Output is correct
136 Correct 38 ms 14540 KB Output is correct
137 Correct 37 ms 14540 KB Output is correct
138 Correct 36 ms 14636 KB Output is correct
139 Correct 36 ms 14636 KB Output is correct
140 Correct 36 ms 14524 KB Output is correct
141 Correct 39 ms 14512 KB Output is correct
142 Correct 58 ms 20104 KB Output is correct
143 Correct 17 ms 10688 KB Output is correct
144 Correct 60 ms 20180 KB Output is correct
145 Correct 16 ms 10656 KB Output is correct
146 Correct 66 ms 20200 KB Output is correct
147 Correct 18 ms 10644 KB Output is correct
148 Correct 17 ms 10700 KB Output is correct
149 Correct 18 ms 10728 KB Output is correct
150 Correct 19 ms 10700 KB Output is correct
151 Correct 18 ms 10488 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 7636 KB Output is correct
2 Correct 5 ms 7732 KB Output is correct
3 Correct 4 ms 7636 KB Output is correct
4 Correct 5 ms 7732 KB Output is correct
5 Correct 5 ms 7732 KB Output is correct
6 Correct 5 ms 7636 KB Output is correct
7 Correct 4 ms 7736 KB Output is correct
8 Correct 5 ms 7636 KB Output is correct
9 Correct 6 ms 7664 KB Output is correct
10 Correct 5 ms 7764 KB Output is correct
11 Correct 4 ms 7764 KB Output is correct
12 Correct 4 ms 7636 KB Output is correct
13 Correct 5 ms 7636 KB Output is correct
14 Correct 4 ms 7736 KB Output is correct
15 Correct 6 ms 7784 KB Output is correct
16 Correct 5 ms 7740 KB Output is correct
17 Correct 5 ms 7764 KB Output is correct
18 Correct 5 ms 7764 KB Output is correct
19 Correct 5 ms 7764 KB Output is correct
20 Correct 5 ms 7764 KB Output is correct
21 Correct 5 ms 7764 KB Output is correct
22 Correct 5 ms 7764 KB Output is correct
23 Correct 5 ms 7748 KB Output is correct
24 Correct 35 ms 16824 KB Output is correct
25 Correct 35 ms 16944 KB Output is correct
26 Correct 43 ms 16844 KB Output is correct
27 Correct 10 ms 8916 KB Output is correct
28 Correct 10 ms 9028 KB Output is correct
29 Correct 6 ms 8004 KB Output is correct
30 Correct 6 ms 7984 KB Output is correct
31 Correct 6 ms 8000 KB Output is correct
32 Correct 8 ms 7892 KB Output is correct
33 Correct 24 ms 10908 KB Output is correct
34 Correct 17 ms 10956 KB Output is correct
35 Correct 17 ms 10996 KB Output is correct
36 Correct 17 ms 10864 KB Output is correct
37 Correct 17 ms 10944 KB Output is correct
38 Correct 18 ms 10864 KB Output is correct
39 Correct 39 ms 17360 KB Output is correct
40 Correct 38 ms 17392 KB Output is correct
41 Correct 37 ms 17344 KB Output is correct
42 Correct 31 ms 13468 KB Output is correct
43 Correct 21 ms 11336 KB Output is correct
44 Correct 13 ms 9044 KB Output is correct
45 Correct 9 ms 8532 KB Output is correct
46 Correct 10 ms 8476 KB Output is correct
47 Correct 12 ms 9044 KB Output is correct
48 Correct 66 ms 24136 KB Output is correct
49 Correct 47 ms 17848 KB Output is correct
50 Correct 44 ms 19332 KB Output is correct
51 Correct 45 ms 20428 KB Output is correct
52 Correct 46 ms 20268 KB Output is correct
53 Correct 37 ms 17228 KB Output is correct
54 Correct 35 ms 14084 KB Output is correct
55 Correct 34 ms 14112 KB Output is correct
56 Correct 13 ms 9020 KB Output is correct
57 Correct 14 ms 9044 KB Output is correct
58 Correct 15 ms 9096 KB Output is correct
59 Correct 14 ms 9044 KB Output is correct
60 Correct 77 ms 26368 KB Output is correct
61 Correct 74 ms 26364 KB Output is correct
62 Correct 63 ms 26300 KB Output is correct
63 Correct 69 ms 26320 KB Output is correct
64 Correct 67 ms 26292 KB Output is correct
65 Correct 64 ms 26288 KB Output is correct
66 Correct 66 ms 22988 KB Output is correct
67 Correct 63 ms 22996 KB Output is correct
68 Correct 56 ms 22972 KB Output is correct
69 Correct 4 ms 7636 KB Output is correct
70 Correct 4 ms 7636 KB Output is correct
71 Correct 4 ms 7636 KB Output is correct
72 Correct 4 ms 7636 KB Output is correct
73 Correct 5 ms 7764 KB Output is correct
74 Correct 5 ms 7732 KB Output is correct
75 Correct 4 ms 7692 KB Output is correct
76 Correct 5 ms 7764 KB Output is correct
77 Correct 5 ms 7736 KB Output is correct
78 Correct 5 ms 7764 KB Output is correct
79 Correct 5 ms 7764 KB Output is correct
80 Correct 5 ms 7764 KB Output is correct
81 Correct 5 ms 7740 KB Output is correct
82 Correct 5 ms 7740 KB Output is correct
83 Correct 4 ms 7736 KB Output is correct
84 Correct 5 ms 7680 KB Output is correct
85 Correct 5 ms 7764 KB Output is correct
86 Correct 4 ms 7736 KB Output is correct
87 Correct 4 ms 7728 KB Output is correct
88 Correct 5 ms 7740 KB Output is correct
89 Correct 6 ms 7740 KB Output is correct
90 Correct 5 ms 7732 KB Output is correct
91 Correct 6 ms 7764 KB Output is correct
92 Correct 5 ms 7764 KB Output is correct
93 Correct 5 ms 7736 KB Output is correct
94 Correct 5 ms 7736 KB Output is correct
95 Correct 5 ms 7764 KB Output is correct
96 Correct 5 ms 7764 KB Output is correct
97 Correct 5 ms 7764 KB Output is correct
98 Correct 5 ms 7736 KB Output is correct
99 Correct 5 ms 7764 KB Output is correct
100 Correct 5 ms 7740 KB Output is correct
101 Correct 5 ms 7764 KB Output is correct
102 Correct 5 ms 7764 KB Output is correct
103 Correct 4 ms 7764 KB Output is correct
104 Correct 4 ms 7764 KB Output is correct
105 Correct 5 ms 7764 KB Output is correct
106 Correct 4 ms 7764 KB Output is correct
107 Correct 5 ms 7764 KB Output is correct
108 Correct 5 ms 7764 KB Output is correct
109 Correct 5 ms 7764 KB Output is correct
110 Correct 5 ms 7764 KB Output is correct
111 Correct 5 ms 7764 KB Output is correct
112 Correct 8 ms 8404 KB Output is correct
113 Correct 8 ms 8568 KB Output is correct
114 Correct 9 ms 8404 KB Output is correct
115 Correct 7 ms 8164 KB Output is correct
116 Correct 8 ms 8396 KB Output is correct
117 Correct 7 ms 8276 KB Output is correct
118 Correct 43 ms 16284 KB Output is correct
119 Correct 44 ms 17192 KB Output is correct
120 Correct 53 ms 18796 KB Output is correct
121 Correct 5 ms 7764 KB Output is correct
122 Correct 5 ms 7764 KB Output is correct
123 Correct 5 ms 7736 KB Output is correct
124 Correct 5 ms 7764 KB Output is correct
125 Correct 7 ms 7764 KB Output is correct
126 Correct 9 ms 8644 KB Output is correct
127 Correct 8 ms 8660 KB Output is correct
128 Correct 8 ms 8644 KB Output is correct
129 Correct 8 ms 8648 KB Output is correct
130 Correct 8 ms 8660 KB Output is correct
131 Correct 8 ms 8660 KB Output is correct
132 Correct 53 ms 19684 KB Output is correct
133 Correct 58 ms 19572 KB Output is correct
134 Correct 53 ms 19712 KB Output is correct
135 Correct 10 ms 8916 KB Output is correct
136 Correct 55 ms 8680 KB Output is correct
137 Correct 5 ms 8020 KB Output is correct
138 Correct 6 ms 7928 KB Output is correct
139 Correct 7 ms 7992 KB Output is correct
140 Correct 6 ms 8020 KB Output is correct
141 Correct 26 ms 12620 KB Output is correct
142 Correct 40 ms 12724 KB Output is correct
143 Correct 39 ms 13924 KB Output is correct
144 Correct 28 ms 12516 KB Output is correct
145 Correct 35 ms 13260 KB Output is correct
146 Correct 23 ms 11760 KB Output is correct
147 Correct 35 ms 15052 KB Output is correct
148 Correct 11 ms 9408 KB Output is correct
149 Correct 46 ms 16664 KB Output is correct
150 Correct 13 ms 9428 KB Output is correct
151 Correct 43 ms 17612 KB Output is correct
152 Correct 18 ms 10472 KB Output is correct
153 Correct 16 ms 9940 KB Output is correct
154 Correct 17 ms 10452 KB Output is correct
155 Correct 13 ms 9668 KB Output is correct
156 Correct 14 ms 9788 KB Output is correct
157 Correct 9 ms 9032 KB Output is correct
158 Correct 77 ms 9004 KB Output is correct
159 Correct 6 ms 8148 KB Output is correct
160 Correct 6 ms 8148 KB Output is correct
161 Correct 7 ms 8148 KB Output is correct
162 Correct 7 ms 8148 KB Output is correct
163 Correct 38 ms 14540 KB Output is correct
164 Correct 37 ms 14540 KB Output is correct
165 Correct 36 ms 14636 KB Output is correct
166 Correct 36 ms 14636 KB Output is correct
167 Correct 36 ms 14524 KB Output is correct
168 Correct 39 ms 14512 KB Output is correct
169 Correct 58 ms 20104 KB Output is correct
170 Correct 17 ms 10688 KB Output is correct
171 Correct 60 ms 20180 KB Output is correct
172 Correct 16 ms 10656 KB Output is correct
173 Correct 66 ms 20200 KB Output is correct
174 Correct 18 ms 10644 KB Output is correct
175 Correct 17 ms 10700 KB Output is correct
176 Correct 18 ms 10728 KB Output is correct
177 Correct 19 ms 10700 KB Output is correct
178 Correct 18 ms 10488 KB Output is correct
179 Correct 24 ms 11724 KB Output is correct
180 Correct 169 ms 11220 KB Output is correct
181 Correct 11 ms 8788 KB Output is correct
182 Correct 12 ms 9288 KB Output is correct
183 Correct 11 ms 8788 KB Output is correct
184 Correct 10 ms 8772 KB Output is correct
185 Correct 53 ms 19212 KB Output is correct
186 Correct 45 ms 18760 KB Output is correct
187 Correct 66 ms 21432 KB Output is correct
188 Correct 40 ms 17364 KB Output is correct
189 Correct 73 ms 20768 KB Output is correct
190 Correct 61 ms 19012 KB Output is correct
191 Correct 65 ms 19924 KB Output is correct
192 Correct 37 ms 15948 KB Output is correct
193 Correct 64 ms 17584 KB Output is correct
194 Correct 35 ms 14128 KB Output is correct
195 Correct 398 ms 14156 KB Output is correct
196 Correct 13 ms 9156 KB Output is correct
197 Correct 13 ms 9280 KB Output is correct
198 Correct 13 ms 9276 KB Output is correct
199 Correct 17 ms 9288 KB Output is correct
200 Correct 109 ms 31660 KB Output is correct
201 Correct 103 ms 31588 KB Output is correct
202 Correct 97 ms 31644 KB Output is correct
203 Correct 95 ms 31548 KB Output is correct
204 Correct 98 ms 31600 KB Output is correct
205 Correct 110 ms 31656 KB Output is correct
206 Correct 76 ms 25940 KB Output is correct
207 Correct 77 ms 25152 KB Output is correct
208 Correct 78 ms 25928 KB Output is correct
209 Correct 68 ms 25156 KB Output is correct
210 Correct 81 ms 25920 KB Output is correct
211 Correct 70 ms 25144 KB Output is correct
212 Correct 81 ms 26368 KB Output is correct
213 Correct 76 ms 23500 KB Output is correct
214 Correct 77 ms 22992 KB Output is correct
215 Correct 83 ms 23468 KB Output is correct