Submission #364797

# Submission time Handle Problem Language Result Execution time Memory
364797 2021-02-10T06:32:58 Z abra_stone Painting Walls (APIO20_paint) C++14
63 / 100
1315 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);
			}
		}
	}
	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++) {
      |               ~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7404 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 6 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 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 6 ms 7404 KB Output is correct
17 Correct 6 ms 7416 KB Output is correct
18 Correct 6 ms 7404 KB Output is correct
19 Correct 6 ms 7532 KB Output is correct
20 Correct 6 ms 7532 KB Output is correct
21 Correct 6 ms 7532 KB Output is correct
22 Correct 28 ms 11884 KB Output is correct
23 Correct 29 ms 11884 KB Output is correct
24 Correct 30 ms 11884 KB Output is correct
25 Correct 12 ms 9088 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 12 ms 9068 KB Output is correct
30 Correct 12 ms 9068 KB Output is correct
31 Correct 22 ms 10240 KB Output is correct
32 Correct 22 ms 10220 KB Output is correct
33 Correct 22 ms 10220 KB Output is correct
34 Correct 26 ms 10220 KB Output is correct
35 Correct 21 ms 10220 KB Output is correct
36 Correct 21 ms 10220 KB Output is correct
37 Correct 38 ms 13896 KB Output is correct
38 Correct 38 ms 13804 KB Output is correct
39 Correct 40 ms 13932 KB Output is correct
40 Correct 39 ms 14984 KB Output is correct
41 Correct 27 ms 12044 KB Output is correct
42 Correct 38 ms 15464 KB Output is correct
43 Correct 26 ms 12652 KB Output is correct
44 Correct 25 ms 12160 KB Output is correct
45 Correct 43 ms 15588 KB Output is correct
46 Correct 101 ms 24344 KB Output is correct
47 Correct 53 ms 17296 KB Output is correct
48 Correct 55 ms 20112 KB Output is correct
49 Correct 65 ms 20604 KB Output is correct
50 Correct 71 ms 21336 KB Output is correct
51 Correct 62 ms 19144 KB Output is correct
52 Correct 41 ms 15588 KB Output is correct
53 Correct 42 ms 15588 KB Output is correct
54 Correct 38 ms 15588 KB Output is correct
55 Correct 38 ms 15588 KB Output is correct
56 Correct 37 ms 15588 KB Output is correct
57 Correct 38 ms 15588 KB Output is correct
58 Correct 94 ms 26084 KB Output is correct
59 Correct 95 ms 26212 KB Output is correct
60 Correct 93 ms 26084 KB Output is correct
61 Correct 95 ms 26104 KB Output is correct
62 Correct 91 ms 26084 KB Output is correct
63 Correct 93 ms 26084 KB Output is correct
64 Correct 93 ms 25188 KB Output is correct
65 Correct 98 ms 25316 KB Output is correct
66 Correct 102 ms 25188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7404 KB Output is correct
2 Correct 5 ms 7404 KB Output is correct
3 Correct 6 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 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 6 ms 7404 KB Output is correct
17 Correct 6 ms 7416 KB Output is correct
18 Correct 6 ms 7404 KB Output is correct
19 Correct 6 ms 7532 KB Output is correct
20 Correct 6 ms 7532 KB Output is correct
21 Correct 6 ms 7532 KB Output is correct
22 Correct 5 ms 7404 KB Output is correct
23 Correct 7 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 5 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 6 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 5 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 5 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 7 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 5 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 7532 KB Output is correct
57 Correct 6 ms 7404 KB Output is correct
58 Correct 6 ms 7532 KB Output is correct
59 Correct 6 ms 7404 KB Output is correct
60 Correct 6 ms 7532 KB Output is correct
61 Correct 6 ms 7404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7404 KB Output is correct
2 Correct 7 ms 7404 KB Output is correct
3 Correct 6 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 6 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 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 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 6 ms 7404 KB Output is correct
19 Correct 6 ms 7416 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 6 ms 7532 KB Output is correct
22 Correct 6 ms 7532 KB Output is correct
23 Correct 6 ms 7532 KB Output is correct
24 Correct 28 ms 11884 KB Output is correct
25 Correct 29 ms 11884 KB Output is correct
26 Correct 30 ms 11884 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 5 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 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 5 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 5 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 7 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 5 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 7532 KB Output is correct
60 Correct 6 ms 7404 KB Output is correct
61 Correct 6 ms 7532 KB Output is correct
62 Correct 6 ms 7404 KB Output is correct
63 Correct 6 ms 7532 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 9 ms 7916 KB Output is correct
68 Correct 7 ms 7916 KB Output is correct
69 Correct 8 ms 7916 KB Output is correct
70 Correct 8 ms 7788 KB Output is correct
71 Correct 8 ms 7788 KB Output is correct
72 Correct 9 ms 7788 KB Output is correct
73 Correct 7 ms 7660 KB Output is correct
74 Correct 8 ms 7788 KB Output is correct
75 Correct 7 ms 7660 KB Output is correct
76 Correct 29 ms 10732 KB Output is correct
77 Correct 26 ms 11244 KB Output is correct
78 Correct 36 ms 11768 KB Output is correct
79 Correct 10 ms 8428 KB Output is correct
80 Correct 10 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 10 ms 8428 KB Output is correct
84 Correct 9 ms 7788 KB Output is correct
85 Correct 8 ms 7788 KB Output is correct
86 Correct 8 ms 7788 KB Output is correct
87 Correct 8 ms 7788 KB Output is correct
88 Correct 8 ms 7788 KB Output is correct
89 Correct 8 ms 7788 KB Output is correct
90 Correct 41 ms 12012 KB Output is correct
91 Correct 47 ms 12012 KB Output is correct
92 Correct 40 ms 12140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7404 KB Output is correct
2 Correct 7 ms 7404 KB Output is correct
3 Correct 6 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 6 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 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 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 6 ms 7404 KB Output is correct
19 Correct 6 ms 7416 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 6 ms 7532 KB Output is correct
22 Correct 6 ms 7532 KB Output is correct
23 Correct 6 ms 7532 KB Output is correct
24 Correct 28 ms 11884 KB Output is correct
25 Correct 29 ms 11884 KB Output is correct
26 Correct 30 ms 11884 KB Output is correct
27 Correct 12 ms 9088 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 12 ms 9068 KB Output is correct
32 Correct 12 ms 9068 KB Output is correct
33 Correct 22 ms 10240 KB Output is correct
34 Correct 22 ms 10220 KB Output is correct
35 Correct 22 ms 10220 KB Output is correct
36 Correct 26 ms 10220 KB Output is correct
37 Correct 21 ms 10220 KB Output is correct
38 Correct 21 ms 10220 KB Output is correct
39 Correct 38 ms 13896 KB Output is correct
40 Correct 38 ms 13804 KB Output is correct
41 Correct 40 ms 13932 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 5 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 6 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 5 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 5 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 7 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 5 ms 7404 KB Output is correct
69 Correct 6 ms 7404 KB Output is correct
70 Correct 6 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 6 ms 7404 KB Output is correct
74 Correct 6 ms 7532 KB Output is correct
75 Correct 6 ms 7404 KB Output is correct
76 Correct 6 ms 7532 KB Output is correct
77 Correct 6 ms 7404 KB Output is correct
78 Correct 6 ms 7532 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 9 ms 7916 KB Output is correct
83 Correct 7 ms 7916 KB Output is correct
84 Correct 8 ms 7916 KB Output is correct
85 Correct 8 ms 7788 KB Output is correct
86 Correct 8 ms 7788 KB Output is correct
87 Correct 9 ms 7788 KB Output is correct
88 Correct 7 ms 7660 KB Output is correct
89 Correct 8 ms 7788 KB Output is correct
90 Correct 7 ms 7660 KB Output is correct
91 Correct 29 ms 10732 KB Output is correct
92 Correct 26 ms 11244 KB Output is correct
93 Correct 36 ms 11768 KB Output is correct
94 Correct 10 ms 8428 KB Output is correct
95 Correct 10 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 10 ms 8428 KB Output is correct
99 Correct 9 ms 7788 KB Output is correct
100 Correct 8 ms 7788 KB Output is correct
101 Correct 8 ms 7788 KB Output is correct
102 Correct 8 ms 7788 KB Output is correct
103 Correct 8 ms 7788 KB Output is correct
104 Correct 8 ms 7788 KB Output is correct
105 Correct 41 ms 12012 KB Output is correct
106 Correct 47 ms 12012 KB Output is correct
107 Correct 40 ms 12140 KB Output is correct
108 Correct 14 ms 9068 KB Output is correct
109 Correct 507 ms 124524 KB Output is correct
110 Correct 172 ms 57536 KB Output is correct
111 Correct 144 ms 54252 KB Output is correct
112 Correct 182 ms 69996 KB Output is correct
113 Correct 103 ms 38124 KB Output is correct
114 Correct 25 ms 10092 KB Output is correct
115 Correct 26 ms 9964 KB Output is correct
116 Correct 32 ms 11244 KB Output is correct
117 Correct 26 ms 10220 KB Output is correct
118 Correct 27 ms 10348 KB Output is correct
119 Correct 30 ms 9836 KB Output is correct
120 Correct 31 ms 11372 KB Output is correct
121 Correct 17 ms 8940 KB Output is correct
122 Correct 42 ms 11756 KB Output is correct
123 Correct 14 ms 8812 KB Output is correct
124 Correct 46 ms 12996 KB Output is correct
125 Correct 20 ms 9708 KB Output is correct
126 Correct 17 ms 9416 KB Output is correct
127 Correct 20 ms 10092 KB Output is correct
128 Correct 16 ms 9196 KB Output is correct
129 Correct 17 ms 9324 KB Output is correct
130 Correct 16 ms 9068 KB Output is correct
131 Correct 694 ms 168940 KB Output is correct
132 Correct 269 ms 88704 KB Output is correct
133 Correct 241 ms 88812 KB Output is correct
134 Correct 222 ms 88684 KB Output is correct
135 Correct 219 ms 80748 KB Output is correct
136 Correct 36 ms 11628 KB Output is correct
137 Correct 36 ms 11628 KB Output is correct
138 Correct 35 ms 11628 KB Output is correct
139 Correct 39 ms 11756 KB Output is correct
140 Correct 35 ms 11628 KB Output is correct
141 Correct 35 ms 11628 KB Output is correct
142 Correct 56 ms 14060 KB Output is correct
143 Correct 22 ms 10012 KB Output is correct
144 Correct 53 ms 14060 KB Output is correct
145 Correct 21 ms 9964 KB Output is correct
146 Correct 57 ms 14108 KB Output is correct
147 Correct 21 ms 9964 KB Output is correct
148 Correct 23 ms 10348 KB Output is correct
149 Correct 23 ms 10348 KB Output is correct
150 Correct 22 ms 10220 KB Output is correct
151 Correct 24 ms 10220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7404 KB Output is correct
2 Correct 7 ms 7404 KB Output is correct
3 Correct 6 ms 7404 KB Output is correct
4 Correct 5 ms 7404 KB Output is correct
5 Correct 6 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 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 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 6 ms 7404 KB Output is correct
19 Correct 6 ms 7416 KB Output is correct
20 Correct 6 ms 7404 KB Output is correct
21 Correct 6 ms 7532 KB Output is correct
22 Correct 6 ms 7532 KB Output is correct
23 Correct 6 ms 7532 KB Output is correct
24 Correct 28 ms 11884 KB Output is correct
25 Correct 29 ms 11884 KB Output is correct
26 Correct 30 ms 11884 KB Output is correct
27 Correct 12 ms 9088 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 12 ms 9068 KB Output is correct
32 Correct 12 ms 9068 KB Output is correct
33 Correct 22 ms 10240 KB Output is correct
34 Correct 22 ms 10220 KB Output is correct
35 Correct 22 ms 10220 KB Output is correct
36 Correct 26 ms 10220 KB Output is correct
37 Correct 21 ms 10220 KB Output is correct
38 Correct 21 ms 10220 KB Output is correct
39 Correct 38 ms 13896 KB Output is correct
40 Correct 38 ms 13804 KB Output is correct
41 Correct 40 ms 13932 KB Output is correct
42 Correct 39 ms 14984 KB Output is correct
43 Correct 27 ms 12044 KB Output is correct
44 Correct 38 ms 15464 KB Output is correct
45 Correct 26 ms 12652 KB Output is correct
46 Correct 25 ms 12160 KB Output is correct
47 Correct 43 ms 15588 KB Output is correct
48 Correct 101 ms 24344 KB Output is correct
49 Correct 53 ms 17296 KB Output is correct
50 Correct 55 ms 20112 KB Output is correct
51 Correct 65 ms 20604 KB Output is correct
52 Correct 71 ms 21336 KB Output is correct
53 Correct 62 ms 19144 KB Output is correct
54 Correct 41 ms 15588 KB Output is correct
55 Correct 42 ms 15588 KB Output is correct
56 Correct 38 ms 15588 KB Output is correct
57 Correct 38 ms 15588 KB Output is correct
58 Correct 37 ms 15588 KB Output is correct
59 Correct 38 ms 15588 KB Output is correct
60 Correct 94 ms 26084 KB Output is correct
61 Correct 95 ms 26212 KB Output is correct
62 Correct 93 ms 26084 KB Output is correct
63 Correct 95 ms 26104 KB Output is correct
64 Correct 91 ms 26084 KB Output is correct
65 Correct 93 ms 26084 KB Output is correct
66 Correct 93 ms 25188 KB Output is correct
67 Correct 98 ms 25316 KB Output is correct
68 Correct 102 ms 25188 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 5 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 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 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 5 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 5 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 7 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 5 ms 7404 KB Output is correct
96 Correct 6 ms 7404 KB Output is correct
97 Correct 6 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 6 ms 7404 KB Output is correct
101 Correct 6 ms 7532 KB Output is correct
102 Correct 6 ms 7404 KB Output is correct
103 Correct 6 ms 7532 KB Output is correct
104 Correct 6 ms 7404 KB Output is correct
105 Correct 6 ms 7532 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 9 ms 7916 KB Output is correct
110 Correct 7 ms 7916 KB Output is correct
111 Correct 8 ms 7916 KB Output is correct
112 Correct 8 ms 7788 KB Output is correct
113 Correct 8 ms 7788 KB Output is correct
114 Correct 9 ms 7788 KB Output is correct
115 Correct 7 ms 7660 KB Output is correct
116 Correct 8 ms 7788 KB Output is correct
117 Correct 7 ms 7660 KB Output is correct
118 Correct 29 ms 10732 KB Output is correct
119 Correct 26 ms 11244 KB Output is correct
120 Correct 36 ms 11768 KB Output is correct
121 Correct 10 ms 8428 KB Output is correct
122 Correct 10 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 10 ms 8428 KB Output is correct
126 Correct 9 ms 7788 KB Output is correct
127 Correct 8 ms 7788 KB Output is correct
128 Correct 8 ms 7788 KB Output is correct
129 Correct 8 ms 7788 KB Output is correct
130 Correct 8 ms 7788 KB Output is correct
131 Correct 8 ms 7788 KB Output is correct
132 Correct 41 ms 12012 KB Output is correct
133 Correct 47 ms 12012 KB Output is correct
134 Correct 40 ms 12140 KB Output is correct
135 Correct 14 ms 9068 KB Output is correct
136 Correct 507 ms 124524 KB Output is correct
137 Correct 172 ms 57536 KB Output is correct
138 Correct 144 ms 54252 KB Output is correct
139 Correct 182 ms 69996 KB Output is correct
140 Correct 103 ms 38124 KB Output is correct
141 Correct 25 ms 10092 KB Output is correct
142 Correct 26 ms 9964 KB Output is correct
143 Correct 32 ms 11244 KB Output is correct
144 Correct 26 ms 10220 KB Output is correct
145 Correct 27 ms 10348 KB Output is correct
146 Correct 30 ms 9836 KB Output is correct
147 Correct 31 ms 11372 KB Output is correct
148 Correct 17 ms 8940 KB Output is correct
149 Correct 42 ms 11756 KB Output is correct
150 Correct 14 ms 8812 KB Output is correct
151 Correct 46 ms 12996 KB Output is correct
152 Correct 20 ms 9708 KB Output is correct
153 Correct 17 ms 9416 KB Output is correct
154 Correct 20 ms 10092 KB Output is correct
155 Correct 16 ms 9196 KB Output is correct
156 Correct 17 ms 9324 KB Output is correct
157 Correct 16 ms 9068 KB Output is correct
158 Correct 694 ms 168940 KB Output is correct
159 Correct 269 ms 88704 KB Output is correct
160 Correct 241 ms 88812 KB Output is correct
161 Correct 222 ms 88684 KB Output is correct
162 Correct 219 ms 80748 KB Output is correct
163 Correct 36 ms 11628 KB Output is correct
164 Correct 36 ms 11628 KB Output is correct
165 Correct 35 ms 11628 KB Output is correct
166 Correct 39 ms 11756 KB Output is correct
167 Correct 35 ms 11628 KB Output is correct
168 Correct 35 ms 11628 KB Output is correct
169 Correct 56 ms 14060 KB Output is correct
170 Correct 22 ms 10012 KB Output is correct
171 Correct 53 ms 14060 KB Output is correct
172 Correct 21 ms 9964 KB Output is correct
173 Correct 57 ms 14108 KB Output is correct
174 Correct 21 ms 9964 KB Output is correct
175 Correct 23 ms 10348 KB Output is correct
176 Correct 23 ms 10348 KB Output is correct
177 Correct 22 ms 10220 KB Output is correct
178 Correct 24 ms 10220 KB Output is correct
179 Correct 35 ms 12684 KB Output is correct
180 Correct 1315 ms 218536 KB Output is correct
181 Correct 875 ms 313156 KB Output is correct
182 Correct 1151 ms 409776 KB Output is correct
183 Correct 620 ms 205920 KB Output is correct
184 Correct 490 ms 135672 KB Output is correct
185 Correct 62 ms 15392 KB Output is correct
186 Correct 63 ms 17776 KB Output is correct
187 Correct 68 ms 16764 KB Output is correct
188 Correct 76 ms 18580 KB Output is correct
189 Correct 91 ms 18548 KB Output is correct
190 Correct 80 ms 19644 KB Output is correct
191 Correct 76 ms 18876 KB Output is correct
192 Correct 56 ms 16488 KB Output is correct
193 Correct 59 ms 15848 KB Output is correct
194 Correct 50 ms 15588 KB Output is correct
195 Runtime error 1205 ms 524292 KB Execution killed with signal 9
196 Halted 0 ms 0 KB -