Submission #1049112

# Submission time Handle Problem Language Result Execution time Memory
1049112 2024-08-08T13:28:17 Z rainboy Brought Down the Grading Server? (CEOI23_balance) C
100 / 100
211 ms 36516 KB
#include <stdio.h>
#include <stdlib.h>

#define N	100000
#define M	500000
#define M_	(M + N / 2)

int ij[M_]; char used[M_];
int *eh[N], eo[N], n, m, k;
int ii_[N], n_;

void append(int i, int h) {
	int o = eo[i]++;

	if (o == 0) {
		eh[i] = (int *) malloc(2 * sizeof *eh[i]);
		ii_[n_++] = i;
	} else if (o >= 2 && (o & o - 1) == 0)
		eh[i] = (int *) realloc(eh[i], o * 2 * sizeof *eh[i]);
	eh[i][o] = h;
}

int hh[M_], cnt;

void dfs(int i) {
	while (eo[i]) {
		int h = eh[i][--eo[i]], j = i ^ ij[h];

		if (!used[h])
			used[h] = 1, dfs(j), hh[cnt++] = h;
	}
}

void solve(int *ii, int m) {
	int g, h, h_, i, i_, j, j_;

	if (m == 1)
		return;
	m /= 2;
	n_ = 0;
	for (h = 0; h < m; h++)
		for (g = 0; g < k; g++) {
			h_ = h * k + g, i = ii[h_], j = ii[m * k + h_];
			ij[h_] = i ^ j, used[h_] = 0, append(i, h_), append(j, h_);
		}
	for (i_ = -1, j = 0, h_ = m * k; j < n_; j++) {
		j_ = ii_[j];
		if (eo[j_] % 2 != 0) {
			if (i_ == -1)
				i_ = j_;
			else {
				ij[h_] = i_ ^ j_, used[h_] = 0, append(i_, h_), append(j_, h_), h_++;
				i_ = -1;
			}
		}
	}
	for (i = 0; i < n_; i++) {
		i_ = ii_[i];
		cnt = 0, dfs(i_);
		while (cnt--) {
			h_ = hh[cnt], j_ = i_ ^ ij[h_];
			if (h_ < m * k) {
				h = h_ / k, g = h_ % k;
				ii[h_] = i_, ii[m * k + h_] = j_;
			}
			i_ = j_;
		}
	}
	for (i = 0; i < n_; i++) {
		i_ = ii_[i];
		free(eh[i_]), eh[i_] = NULL, eo[i_] = 0;
	}
	solve(ii, m), solve(ii + m * k, m);
}

int main() {
	static int ii[M];
	int g, h;

	scanf("%d%d%d", &k, &m, &n);
	for (g = 0; g < k; g++)
		for (h = 0; h < m; h++)
			scanf("%d", &ii[h * k + g]), ii[h * k + g]--;
	solve(ii, m);
	for (g = 0; g < k; g++) {
		for (h = 0; h < m; h++)
			printf("%d ", ii[h * k + g] + 1);
		printf("\n");
	}
	return 0;
}

Compilation message

balance.c: In function 'append':
balance.c:18:30: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   18 |  } else if (o >= 2 && (o & o - 1) == 0)
      |                            ~~^~~
balance.c: In function 'main':
balance.c:80:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   80 |  scanf("%d%d%d", &k, &m, &n);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
balance.c:83:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   83 |    scanf("%d", &ii[h * k + g]), ii[h * k + g]--;
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 0 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 1 ms 6492 KB Correct
3 Correct 0 ms 6492 KB Correct
4 Correct 0 ms 348 KB Correct
5 Correct 0 ms 348 KB Correct
6 Correct 0 ms 348 KB Correct
7 Correct 0 ms 348 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 14316 KB Correct
2 Correct 37 ms 16396 KB Correct
3 Correct 50 ms 12952 KB Correct
4 Correct 24 ms 14868 KB Correct
5 Correct 53 ms 13256 KB Correct
6 Correct 38 ms 14932 KB Correct
7 Correct 31 ms 10836 KB Correct
8 Correct 37 ms 17488 KB Correct
9 Correct 31 ms 17488 KB Correct
10 Correct 28 ms 15216 KB Correct
11 Correct 28 ms 18524 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 14316 KB Correct
2 Correct 37 ms 16396 KB Correct
3 Correct 50 ms 12952 KB Correct
4 Correct 24 ms 14868 KB Correct
5 Correct 53 ms 13256 KB Correct
6 Correct 38 ms 14932 KB Correct
7 Correct 31 ms 10836 KB Correct
8 Correct 37 ms 17488 KB Correct
9 Correct 31 ms 17488 KB Correct
10 Correct 28 ms 15216 KB Correct
11 Correct 28 ms 18524 KB Correct
12 Correct 42 ms 17688 KB Correct
13 Correct 32 ms 13988 KB Correct
14 Correct 32 ms 11348 KB Correct
15 Correct 23 ms 14684 KB Correct
16 Correct 32 ms 13164 KB Correct
17 Correct 37 ms 14932 KB Correct
18 Correct 31 ms 8724 KB Correct
19 Correct 31 ms 15424 KB Correct
20 Correct 32 ms 15156 KB Correct
21 Correct 48 ms 15444 KB Correct
22 Correct 28 ms 15184 KB Correct
23 Correct 41 ms 16464 KB Correct
24 Correct 23 ms 9820 KB Correct
25 Correct 59 ms 13652 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 1 ms 6492 KB Correct
3 Correct 0 ms 6492 KB Correct
4 Correct 0 ms 348 KB Correct
5 Correct 0 ms 348 KB Correct
6 Correct 0 ms 348 KB Correct
7 Correct 0 ms 348 KB Correct
8 Correct 40 ms 14316 KB Correct
9 Correct 37 ms 16396 KB Correct
10 Correct 50 ms 12952 KB Correct
11 Correct 24 ms 14868 KB Correct
12 Correct 53 ms 13256 KB Correct
13 Correct 38 ms 14932 KB Correct
14 Correct 31 ms 10836 KB Correct
15 Correct 37 ms 17488 KB Correct
16 Correct 31 ms 17488 KB Correct
17 Correct 28 ms 15216 KB Correct
18 Correct 28 ms 18524 KB Correct
19 Correct 42 ms 17688 KB Correct
20 Correct 32 ms 13988 KB Correct
21 Correct 32 ms 11348 KB Correct
22 Correct 23 ms 14684 KB Correct
23 Correct 32 ms 13164 KB Correct
24 Correct 37 ms 14932 KB Correct
25 Correct 31 ms 8724 KB Correct
26 Correct 31 ms 15424 KB Correct
27 Correct 32 ms 15156 KB Correct
28 Correct 48 ms 15444 KB Correct
29 Correct 28 ms 15184 KB Correct
30 Correct 41 ms 16464 KB Correct
31 Correct 23 ms 9820 KB Correct
32 Correct 59 ms 13652 KB Correct
33 Correct 0 ms 344 KB Correct
34 Correct 0 ms 348 KB Correct
35 Correct 0 ms 348 KB Correct
36 Correct 0 ms 348 KB Correct
37 Correct 0 ms 348 KB Correct
38 Correct 0 ms 348 KB Correct
39 Correct 0 ms 348 KB Correct
40 Correct 36 ms 14112 KB Correct
41 Correct 36 ms 17584 KB Correct
42 Correct 31 ms 15888 KB Correct
43 Correct 22 ms 14680 KB Correct
44 Correct 29 ms 16924 KB Correct
45 Correct 43 ms 18256 KB Correct
46 Correct 30 ms 12052 KB Correct
47 Correct 34 ms 18512 KB Correct
48 Correct 30 ms 18512 KB Correct
49 Correct 27 ms 18768 KB Correct
50 Correct 54 ms 18504 KB Correct
51 Correct 67 ms 19792 KB Correct
52 Correct 26 ms 14672 KB Correct
53 Correct 63 ms 17944 KB Correct
54 Correct 21 ms 13904 KB Correct
55 Correct 1 ms 6492 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Correct
2 Correct 5 ms 7000 KB Correct
3 Correct 3 ms 6748 KB Correct
4 Correct 2 ms 7004 KB Correct
5 Correct 3 ms 7000 KB Correct
6 Correct 2 ms 7004 KB Correct
7 Correct 2 ms 7004 KB Correct
8 Correct 2 ms 6848 KB Correct
9 Correct 3 ms 6744 KB Correct
10 Correct 2 ms 7004 KB Correct
11 Correct 2 ms 6884 KB Correct
12 Correct 2 ms 7096 KB Correct
13 Correct 2 ms 7004 KB Correct
14 Correct 3 ms 7000 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Correct
2 Correct 5 ms 7000 KB Correct
3 Correct 3 ms 6748 KB Correct
4 Correct 2 ms 7004 KB Correct
5 Correct 3 ms 7000 KB Correct
6 Correct 2 ms 7004 KB Correct
7 Correct 2 ms 7004 KB Correct
8 Correct 2 ms 6848 KB Correct
9 Correct 3 ms 6744 KB Correct
10 Correct 2 ms 7004 KB Correct
11 Correct 2 ms 6884 KB Correct
12 Correct 2 ms 7096 KB Correct
13 Correct 2 ms 7004 KB Correct
14 Correct 3 ms 7000 KB Correct
15 Correct 0 ms 348 KB Correct
16 Correct 2 ms 860 KB Correct
17 Correct 3 ms 860 KB Correct
18 Correct 3 ms 856 KB Correct
19 Correct 2 ms 860 KB Correct
20 Correct 2 ms 1116 KB Correct
21 Correct 2 ms 860 KB Correct
22 Correct 3 ms 1024 KB Correct
23 Correct 2 ms 856 KB Correct
24 Correct 2 ms 856 KB Correct
25 Correct 3 ms 860 KB Correct
26 Correct 2 ms 1112 KB Correct
27 Correct 3 ms 1116 KB Correct
28 Correct 2 ms 1116 KB Correct
29 Correct 4 ms 860 KB Correct
30 Correct 2 ms 956 KB Correct
31 Correct 2 ms 856 KB Correct
32 Correct 2 ms 860 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6492 KB Correct
2 Correct 5 ms 7000 KB Correct
3 Correct 3 ms 6748 KB Correct
4 Correct 2 ms 7004 KB Correct
5 Correct 3 ms 7000 KB Correct
6 Correct 2 ms 7004 KB Correct
7 Correct 2 ms 7004 KB Correct
8 Correct 2 ms 6848 KB Correct
9 Correct 3 ms 6744 KB Correct
10 Correct 2 ms 7004 KB Correct
11 Correct 2 ms 6884 KB Correct
12 Correct 2 ms 7096 KB Correct
13 Correct 2 ms 7004 KB Correct
14 Correct 3 ms 7000 KB Correct
15 Correct 0 ms 348 KB Correct
16 Correct 2 ms 860 KB Correct
17 Correct 3 ms 860 KB Correct
18 Correct 3 ms 856 KB Correct
19 Correct 2 ms 860 KB Correct
20 Correct 2 ms 1116 KB Correct
21 Correct 2 ms 860 KB Correct
22 Correct 3 ms 1024 KB Correct
23 Correct 2 ms 856 KB Correct
24 Correct 2 ms 856 KB Correct
25 Correct 3 ms 860 KB Correct
26 Correct 2 ms 1112 KB Correct
27 Correct 3 ms 1116 KB Correct
28 Correct 2 ms 1116 KB Correct
29 Correct 4 ms 860 KB Correct
30 Correct 2 ms 956 KB Correct
31 Correct 2 ms 856 KB Correct
32 Correct 2 ms 860 KB Correct
33 Correct 0 ms 348 KB Correct
34 Correct 2 ms 860 KB Correct
35 Correct 3 ms 856 KB Correct
36 Correct 2 ms 860 KB Correct
37 Correct 2 ms 860 KB Correct
38 Correct 2 ms 7004 KB Correct
39 Correct 2 ms 7004 KB Correct
40 Correct 4 ms 7028 KB Correct
41 Correct 3 ms 6748 KB Correct
42 Correct 3 ms 7000 KB Correct
43 Correct 3 ms 6748 KB Correct
44 Correct 2 ms 7096 KB Correct
45 Correct 3 ms 7000 KB Correct
46 Correct 2 ms 7004 KB Correct
47 Correct 2 ms 7004 KB Correct
48 Correct 2 ms 7132 KB Correct
49 Correct 3 ms 7004 KB Correct
50 Correct 2 ms 6880 KB Correct
51 Correct 1 ms 6492 KB Correct
52 Correct 1 ms 6492 KB Correct
53 Correct 1 ms 6492 KB Correct
54 Correct 1 ms 6492 KB Correct
55 Correct 1 ms 6492 KB Correct
56 Correct 1 ms 6492 KB Correct
57 Correct 1 ms 6568 KB Correct
58 Correct 5 ms 7260 KB Correct
59 Correct 5 ms 7000 KB Correct
60 Correct 4 ms 7240 KB Correct
61 Correct 4 ms 6884 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 14316 KB Correct
2 Correct 37 ms 16396 KB Correct
3 Correct 50 ms 12952 KB Correct
4 Correct 24 ms 14868 KB Correct
5 Correct 53 ms 13256 KB Correct
6 Correct 38 ms 14932 KB Correct
7 Correct 31 ms 10836 KB Correct
8 Correct 37 ms 17488 KB Correct
9 Correct 31 ms 17488 KB Correct
10 Correct 28 ms 15216 KB Correct
11 Correct 28 ms 18524 KB Correct
12 Correct 1 ms 6492 KB Correct
13 Correct 5 ms 7000 KB Correct
14 Correct 3 ms 6748 KB Correct
15 Correct 2 ms 7004 KB Correct
16 Correct 3 ms 7000 KB Correct
17 Correct 2 ms 7004 KB Correct
18 Correct 2 ms 7004 KB Correct
19 Correct 2 ms 6848 KB Correct
20 Correct 3 ms 6744 KB Correct
21 Correct 2 ms 7004 KB Correct
22 Correct 2 ms 6884 KB Correct
23 Correct 2 ms 7096 KB Correct
24 Correct 2 ms 7004 KB Correct
25 Correct 3 ms 7000 KB Correct
26 Correct 39 ms 17684 KB Correct
27 Correct 31 ms 17528 KB Correct
28 Correct 30 ms 15964 KB Correct
29 Correct 22 ms 14680 KB Correct
30 Correct 29 ms 16848 KB Correct
31 Correct 36 ms 18260 KB Correct
32 Correct 31 ms 11860 KB Correct
33 Correct 30 ms 18772 KB Correct
34 Correct 30 ms 18512 KB Correct
35 Correct 27 ms 18516 KB Correct
36 Correct 28 ms 18464 KB Correct
37 Correct 1 ms 6492 KB Correct
38 Correct 3 ms 7004 KB Correct
39 Correct 3 ms 6748 KB Correct
40 Correct 2 ms 7004 KB Correct
41 Correct 1 ms 7004 KB Correct
42 Correct 2 ms 7004 KB Correct
43 Correct 2 ms 7004 KB Correct
44 Correct 3 ms 7028 KB Correct
45 Correct 2 ms 6748 KB Correct
46 Correct 2 ms 7008 KB Correct
47 Correct 2 ms 6748 KB Correct
48 Correct 2 ms 7100 KB Correct
49 Correct 2 ms 7004 KB Correct
50 Correct 2 ms 7004 KB Correct
51 Correct 139 ms 32852 KB Correct
52 Correct 137 ms 28244 KB Correct
53 Correct 36 ms 10588 KB Correct
54 Correct 44 ms 15408 KB Correct
55 Correct 123 ms 26252 KB Correct
56 Correct 125 ms 32116 KB Correct
57 Correct 133 ms 33444 KB Correct
58 Correct 145 ms 27836 KB Correct
59 Correct 134 ms 23636 KB Correct
60 Correct 109 ms 29776 KB Correct
61 Correct 135 ms 31828 KB Correct
62 Correct 61 ms 22108 KB Correct
63 Correct 61 ms 22100 KB Correct
64 Correct 63 ms 28444 KB Correct
65 Correct 58 ms 28244 KB Correct
66 Correct 55 ms 22156 KB Correct
67 Correct 56 ms 22100 KB Correct
68 Correct 60 ms 28244 KB Correct
69 Correct 59 ms 28380 KB Correct
70 Correct 73 ms 22020 KB Correct
71 Correct 77 ms 24120 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 14316 KB Correct
2 Correct 37 ms 16396 KB Correct
3 Correct 50 ms 12952 KB Correct
4 Correct 24 ms 14868 KB Correct
5 Correct 53 ms 13256 KB Correct
6 Correct 38 ms 14932 KB Correct
7 Correct 31 ms 10836 KB Correct
8 Correct 37 ms 17488 KB Correct
9 Correct 31 ms 17488 KB Correct
10 Correct 28 ms 15216 KB Correct
11 Correct 28 ms 18524 KB Correct
12 Correct 42 ms 17688 KB Correct
13 Correct 32 ms 13988 KB Correct
14 Correct 32 ms 11348 KB Correct
15 Correct 23 ms 14684 KB Correct
16 Correct 32 ms 13164 KB Correct
17 Correct 37 ms 14932 KB Correct
18 Correct 31 ms 8724 KB Correct
19 Correct 31 ms 15424 KB Correct
20 Correct 32 ms 15156 KB Correct
21 Correct 48 ms 15444 KB Correct
22 Correct 28 ms 15184 KB Correct
23 Correct 41 ms 16464 KB Correct
24 Correct 23 ms 9820 KB Correct
25 Correct 59 ms 13652 KB Correct
26 Correct 1 ms 6492 KB Correct
27 Correct 5 ms 7000 KB Correct
28 Correct 3 ms 6748 KB Correct
29 Correct 2 ms 7004 KB Correct
30 Correct 3 ms 7000 KB Correct
31 Correct 2 ms 7004 KB Correct
32 Correct 2 ms 7004 KB Correct
33 Correct 2 ms 6848 KB Correct
34 Correct 3 ms 6744 KB Correct
35 Correct 2 ms 7004 KB Correct
36 Correct 2 ms 6884 KB Correct
37 Correct 2 ms 7096 KB Correct
38 Correct 2 ms 7004 KB Correct
39 Correct 3 ms 7000 KB Correct
40 Correct 0 ms 348 KB Correct
41 Correct 2 ms 860 KB Correct
42 Correct 3 ms 860 KB Correct
43 Correct 3 ms 856 KB Correct
44 Correct 2 ms 860 KB Correct
45 Correct 2 ms 1116 KB Correct
46 Correct 2 ms 860 KB Correct
47 Correct 3 ms 1024 KB Correct
48 Correct 2 ms 856 KB Correct
49 Correct 2 ms 856 KB Correct
50 Correct 3 ms 860 KB Correct
51 Correct 2 ms 1112 KB Correct
52 Correct 3 ms 1116 KB Correct
53 Correct 2 ms 1116 KB Correct
54 Correct 4 ms 860 KB Correct
55 Correct 2 ms 956 KB Correct
56 Correct 2 ms 856 KB Correct
57 Correct 2 ms 860 KB Correct
58 Correct 39 ms 17684 KB Correct
59 Correct 31 ms 17528 KB Correct
60 Correct 30 ms 15964 KB Correct
61 Correct 22 ms 14680 KB Correct
62 Correct 29 ms 16848 KB Correct
63 Correct 36 ms 18260 KB Correct
64 Correct 31 ms 11860 KB Correct
65 Correct 30 ms 18772 KB Correct
66 Correct 30 ms 18512 KB Correct
67 Correct 27 ms 18516 KB Correct
68 Correct 28 ms 18464 KB Correct
69 Correct 1 ms 6492 KB Correct
70 Correct 3 ms 7004 KB Correct
71 Correct 3 ms 6748 KB Correct
72 Correct 2 ms 7004 KB Correct
73 Correct 1 ms 7004 KB Correct
74 Correct 2 ms 7004 KB Correct
75 Correct 2 ms 7004 KB Correct
76 Correct 3 ms 7028 KB Correct
77 Correct 2 ms 6748 KB Correct
78 Correct 2 ms 7008 KB Correct
79 Correct 2 ms 6748 KB Correct
80 Correct 2 ms 7100 KB Correct
81 Correct 2 ms 7004 KB Correct
82 Correct 2 ms 7004 KB Correct
83 Correct 139 ms 32852 KB Correct
84 Correct 137 ms 28244 KB Correct
85 Correct 36 ms 10588 KB Correct
86 Correct 44 ms 15408 KB Correct
87 Correct 123 ms 26252 KB Correct
88 Correct 125 ms 32116 KB Correct
89 Correct 133 ms 33444 KB Correct
90 Correct 145 ms 27836 KB Correct
91 Correct 134 ms 23636 KB Correct
92 Correct 109 ms 29776 KB Correct
93 Correct 135 ms 31828 KB Correct
94 Correct 61 ms 22108 KB Correct
95 Correct 61 ms 22100 KB Correct
96 Correct 63 ms 28444 KB Correct
97 Correct 58 ms 28244 KB Correct
98 Correct 55 ms 22156 KB Correct
99 Correct 56 ms 22100 KB Correct
100 Correct 60 ms 28244 KB Correct
101 Correct 59 ms 28380 KB Correct
102 Correct 73 ms 22020 KB Correct
103 Correct 77 ms 24120 KB Correct
104 Correct 35 ms 17688 KB Correct
105 Correct 31 ms 17512 KB Correct
106 Correct 32 ms 15956 KB Correct
107 Correct 23 ms 14684 KB Correct
108 Correct 31 ms 16840 KB Correct
109 Correct 35 ms 18256 KB Correct
110 Correct 31 ms 12124 KB Correct
111 Correct 30 ms 18512 KB Correct
112 Correct 30 ms 18516 KB Correct
113 Correct 27 ms 18516 KB Correct
114 Correct 27 ms 18524 KB Correct
115 Correct 1 ms 6492 KB Correct
116 Correct 3 ms 7004 KB Correct
117 Correct 3 ms 6748 KB Correct
118 Correct 2 ms 7004 KB Correct
119 Correct 1 ms 7004 KB Correct
120 Correct 2 ms 7004 KB Correct
121 Correct 2 ms 7004 KB Correct
122 Correct 2 ms 7004 KB Correct
123 Correct 2 ms 6748 KB Correct
124 Correct 2 ms 7004 KB Correct
125 Correct 2 ms 6748 KB Correct
126 Correct 2 ms 7004 KB Correct
127 Correct 2 ms 7004 KB Correct
128 Correct 2 ms 7092 KB Correct
129 Correct 133 ms 33092 KB Correct
130 Correct 159 ms 28240 KB Correct
131 Correct 27 ms 10588 KB Correct
132 Correct 44 ms 15376 KB Correct
133 Correct 122 ms 26208 KB Correct
134 Correct 120 ms 31704 KB Correct
135 Correct 132 ms 33536 KB Correct
136 Correct 148 ms 27732 KB Correct
137 Correct 116 ms 23636 KB Correct
138 Correct 119 ms 29912 KB Correct
139 Correct 163 ms 31828 KB Correct
140 Correct 59 ms 22100 KB Correct
141 Correct 55 ms 22096 KB Correct
142 Correct 75 ms 28260 KB Correct
143 Correct 58 ms 28236 KB Correct
144 Correct 55 ms 22096 KB Correct
145 Correct 55 ms 22168 KB Correct
146 Correct 63 ms 28244 KB Correct
147 Correct 58 ms 28244 KB Correct
148 Correct 74 ms 22096 KB Correct
149 Correct 75 ms 24120 KB Correct
150 Correct 38 ms 19796 KB Correct
151 Correct 24 ms 14680 KB Correct
152 Correct 37 ms 18004 KB Correct
153 Correct 3 ms 7000 KB Correct
154 Correct 4 ms 7004 KB Correct
155 Correct 2 ms 7004 KB Correct
156 Correct 2 ms 6748 KB Correct
157 Correct 153 ms 35408 KB Correct
158 Correct 142 ms 29492 KB Correct
159 Correct 20 ms 11100 KB Correct
160 Correct 151 ms 35524 KB Correct
161 Correct 146 ms 35456 KB Correct
162 Correct 150 ms 29012 KB Correct
163 Correct 149 ms 28496 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct
2 Correct 0 ms 344 KB Correct
3 Correct 0 ms 344 KB Correct
4 Correct 1 ms 6492 KB Correct
5 Correct 0 ms 6492 KB Correct
6 Correct 0 ms 348 KB Correct
7 Correct 0 ms 348 KB Correct
8 Correct 0 ms 348 KB Correct
9 Correct 0 ms 348 KB Correct
10 Correct 40 ms 14316 KB Correct
11 Correct 37 ms 16396 KB Correct
12 Correct 50 ms 12952 KB Correct
13 Correct 24 ms 14868 KB Correct
14 Correct 53 ms 13256 KB Correct
15 Correct 38 ms 14932 KB Correct
16 Correct 31 ms 10836 KB Correct
17 Correct 37 ms 17488 KB Correct
18 Correct 31 ms 17488 KB Correct
19 Correct 28 ms 15216 KB Correct
20 Correct 28 ms 18524 KB Correct
21 Correct 42 ms 17688 KB Correct
22 Correct 32 ms 13988 KB Correct
23 Correct 32 ms 11348 KB Correct
24 Correct 23 ms 14684 KB Correct
25 Correct 32 ms 13164 KB Correct
26 Correct 37 ms 14932 KB Correct
27 Correct 31 ms 8724 KB Correct
28 Correct 31 ms 15424 KB Correct
29 Correct 32 ms 15156 KB Correct
30 Correct 48 ms 15444 KB Correct
31 Correct 28 ms 15184 KB Correct
32 Correct 41 ms 16464 KB Correct
33 Correct 23 ms 9820 KB Correct
34 Correct 59 ms 13652 KB Correct
35 Correct 0 ms 344 KB Correct
36 Correct 0 ms 348 KB Correct
37 Correct 0 ms 348 KB Correct
38 Correct 0 ms 348 KB Correct
39 Correct 0 ms 348 KB Correct
40 Correct 0 ms 348 KB Correct
41 Correct 0 ms 348 KB Correct
42 Correct 36 ms 14112 KB Correct
43 Correct 36 ms 17584 KB Correct
44 Correct 31 ms 15888 KB Correct
45 Correct 22 ms 14680 KB Correct
46 Correct 29 ms 16924 KB Correct
47 Correct 43 ms 18256 KB Correct
48 Correct 30 ms 12052 KB Correct
49 Correct 34 ms 18512 KB Correct
50 Correct 30 ms 18512 KB Correct
51 Correct 27 ms 18768 KB Correct
52 Correct 54 ms 18504 KB Correct
53 Correct 67 ms 19792 KB Correct
54 Correct 26 ms 14672 KB Correct
55 Correct 63 ms 17944 KB Correct
56 Correct 21 ms 13904 KB Correct
57 Correct 1 ms 6492 KB Correct
58 Correct 1 ms 6492 KB Correct
59 Correct 5 ms 7000 KB Correct
60 Correct 3 ms 6748 KB Correct
61 Correct 2 ms 7004 KB Correct
62 Correct 3 ms 7000 KB Correct
63 Correct 2 ms 7004 KB Correct
64 Correct 2 ms 7004 KB Correct
65 Correct 2 ms 6848 KB Correct
66 Correct 3 ms 6744 KB Correct
67 Correct 2 ms 7004 KB Correct
68 Correct 2 ms 6884 KB Correct
69 Correct 2 ms 7096 KB Correct
70 Correct 2 ms 7004 KB Correct
71 Correct 3 ms 7000 KB Correct
72 Correct 0 ms 348 KB Correct
73 Correct 2 ms 860 KB Correct
74 Correct 3 ms 860 KB Correct
75 Correct 3 ms 856 KB Correct
76 Correct 2 ms 860 KB Correct
77 Correct 2 ms 1116 KB Correct
78 Correct 2 ms 860 KB Correct
79 Correct 3 ms 1024 KB Correct
80 Correct 2 ms 856 KB Correct
81 Correct 2 ms 856 KB Correct
82 Correct 3 ms 860 KB Correct
83 Correct 2 ms 1112 KB Correct
84 Correct 3 ms 1116 KB Correct
85 Correct 2 ms 1116 KB Correct
86 Correct 4 ms 860 KB Correct
87 Correct 2 ms 956 KB Correct
88 Correct 2 ms 856 KB Correct
89 Correct 2 ms 860 KB Correct
90 Correct 0 ms 348 KB Correct
91 Correct 2 ms 860 KB Correct
92 Correct 3 ms 856 KB Correct
93 Correct 2 ms 860 KB Correct
94 Correct 2 ms 860 KB Correct
95 Correct 2 ms 7004 KB Correct
96 Correct 2 ms 7004 KB Correct
97 Correct 4 ms 7028 KB Correct
98 Correct 3 ms 6748 KB Correct
99 Correct 3 ms 7000 KB Correct
100 Correct 3 ms 6748 KB Correct
101 Correct 2 ms 7096 KB Correct
102 Correct 3 ms 7000 KB Correct
103 Correct 2 ms 7004 KB Correct
104 Correct 2 ms 7004 KB Correct
105 Correct 2 ms 7132 KB Correct
106 Correct 3 ms 7004 KB Correct
107 Correct 2 ms 6880 KB Correct
108 Correct 1 ms 6492 KB Correct
109 Correct 1 ms 6492 KB Correct
110 Correct 1 ms 6492 KB Correct
111 Correct 1 ms 6492 KB Correct
112 Correct 1 ms 6492 KB Correct
113 Correct 1 ms 6492 KB Correct
114 Correct 1 ms 6568 KB Correct
115 Correct 5 ms 7260 KB Correct
116 Correct 5 ms 7000 KB Correct
117 Correct 4 ms 7240 KB Correct
118 Correct 4 ms 6884 KB Correct
119 Correct 39 ms 17684 KB Correct
120 Correct 31 ms 17528 KB Correct
121 Correct 30 ms 15964 KB Correct
122 Correct 22 ms 14680 KB Correct
123 Correct 29 ms 16848 KB Correct
124 Correct 36 ms 18260 KB Correct
125 Correct 31 ms 11860 KB Correct
126 Correct 30 ms 18772 KB Correct
127 Correct 30 ms 18512 KB Correct
128 Correct 27 ms 18516 KB Correct
129 Correct 28 ms 18464 KB Correct
130 Correct 1 ms 6492 KB Correct
131 Correct 3 ms 7004 KB Correct
132 Correct 3 ms 6748 KB Correct
133 Correct 2 ms 7004 KB Correct
134 Correct 1 ms 7004 KB Correct
135 Correct 2 ms 7004 KB Correct
136 Correct 2 ms 7004 KB Correct
137 Correct 3 ms 7028 KB Correct
138 Correct 2 ms 6748 KB Correct
139 Correct 2 ms 7008 KB Correct
140 Correct 2 ms 6748 KB Correct
141 Correct 2 ms 7100 KB Correct
142 Correct 2 ms 7004 KB Correct
143 Correct 2 ms 7004 KB Correct
144 Correct 139 ms 32852 KB Correct
145 Correct 137 ms 28244 KB Correct
146 Correct 36 ms 10588 KB Correct
147 Correct 44 ms 15408 KB Correct
148 Correct 123 ms 26252 KB Correct
149 Correct 125 ms 32116 KB Correct
150 Correct 133 ms 33444 KB Correct
151 Correct 145 ms 27836 KB Correct
152 Correct 134 ms 23636 KB Correct
153 Correct 109 ms 29776 KB Correct
154 Correct 135 ms 31828 KB Correct
155 Correct 61 ms 22108 KB Correct
156 Correct 61 ms 22100 KB Correct
157 Correct 63 ms 28444 KB Correct
158 Correct 58 ms 28244 KB Correct
159 Correct 55 ms 22156 KB Correct
160 Correct 56 ms 22100 KB Correct
161 Correct 60 ms 28244 KB Correct
162 Correct 59 ms 28380 KB Correct
163 Correct 73 ms 22020 KB Correct
164 Correct 77 ms 24120 KB Correct
165 Correct 35 ms 17688 KB Correct
166 Correct 31 ms 17512 KB Correct
167 Correct 32 ms 15956 KB Correct
168 Correct 23 ms 14684 KB Correct
169 Correct 31 ms 16840 KB Correct
170 Correct 35 ms 18256 KB Correct
171 Correct 31 ms 12124 KB Correct
172 Correct 30 ms 18512 KB Correct
173 Correct 30 ms 18516 KB Correct
174 Correct 27 ms 18516 KB Correct
175 Correct 27 ms 18524 KB Correct
176 Correct 1 ms 6492 KB Correct
177 Correct 3 ms 7004 KB Correct
178 Correct 3 ms 6748 KB Correct
179 Correct 2 ms 7004 KB Correct
180 Correct 1 ms 7004 KB Correct
181 Correct 2 ms 7004 KB Correct
182 Correct 2 ms 7004 KB Correct
183 Correct 2 ms 7004 KB Correct
184 Correct 2 ms 6748 KB Correct
185 Correct 2 ms 7004 KB Correct
186 Correct 2 ms 6748 KB Correct
187 Correct 2 ms 7004 KB Correct
188 Correct 2 ms 7004 KB Correct
189 Correct 2 ms 7092 KB Correct
190 Correct 133 ms 33092 KB Correct
191 Correct 159 ms 28240 KB Correct
192 Correct 27 ms 10588 KB Correct
193 Correct 44 ms 15376 KB Correct
194 Correct 122 ms 26208 KB Correct
195 Correct 120 ms 31704 KB Correct
196 Correct 132 ms 33536 KB Correct
197 Correct 148 ms 27732 KB Correct
198 Correct 116 ms 23636 KB Correct
199 Correct 119 ms 29912 KB Correct
200 Correct 163 ms 31828 KB Correct
201 Correct 59 ms 22100 KB Correct
202 Correct 55 ms 22096 KB Correct
203 Correct 75 ms 28260 KB Correct
204 Correct 58 ms 28236 KB Correct
205 Correct 55 ms 22096 KB Correct
206 Correct 55 ms 22168 KB Correct
207 Correct 63 ms 28244 KB Correct
208 Correct 58 ms 28244 KB Correct
209 Correct 74 ms 22096 KB Correct
210 Correct 75 ms 24120 KB Correct
211 Correct 38 ms 19796 KB Correct
212 Correct 24 ms 14680 KB Correct
213 Correct 37 ms 18004 KB Correct
214 Correct 3 ms 7000 KB Correct
215 Correct 4 ms 7004 KB Correct
216 Correct 2 ms 7004 KB Correct
217 Correct 2 ms 6748 KB Correct
218 Correct 153 ms 35408 KB Correct
219 Correct 142 ms 29492 KB Correct
220 Correct 20 ms 11100 KB Correct
221 Correct 151 ms 35524 KB Correct
222 Correct 146 ms 35456 KB Correct
223 Correct 150 ms 29012 KB Correct
224 Correct 149 ms 28496 KB Correct
225 Correct 35 ms 17748 KB Correct
226 Correct 31 ms 17584 KB Correct
227 Correct 30 ms 15956 KB Correct
228 Correct 24 ms 14664 KB Correct
229 Correct 30 ms 16852 KB Correct
230 Correct 34 ms 18260 KB Correct
231 Correct 29 ms 12124 KB Correct
232 Correct 29 ms 18568 KB Correct
233 Correct 30 ms 18516 KB Correct
234 Correct 27 ms 18516 KB Correct
235 Correct 27 ms 18520 KB Correct
236 Correct 1 ms 6492 KB Correct
237 Correct 3 ms 7004 KB Correct
238 Correct 4 ms 6748 KB Correct
239 Correct 2 ms 7004 KB Correct
240 Correct 2 ms 7004 KB Correct
241 Correct 2 ms 7004 KB Correct
242 Correct 2 ms 7004 KB Correct
243 Correct 3 ms 7004 KB Correct
244 Correct 3 ms 6784 KB Correct
245 Correct 2 ms 7004 KB Correct
246 Correct 2 ms 6748 KB Correct
247 Correct 2 ms 7004 KB Correct
248 Correct 2 ms 7004 KB Correct
249 Correct 2 ms 7004 KB Correct
250 Correct 152 ms 32912 KB Correct
251 Correct 165 ms 28420 KB Correct
252 Correct 27 ms 10584 KB Correct
253 Correct 44 ms 15380 KB Correct
254 Correct 121 ms 26208 KB Correct
255 Correct 119 ms 31916 KB Correct
256 Correct 132 ms 33528 KB Correct
257 Correct 144 ms 27728 KB Correct
258 Correct 118 ms 23772 KB Correct
259 Correct 109 ms 29780 KB Correct
260 Correct 127 ms 31828 KB Correct
261 Correct 55 ms 22020 KB Correct
262 Correct 60 ms 22096 KB Correct
263 Correct 59 ms 28660 KB Correct
264 Correct 58 ms 28264 KB Correct
265 Correct 54 ms 22096 KB Correct
266 Correct 54 ms 22096 KB Correct
267 Correct 60 ms 28416 KB Correct
268 Correct 61 ms 28264 KB Correct
269 Correct 86 ms 22100 KB Correct
270 Correct 76 ms 24148 KB Correct
271 Correct 37 ms 19792 KB Correct
272 Correct 26 ms 14684 KB Correct
273 Correct 37 ms 18000 KB Correct
274 Correct 3 ms 7000 KB Correct
275 Correct 2 ms 7004 KB Correct
276 Correct 2 ms 6872 KB Correct
277 Correct 2 ms 6748 KB Correct
278 Correct 153 ms 35412 KB Correct
279 Correct 142 ms 29524 KB Correct
280 Correct 20 ms 11096 KB Correct
281 Correct 164 ms 35412 KB Correct
282 Correct 150 ms 35408 KB Correct
283 Correct 182 ms 29008 KB Correct
284 Correct 146 ms 28436 KB Correct
285 Correct 1 ms 6492 KB Correct
286 Correct 1 ms 6492 KB Correct
287 Correct 1 ms 6572 KB Correct
288 Correct 1 ms 6492 KB Correct
289 Correct 1 ms 6492 KB Correct
290 Correct 1 ms 6492 KB Correct
291 Correct 0 ms 6492 KB Correct
292 Correct 23 ms 13988 KB Correct
293 Correct 1 ms 6584 KB Correct
294 Correct 5 ms 7100 KB Correct
295 Correct 5 ms 7000 KB Correct
296 Correct 3 ms 7260 KB Correct
297 Correct 3 ms 6896 KB Correct
298 Correct 169 ms 36516 KB Correct
299 Correct 198 ms 26016 KB Correct
300 Correct 156 ms 24144 KB Correct
301 Correct 161 ms 24400 KB Correct
302 Correct 150 ms 23708 KB Correct
303 Correct 162 ms 32788 KB Correct
304 Correct 172 ms 31568 KB Correct
305 Correct 166 ms 31328 KB Correct
306 Correct 211 ms 29008 KB Correct
307 Correct 152 ms 30328 KB Correct