답안 #364798

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
364798 2021-02-10T06:38:45 Z abra_stone 벽 칠하기 (APIO20_paint) C++14
63 / 100
1207 ms 524292 KB
#include "paint.h"
#include <vector>
#include <iostream>
#define N 100005
using namespace std;

int ba, sg[N * 4 + 5];
vector<int> ve[N], di[N], dc[N];

void up(int p, int q) {
	p += ba;
	sg[p] = q;
	for (p /= 2; p > 0; p /= 2) {
		sg[p] = min(sg[p * 2], sg[p * 2 + 1]);
	}
}

int get(int p, int q) {
	int re = 1e9;
	p += ba; q += ba;
	while (p < q) {
		if (p % 2 == 1) re = min(re, sg[p]), p++;
		if (q % 2 == 0) re = min(re, sg[q]), q--;
		p /= 2; q /= 2;
	}
	if (p == q) re = min(re, sg[p]);
	return re;
}

int minimumInstructions(int n, int m, int K, vector<int> c, vector<int> a, vector<vector<int> > b) {
	int i, j, k;

	c.push_back(0);
	for (i = c.size() - 1; i > 0; i--) {
		c[i] = c[i - 1];
	}

	for (i = 0; i <= m; i++) {
		di[0].push_back(i);
		dc[0].push_back(0);
	}

	for (i = 0; i < m; i++) {
		for (j = 0; j < a[i]; j++) {
			ve[b[i][j]].push_back(i);
		}
	}
	for (i = 1; i <= n; i++) {
		for (j = 0; j < ve[c[i]].size(); j++) {
			di[i].push_back(ve[c[i]][j]);
			dc[i].push_back(0);
		}
		di[i].push_back(1e9);
		dc[i].push_back(-1e9);
		for (j = k = 0; j < di[i].size() - 1; j++) {
			if (di[i][j] == 0) {
				if (di[i - 1][di[i - 1].size() - 2] == m - 1) {
					dc[i][j] = dc[i - 1][di[i - 1].size() - 2] + 1;
				} else {
					dc[i][j] = 1;
				}
			} else {
				for (; di[i - 1][k] < di[i][j] - 1; k++);
				if (di[i - 1][k] == di[i][j] - 1) {
					dc[i][j] = dc[i - 1][k] + 1;
				} else {
					dc[i][j] = 1;
				}
			}
		}
	}
	for (ba = 1; ba < n + 1; ba *= 2);
	for (i = 0; i < ba * 2; i++) sg[i] = 1e9;
	up(0, 0);
	for (i = m; i <= n; i++) {
		for (j = 0; j < dc[i].size() - 1; j++) {
			if (dc[i][j] >= m) {
				int t = get(i - m, i - 1) + 1;
				if (t < sg[ba + i]) up(i, t);
				break;
			}
		}
	}
	if (get(n, n) < 1e9) return get(n, n);
	else return -1;
}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:49:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |   for (j = 0; j < ve[c[i]].size(); j++) {
      |               ~~^~~~~~~~~~~~~~~~~
paint.cpp:55:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |   for (j = k = 0; j < di[i].size() - 1; j++) {
      |                   ~~^~~~~~~~~~~~~~~~~~
paint.cpp:76:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   76 |   for (j = 0; j < dc[i].size() - 1; j++) {
      |               ~~^~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7404 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 5 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 5 ms 7404 KB Output is correct
6 Correct 5 ms 7404 KB Output is correct
7 Correct 6 ms 7404 KB Output is correct
8 Correct 5 ms 7404 KB Output is correct
9 Correct 5 ms 7404 KB Output is correct
10 Correct 5 ms 7404 KB Output is correct
11 Correct 5 ms 7404 KB Output is correct
12 Correct 5 ms 7404 KB Output is correct
13 Correct 6 ms 7404 KB Output is correct
14 Correct 6 ms 7404 KB Output is correct
15 Correct 6 ms 7404 KB Output is correct
16 Correct 7 ms 7404 KB Output is correct
17 Correct 6 ms 7404 KB Output is correct
18 Correct 6 ms 7404 KB Output is correct
19 Correct 7 ms 7404 KB Output is correct
20 Correct 5 ms 7404 KB Output is correct
21 Correct 6 ms 7404 KB Output is correct
22 Correct 28 ms 11372 KB Output is correct
23 Correct 30 ms 11500 KB Output is correct
24 Correct 30 ms 11372 KB Output is correct
25 Correct 12 ms 9068 KB Output is correct
26 Correct 13 ms 9068 KB Output is correct
27 Correct 12 ms 9068 KB Output is correct
28 Correct 12 ms 9068 KB Output is correct
29 Correct 11 ms 9068 KB Output is correct
30 Correct 11 ms 9068 KB Output is correct
31 Correct 21 ms 9964 KB Output is correct
32 Correct 21 ms 9964 KB Output is correct
33 Correct 20 ms 9964 KB Output is correct
34 Correct 24 ms 9964 KB Output is correct
35 Correct 22 ms 9984 KB Output is correct
36 Correct 25 ms 9964 KB Output is correct
37 Correct 39 ms 13164 KB Output is correct
38 Correct 43 ms 13164 KB Output is correct
39 Correct 40 ms 13164 KB Output is correct
40 Correct 37 ms 14728 KB Output is correct
41 Correct 25 ms 11916 KB Output is correct
42 Correct 38 ms 15336 KB Output is correct
43 Correct 27 ms 12544 KB Output is correct
44 Correct 24 ms 12160 KB Output is correct
45 Correct 37 ms 15460 KB Output is correct
46 Correct 91 ms 23320 KB Output is correct
47 Correct 69 ms 16656 KB Output is correct
48 Correct 59 ms 19472 KB Output is correct
49 Correct 66 ms 19708 KB Output is correct
50 Correct 71 ms 20312 KB Output is correct
51 Correct 62 ms 18376 KB Output is correct
52 Correct 44 ms 15588 KB Output is correct
53 Correct 41 ms 15460 KB Output is correct
54 Correct 39 ms 15460 KB Output is correct
55 Correct 48 ms 15460 KB Output is correct
56 Correct 44 ms 15460 KB Output is correct
57 Correct 37 ms 15588 KB Output is correct
58 Correct 91 ms 24804 KB Output is correct
59 Correct 92 ms 24804 KB Output is correct
60 Correct 101 ms 24932 KB Output is correct
61 Correct 95 ms 24804 KB Output is correct
62 Correct 91 ms 24804 KB Output is correct
63 Correct 95 ms 24932 KB Output is correct
64 Correct 110 ms 24164 KB Output is correct
65 Correct 122 ms 24036 KB Output is correct
66 Correct 99 ms 23996 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7404 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 5 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 5 ms 7404 KB Output is correct
6 Correct 5 ms 7404 KB Output is correct
7 Correct 6 ms 7404 KB Output is correct
8 Correct 5 ms 7404 KB Output is correct
9 Correct 5 ms 7404 KB Output is correct
10 Correct 5 ms 7404 KB Output is correct
11 Correct 5 ms 7404 KB Output is correct
12 Correct 5 ms 7404 KB Output is correct
13 Correct 6 ms 7404 KB Output is correct
14 Correct 6 ms 7404 KB Output is correct
15 Correct 6 ms 7404 KB Output is correct
16 Correct 7 ms 7404 KB Output is correct
17 Correct 6 ms 7404 KB Output is correct
18 Correct 6 ms 7404 KB Output is correct
19 Correct 7 ms 7404 KB Output is correct
20 Correct 5 ms 7404 KB Output is correct
21 Correct 6 ms 7404 KB Output is correct
22 Correct 5 ms 7532 KB Output is correct
23 Correct 5 ms 7404 KB Output is correct
24 Correct 5 ms 7404 KB Output is correct
25 Correct 5 ms 7404 KB Output is correct
26 Correct 5 ms 7404 KB Output is correct
27 Correct 6 ms 7404 KB Output is correct
28 Correct 6 ms 7532 KB Output is correct
29 Correct 6 ms 7404 KB Output is correct
30 Correct 6 ms 7404 KB Output is correct
31 Correct 5 ms 7404 KB Output is correct
32 Correct 6 ms 7404 KB Output is correct
33 Correct 6 ms 7404 KB Output is correct
34 Correct 6 ms 7404 KB Output is correct
35 Correct 6 ms 7404 KB Output is correct
36 Correct 6 ms 7404 KB Output is correct
37 Correct 6 ms 7404 KB Output is correct
38 Correct 6 ms 7404 KB Output is correct
39 Correct 6 ms 7404 KB Output is correct
40 Correct 6 ms 7404 KB Output is correct
41 Correct 6 ms 7404 KB Output is correct
42 Correct 6 ms 7404 KB Output is correct
43 Correct 6 ms 7404 KB Output is correct
44 Correct 5 ms 7404 KB Output is correct
45 Correct 6 ms 7532 KB Output is correct
46 Correct 6 ms 7532 KB Output is correct
47 Correct 6 ms 7532 KB Output is correct
48 Correct 6 ms 7532 KB Output is correct
49 Correct 6 ms 7532 KB Output is correct
50 Correct 6 ms 7404 KB Output is correct
51 Correct 6 ms 7404 KB Output is correct
52 Correct 5 ms 7404 KB Output is correct
53 Correct 6 ms 7404 KB Output is correct
54 Correct 6 ms 7404 KB Output is correct
55 Correct 7 ms 7404 KB Output is correct
56 Correct 7 ms 7404 KB Output is correct
57 Correct 6 ms 7404 KB Output is correct
58 Correct 6 ms 7404 KB Output is correct
59 Correct 6 ms 7404 KB Output is correct
60 Correct 6 ms 7404 KB Output is correct
61 Correct 6 ms 7404 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7532 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 5 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 5 ms 7404 KB Output is correct
6 Correct 5 ms 7404 KB Output is correct
7 Correct 5 ms 7404 KB Output is correct
8 Correct 5 ms 7404 KB Output is correct
9 Correct 6 ms 7404 KB Output is correct
10 Correct 5 ms 7404 KB Output is correct
11 Correct 5 ms 7404 KB Output is correct
12 Correct 5 ms 7404 KB Output is correct
13 Correct 5 ms 7404 KB Output is correct
14 Correct 5 ms 7404 KB Output is correct
15 Correct 6 ms 7404 KB Output is correct
16 Correct 6 ms 7404 KB Output is correct
17 Correct 6 ms 7404 KB Output is correct
18 Correct 7 ms 7404 KB Output is correct
19 Correct 6 ms 7404 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 7 ms 7404 KB Output is correct
22 Correct 5 ms 7404 KB Output is correct
23 Correct 6 ms 7404 KB Output is correct
24 Correct 28 ms 11372 KB Output is correct
25 Correct 30 ms 11500 KB Output is correct
26 Correct 30 ms 11372 KB Output is correct
27 Correct 5 ms 7404 KB Output is correct
28 Correct 5 ms 7404 KB Output is correct
29 Correct 5 ms 7404 KB Output is correct
30 Correct 6 ms 7404 KB Output is correct
31 Correct 6 ms 7532 KB Output is correct
32 Correct 6 ms 7404 KB Output is correct
33 Correct 6 ms 7404 KB Output is correct
34 Correct 5 ms 7404 KB Output is correct
35 Correct 6 ms 7404 KB Output is correct
36 Correct 6 ms 7404 KB Output is correct
37 Correct 6 ms 7404 KB Output is correct
38 Correct 6 ms 7404 KB Output is correct
39 Correct 6 ms 7404 KB Output is correct
40 Correct 6 ms 7404 KB Output is correct
41 Correct 6 ms 7404 KB Output is correct
42 Correct 6 ms 7404 KB Output is correct
43 Correct 6 ms 7404 KB Output is correct
44 Correct 6 ms 7404 KB Output is correct
45 Correct 6 ms 7404 KB Output is correct
46 Correct 6 ms 7404 KB Output is correct
47 Correct 5 ms 7404 KB Output is correct
48 Correct 6 ms 7532 KB Output is correct
49 Correct 6 ms 7532 KB Output is correct
50 Correct 6 ms 7532 KB Output is correct
51 Correct 6 ms 7532 KB Output is correct
52 Correct 6 ms 7532 KB Output is correct
53 Correct 6 ms 7404 KB Output is correct
54 Correct 6 ms 7404 KB Output is correct
55 Correct 5 ms 7404 KB Output is correct
56 Correct 6 ms 7404 KB Output is correct
57 Correct 6 ms 7404 KB Output is correct
58 Correct 7 ms 7404 KB Output is correct
59 Correct 7 ms 7404 KB Output is correct
60 Correct 6 ms 7404 KB Output is correct
61 Correct 6 ms 7404 KB Output is correct
62 Correct 6 ms 7404 KB Output is correct
63 Correct 6 ms 7404 KB Output is correct
64 Correct 6 ms 7404 KB Output is correct
65 Correct 7 ms 7916 KB Output is correct
66 Correct 6 ms 7660 KB Output is correct
67 Correct 7 ms 7916 KB Output is correct
68 Correct 7 ms 7916 KB Output is correct
69 Correct 7 ms 7916 KB Output is correct
70 Correct 9 ms 7660 KB Output is correct
71 Correct 8 ms 7660 KB Output is correct
72 Correct 8 ms 7660 KB Output is correct
73 Correct 7 ms 7532 KB Output is correct
74 Correct 8 ms 7660 KB Output is correct
75 Correct 8 ms 7808 KB Output is correct
76 Correct 33 ms 10092 KB Output is correct
77 Correct 28 ms 10476 KB Output is correct
78 Correct 38 ms 10860 KB Output is correct
79 Correct 10 ms 8428 KB Output is correct
80 Correct 9 ms 8428 KB Output is correct
81 Correct 10 ms 8428 KB Output is correct
82 Correct 10 ms 8428 KB Output is correct
83 Correct 8 ms 8428 KB Output is correct
84 Correct 9 ms 7660 KB Output is correct
85 Correct 9 ms 7660 KB Output is correct
86 Correct 9 ms 7788 KB Output is correct
87 Correct 9 ms 7660 KB Output is correct
88 Correct 9 ms 7660 KB Output is correct
89 Correct 9 ms 7660 KB Output is correct
90 Correct 56 ms 11116 KB Output is correct
91 Correct 41 ms 11116 KB Output is correct
92 Correct 44 ms 11136 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7532 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 5 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 5 ms 7404 KB Output is correct
6 Correct 5 ms 7404 KB Output is correct
7 Correct 5 ms 7404 KB Output is correct
8 Correct 5 ms 7404 KB Output is correct
9 Correct 6 ms 7404 KB Output is correct
10 Correct 5 ms 7404 KB Output is correct
11 Correct 5 ms 7404 KB Output is correct
12 Correct 5 ms 7404 KB Output is correct
13 Correct 5 ms 7404 KB Output is correct
14 Correct 5 ms 7404 KB Output is correct
15 Correct 6 ms 7404 KB Output is correct
16 Correct 6 ms 7404 KB Output is correct
17 Correct 6 ms 7404 KB Output is correct
18 Correct 7 ms 7404 KB Output is correct
19 Correct 6 ms 7404 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 7 ms 7404 KB Output is correct
22 Correct 5 ms 7404 KB Output is correct
23 Correct 6 ms 7404 KB Output is correct
24 Correct 28 ms 11372 KB Output is correct
25 Correct 30 ms 11500 KB Output is correct
26 Correct 30 ms 11372 KB Output is correct
27 Correct 12 ms 9068 KB Output is correct
28 Correct 13 ms 9068 KB Output is correct
29 Correct 12 ms 9068 KB Output is correct
30 Correct 12 ms 9068 KB Output is correct
31 Correct 11 ms 9068 KB Output is correct
32 Correct 11 ms 9068 KB Output is correct
33 Correct 21 ms 9964 KB Output is correct
34 Correct 21 ms 9964 KB Output is correct
35 Correct 20 ms 9964 KB Output is correct
36 Correct 24 ms 9964 KB Output is correct
37 Correct 22 ms 9984 KB Output is correct
38 Correct 25 ms 9964 KB Output is correct
39 Correct 39 ms 13164 KB Output is correct
40 Correct 43 ms 13164 KB Output is correct
41 Correct 40 ms 13164 KB Output is correct
42 Correct 5 ms 7404 KB Output is correct
43 Correct 5 ms 7404 KB Output is correct
44 Correct 5 ms 7404 KB Output is correct
45 Correct 6 ms 7404 KB Output is correct
46 Correct 6 ms 7532 KB Output is correct
47 Correct 6 ms 7404 KB Output is correct
48 Correct 6 ms 7404 KB Output is correct
49 Correct 5 ms 7404 KB Output is correct
50 Correct 6 ms 7404 KB Output is correct
51 Correct 6 ms 7404 KB Output is correct
52 Correct 6 ms 7404 KB Output is correct
53 Correct 6 ms 7404 KB Output is correct
54 Correct 6 ms 7404 KB Output is correct
55 Correct 6 ms 7404 KB Output is correct
56 Correct 6 ms 7404 KB Output is correct
57 Correct 6 ms 7404 KB Output is correct
58 Correct 6 ms 7404 KB Output is correct
59 Correct 6 ms 7404 KB Output is correct
60 Correct 6 ms 7404 KB Output is correct
61 Correct 6 ms 7404 KB Output is correct
62 Correct 5 ms 7404 KB Output is correct
63 Correct 6 ms 7532 KB Output is correct
64 Correct 6 ms 7532 KB Output is correct
65 Correct 6 ms 7532 KB Output is correct
66 Correct 6 ms 7532 KB Output is correct
67 Correct 6 ms 7532 KB Output is correct
68 Correct 6 ms 7404 KB Output is correct
69 Correct 6 ms 7404 KB Output is correct
70 Correct 5 ms 7404 KB Output is correct
71 Correct 6 ms 7404 KB Output is correct
72 Correct 6 ms 7404 KB Output is correct
73 Correct 7 ms 7404 KB Output is correct
74 Correct 7 ms 7404 KB Output is correct
75 Correct 6 ms 7404 KB Output is correct
76 Correct 6 ms 7404 KB Output is correct
77 Correct 6 ms 7404 KB Output is correct
78 Correct 6 ms 7404 KB Output is correct
79 Correct 6 ms 7404 KB Output is correct
80 Correct 7 ms 7916 KB Output is correct
81 Correct 6 ms 7660 KB Output is correct
82 Correct 7 ms 7916 KB Output is correct
83 Correct 7 ms 7916 KB Output is correct
84 Correct 7 ms 7916 KB Output is correct
85 Correct 9 ms 7660 KB Output is correct
86 Correct 8 ms 7660 KB Output is correct
87 Correct 8 ms 7660 KB Output is correct
88 Correct 7 ms 7532 KB Output is correct
89 Correct 8 ms 7660 KB Output is correct
90 Correct 8 ms 7808 KB Output is correct
91 Correct 33 ms 10092 KB Output is correct
92 Correct 28 ms 10476 KB Output is correct
93 Correct 38 ms 10860 KB Output is correct
94 Correct 10 ms 8428 KB Output is correct
95 Correct 9 ms 8428 KB Output is correct
96 Correct 10 ms 8428 KB Output is correct
97 Correct 10 ms 8428 KB Output is correct
98 Correct 8 ms 8428 KB Output is correct
99 Correct 9 ms 7660 KB Output is correct
100 Correct 9 ms 7660 KB Output is correct
101 Correct 9 ms 7788 KB Output is correct
102 Correct 9 ms 7660 KB Output is correct
103 Correct 9 ms 7660 KB Output is correct
104 Correct 9 ms 7660 KB Output is correct
105 Correct 56 ms 11116 KB Output is correct
106 Correct 41 ms 11116 KB Output is correct
107 Correct 44 ms 11136 KB Output is correct
108 Correct 14 ms 9068 KB Output is correct
109 Correct 329 ms 124492 KB Output is correct
110 Correct 180 ms 57452 KB Output is correct
111 Correct 149 ms 54252 KB Output is correct
112 Correct 193 ms 70016 KB Output is correct
113 Correct 103 ms 38124 KB Output is correct
114 Correct 26 ms 9708 KB Output is correct
115 Correct 25 ms 9580 KB Output is correct
116 Correct 35 ms 10720 KB Output is correct
117 Correct 26 ms 9708 KB Output is correct
118 Correct 27 ms 9964 KB Output is correct
119 Correct 26 ms 9452 KB Output is correct
120 Correct 31 ms 10732 KB Output is correct
121 Correct 19 ms 8760 KB Output is correct
122 Correct 38 ms 10988 KB Output is correct
123 Correct 15 ms 8812 KB Output is correct
124 Correct 57 ms 12012 KB Output is correct
125 Correct 19 ms 9580 KB Output is correct
126 Correct 17 ms 9196 KB Output is correct
127 Correct 20 ms 9836 KB Output is correct
128 Correct 16 ms 9068 KB Output is correct
129 Correct 16 ms 9068 KB Output is correct
130 Correct 14 ms 9068 KB Output is correct
131 Correct 392 ms 168960 KB Output is correct
132 Correct 268 ms 88684 KB Output is correct
133 Correct 243 ms 88684 KB Output is correct
134 Correct 227 ms 88684 KB Output is correct
135 Correct 212 ms 80748 KB Output is correct
136 Correct 36 ms 11116 KB Output is correct
137 Correct 36 ms 11116 KB Output is correct
138 Correct 37 ms 11116 KB Output is correct
139 Correct 37 ms 11116 KB Output is correct
140 Correct 37 ms 11116 KB Output is correct
141 Correct 37 ms 11116 KB Output is correct
142 Correct 57 ms 13036 KB Output is correct
143 Correct 21 ms 9836 KB Output is correct
144 Correct 51 ms 13036 KB Output is correct
145 Correct 21 ms 9836 KB Output is correct
146 Correct 54 ms 13036 KB Output is correct
147 Correct 27 ms 9836 KB Output is correct
148 Correct 28 ms 10092 KB Output is correct
149 Correct 22 ms 9964 KB Output is correct
150 Correct 22 ms 9964 KB Output is correct
151 Correct 21 ms 9964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 7532 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 5 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 5 ms 7404 KB Output is correct
6 Correct 5 ms 7404 KB Output is correct
7 Correct 5 ms 7404 KB Output is correct
8 Correct 5 ms 7404 KB Output is correct
9 Correct 6 ms 7404 KB Output is correct
10 Correct 5 ms 7404 KB Output is correct
11 Correct 5 ms 7404 KB Output is correct
12 Correct 5 ms 7404 KB Output is correct
13 Correct 5 ms 7404 KB Output is correct
14 Correct 5 ms 7404 KB Output is correct
15 Correct 6 ms 7404 KB Output is correct
16 Correct 6 ms 7404 KB Output is correct
17 Correct 6 ms 7404 KB Output is correct
18 Correct 7 ms 7404 KB Output is correct
19 Correct 6 ms 7404 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 7 ms 7404 KB Output is correct
22 Correct 5 ms 7404 KB Output is correct
23 Correct 6 ms 7404 KB Output is correct
24 Correct 28 ms 11372 KB Output is correct
25 Correct 30 ms 11500 KB Output is correct
26 Correct 30 ms 11372 KB Output is correct
27 Correct 12 ms 9068 KB Output is correct
28 Correct 13 ms 9068 KB Output is correct
29 Correct 12 ms 9068 KB Output is correct
30 Correct 12 ms 9068 KB Output is correct
31 Correct 11 ms 9068 KB Output is correct
32 Correct 11 ms 9068 KB Output is correct
33 Correct 21 ms 9964 KB Output is correct
34 Correct 21 ms 9964 KB Output is correct
35 Correct 20 ms 9964 KB Output is correct
36 Correct 24 ms 9964 KB Output is correct
37 Correct 22 ms 9984 KB Output is correct
38 Correct 25 ms 9964 KB Output is correct
39 Correct 39 ms 13164 KB Output is correct
40 Correct 43 ms 13164 KB Output is correct
41 Correct 40 ms 13164 KB Output is correct
42 Correct 37 ms 14728 KB Output is correct
43 Correct 25 ms 11916 KB Output is correct
44 Correct 38 ms 15336 KB Output is correct
45 Correct 27 ms 12544 KB Output is correct
46 Correct 24 ms 12160 KB Output is correct
47 Correct 37 ms 15460 KB Output is correct
48 Correct 91 ms 23320 KB Output is correct
49 Correct 69 ms 16656 KB Output is correct
50 Correct 59 ms 19472 KB Output is correct
51 Correct 66 ms 19708 KB Output is correct
52 Correct 71 ms 20312 KB Output is correct
53 Correct 62 ms 18376 KB Output is correct
54 Correct 44 ms 15588 KB Output is correct
55 Correct 41 ms 15460 KB Output is correct
56 Correct 39 ms 15460 KB Output is correct
57 Correct 48 ms 15460 KB Output is correct
58 Correct 44 ms 15460 KB Output is correct
59 Correct 37 ms 15588 KB Output is correct
60 Correct 91 ms 24804 KB Output is correct
61 Correct 92 ms 24804 KB Output is correct
62 Correct 101 ms 24932 KB Output is correct
63 Correct 95 ms 24804 KB Output is correct
64 Correct 91 ms 24804 KB Output is correct
65 Correct 95 ms 24932 KB Output is correct
66 Correct 110 ms 24164 KB Output is correct
67 Correct 122 ms 24036 KB Output is correct
68 Correct 99 ms 23996 KB Output is correct
69 Correct 5 ms 7404 KB Output is correct
70 Correct 5 ms 7404 KB Output is correct
71 Correct 5 ms 7404 KB Output is correct
72 Correct 6 ms 7404 KB Output is correct
73 Correct 6 ms 7532 KB Output is correct
74 Correct 6 ms 7404 KB Output is correct
75 Correct 6 ms 7404 KB Output is correct
76 Correct 5 ms 7404 KB Output is correct
77 Correct 6 ms 7404 KB Output is correct
78 Correct 6 ms 7404 KB Output is correct
79 Correct 6 ms 7404 KB Output is correct
80 Correct 6 ms 7404 KB Output is correct
81 Correct 6 ms 7404 KB Output is correct
82 Correct 6 ms 7404 KB Output is correct
83 Correct 6 ms 7404 KB Output is correct
84 Correct 6 ms 7404 KB Output is correct
85 Correct 6 ms 7404 KB Output is correct
86 Correct 6 ms 7404 KB Output is correct
87 Correct 6 ms 7404 KB Output is correct
88 Correct 6 ms 7404 KB Output is correct
89 Correct 5 ms 7404 KB Output is correct
90 Correct 6 ms 7532 KB Output is correct
91 Correct 6 ms 7532 KB Output is correct
92 Correct 6 ms 7532 KB Output is correct
93 Correct 6 ms 7532 KB Output is correct
94 Correct 6 ms 7532 KB Output is correct
95 Correct 6 ms 7404 KB Output is correct
96 Correct 6 ms 7404 KB Output is correct
97 Correct 5 ms 7404 KB Output is correct
98 Correct 6 ms 7404 KB Output is correct
99 Correct 6 ms 7404 KB Output is correct
100 Correct 7 ms 7404 KB Output is correct
101 Correct 7 ms 7404 KB Output is correct
102 Correct 6 ms 7404 KB Output is correct
103 Correct 6 ms 7404 KB Output is correct
104 Correct 6 ms 7404 KB Output is correct
105 Correct 6 ms 7404 KB Output is correct
106 Correct 6 ms 7404 KB Output is correct
107 Correct 7 ms 7916 KB Output is correct
108 Correct 6 ms 7660 KB Output is correct
109 Correct 7 ms 7916 KB Output is correct
110 Correct 7 ms 7916 KB Output is correct
111 Correct 7 ms 7916 KB Output is correct
112 Correct 9 ms 7660 KB Output is correct
113 Correct 8 ms 7660 KB Output is correct
114 Correct 8 ms 7660 KB Output is correct
115 Correct 7 ms 7532 KB Output is correct
116 Correct 8 ms 7660 KB Output is correct
117 Correct 8 ms 7808 KB Output is correct
118 Correct 33 ms 10092 KB Output is correct
119 Correct 28 ms 10476 KB Output is correct
120 Correct 38 ms 10860 KB Output is correct
121 Correct 10 ms 8428 KB Output is correct
122 Correct 9 ms 8428 KB Output is correct
123 Correct 10 ms 8428 KB Output is correct
124 Correct 10 ms 8428 KB Output is correct
125 Correct 8 ms 8428 KB Output is correct
126 Correct 9 ms 7660 KB Output is correct
127 Correct 9 ms 7660 KB Output is correct
128 Correct 9 ms 7788 KB Output is correct
129 Correct 9 ms 7660 KB Output is correct
130 Correct 9 ms 7660 KB Output is correct
131 Correct 9 ms 7660 KB Output is correct
132 Correct 56 ms 11116 KB Output is correct
133 Correct 41 ms 11116 KB Output is correct
134 Correct 44 ms 11136 KB Output is correct
135 Correct 14 ms 9068 KB Output is correct
136 Correct 329 ms 124492 KB Output is correct
137 Correct 180 ms 57452 KB Output is correct
138 Correct 149 ms 54252 KB Output is correct
139 Correct 193 ms 70016 KB Output is correct
140 Correct 103 ms 38124 KB Output is correct
141 Correct 26 ms 9708 KB Output is correct
142 Correct 25 ms 9580 KB Output is correct
143 Correct 35 ms 10720 KB Output is correct
144 Correct 26 ms 9708 KB Output is correct
145 Correct 27 ms 9964 KB Output is correct
146 Correct 26 ms 9452 KB Output is correct
147 Correct 31 ms 10732 KB Output is correct
148 Correct 19 ms 8760 KB Output is correct
149 Correct 38 ms 10988 KB Output is correct
150 Correct 15 ms 8812 KB Output is correct
151 Correct 57 ms 12012 KB Output is correct
152 Correct 19 ms 9580 KB Output is correct
153 Correct 17 ms 9196 KB Output is correct
154 Correct 20 ms 9836 KB Output is correct
155 Correct 16 ms 9068 KB Output is correct
156 Correct 16 ms 9068 KB Output is correct
157 Correct 14 ms 9068 KB Output is correct
158 Correct 392 ms 168960 KB Output is correct
159 Correct 268 ms 88684 KB Output is correct
160 Correct 243 ms 88684 KB Output is correct
161 Correct 227 ms 88684 KB Output is correct
162 Correct 212 ms 80748 KB Output is correct
163 Correct 36 ms 11116 KB Output is correct
164 Correct 36 ms 11116 KB Output is correct
165 Correct 37 ms 11116 KB Output is correct
166 Correct 37 ms 11116 KB Output is correct
167 Correct 37 ms 11116 KB Output is correct
168 Correct 37 ms 11116 KB Output is correct
169 Correct 57 ms 13036 KB Output is correct
170 Correct 21 ms 9836 KB Output is correct
171 Correct 51 ms 13036 KB Output is correct
172 Correct 21 ms 9836 KB Output is correct
173 Correct 54 ms 13036 KB Output is correct
174 Correct 27 ms 9836 KB Output is correct
175 Correct 28 ms 10092 KB Output is correct
176 Correct 22 ms 9964 KB Output is correct
177 Correct 22 ms 9964 KB Output is correct
178 Correct 21 ms 9964 KB Output is correct
179 Correct 32 ms 12280 KB Output is correct
180 Correct 713 ms 218528 KB Output is correct
181 Correct 876 ms 313112 KB Output is correct
182 Correct 1168 ms 409672 KB Output is correct
183 Correct 618 ms 205948 KB Output is correct
184 Correct 494 ms 135544 KB Output is correct
185 Correct 68 ms 14500 KB Output is correct
186 Correct 67 ms 17008 KB Output is correct
187 Correct 70 ms 15612 KB Output is correct
188 Correct 69 ms 17556 KB Output is correct
189 Correct 83 ms 17428 KB Output is correct
190 Correct 80 ms 18364 KB Output is correct
191 Correct 95 ms 17852 KB Output is correct
192 Correct 57 ms 15592 KB Output is correct
193 Correct 62 ms 15080 KB Output is correct
194 Correct 49 ms 15460 KB Output is correct
195 Runtime error 1207 ms 524292 KB Execution killed with signal 9
196 Halted 0 ms 0 KB -