Submission #741147

# Submission time Handle Problem Language Result Execution time Memory
741147 2023-05-13T16:05:19 Z rainboy Mountains and Valleys (CCO20_day1problem3) C
13 / 25
8 ms 1492 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N	500000
#define M	2000000
#define INF	0x3f3f3f3f

int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }

int *ej[N], eo[N], n;
int ii[M], jj[M], ww[M], m;

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

	if (o >= 2 && (o & o - 1) == 0)
		ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
	ej[i][o] = j;
}

int d_, i_;

void dfs1(int p, int i, int d) {
	int o;

	if (d_ < d)
		d_ = d, i_ = i;
	for (o = eo[i]; o--; ) {
		int j = ej[i][o];

		if (j != p)
			dfs1(i, j, d + 1);
	}
}

int u, v;

int dfs2(int p, int i) {
	int o, s;

	s = 1;
	for (o = eo[i]; o--; ) {
		int j = ej[i][o];

		if (j != p)
			s += dfs2(i, j);
	}
	if (s * 3 <= n)
		return s;
	if (u == -1)
		u = i;
	else
		v = i;
	return 0;
}

int rr[N], dd[N], dp1[N], jj1[N][4], dp2[N], jj2[N][4], dq1[N], dq2[N];

void dfs3(int p, int i, int r, int d) {
	int o, g, g_;

	rr[i] = r, dd[i] = d, dp1[i] = 0;
	memset(jj1[i], -1, sizeof jj1[i]), memset(jj2[i], -1, sizeof jj2[i]);
	for (o = eo[i]; o--; ) {
		int j = ej[i][o];

		if (j != p) {
			dfs3(i, j, r == -1 ? j : r, d + 1);
			for (g = 0; g < 4; g++)
				if (jj1[i][g] == -1 || dp1[jj1[i][g]] < dp1[j]) {
					for (g_ = 3; g_ > g; g_--)
						jj1[i][g_] = jj1[i][g_ - 1];
					jj1[i][g] = j;
					break;
				}
			for (g = 0; g < 4; g++)
				if (jj2[i][g] == -1 || dp2[jj2[i][g]] < dp2[j]) {
					for (g_ = 3; g_ > g; g_--)
						jj2[i][g_] = jj2[i][g_ - 1];
					jj2[i][g] = j;
					break;
				}
		}
	}
	dp1[i] = dp2[i] = 0;
	dp1[i] = max(dp1[i], (jj1[i][0] == -1 ? 0 : dp1[jj1[i][0]] + 1));
	dp2[i] = max(dp2[i], (jj2[i][0] == -1 ? 0 : dp2[jj2[i][0]]));
	dp2[i] = max(dp2[i], (jj1[i][0] == -1 ? 0 : dp1[jj1[i][0]] + 1) + (jj1[i][1] == -1 ? 0 : dp1[jj1[i][1]] + 1));
}

void dfs4(int p, int i, int w, int x, int y, int z) {
	int o;

	if (p == -1)
		dq1[i] = dq2[i] = -INF;
	else
		dq1[i] = max(w, dp1[i] - dd[i]), dq2[i] = max(max(x + dp1[i], y) + 2, max(dp2[i], z));
	for (o = eo[i]; o--; ) {
		int j = ej[i][o], j_, j1, j2;

		if (j != p) {
			int w_, x_, y_, z_;

			w_ = w, x_ = x, y_ = y, z_ = z;
			if (p != -1) {
				j_ = j == jj1[i][0] ? jj1[i][1] : jj1[i][0];
				w_ = max(w_, (j_ == -1 ? 0 : dp1[j_] + 1) - dd[i]);
				x_ = max(x_, j_ == -1 ? 0 : dp1[j_] + 1);
				y_ = max(y_, x + (j_ == -1 ? 0 : dp1[j_] + 1));
				j_ = j == jj2[i][0] ? jj2[i][1] : jj2[i][0];
				z_ = max(z_, j_ == -1 ? 0 : dp2[j_]);
				if (j == jj1[i][0])
					j1 = jj1[i][1], j2 = jj1[i][2];
				else if (j == jj1[i][1])
					j1 = jj1[i][0], j2 = jj1[i][2];
				else
					j1 = jj1[i][0], j2 = jj1[i][1];
				z_ = max(z_, (j1 == -1 ? 0 : dp1[j1] + 1) + (j2 == -1 ? 0 : dp1[j2] + 1));
			}
			x_--;
			dfs4(i, j, w_, x_, y_, z_);
		}
	}
}

int ans;

void solve(int s) {
	int g, h, i, j, j1, j2, x;

	dfs3(-1, s, -1, 0);
	dfs4(-1, s, -INF, -INF, -INF, -INF);
	for (h = 0; h < m; h++) {
		i = ii[h], j = jj[h];
		if (ww[h] != 1 && rr[i] != rr[j]) {
			x = max(max(dq2[i], dq2[j]), dq1[i] + dq1[j] + 2);
			j1 = j2 = -1;
			for (g = 0; g < 4; g++)
				if (jj1[s][g] != rr[i] && jj1[s][g] != rr[j]) {
					if (j1 == -1)
						j1 = jj1[s][g];
					else if (j2 == -1)
						j2 = jj1[s][g];
				}
			x = max(x, max(dq1[i], dq1[j]) + (j1 == -1 ? 0 : dp1[j1] + 1) + 2);
			x = max(x, (j1 == -1 ? 0 : dp1[j1] + 1) + (j2 == -1 ? 0 : dp2[j2] + 1));
			ans = min(ans, (n - 1) * 2 - dd[i] - dd[j] + ww[h] - x);
		}
	}
}

int main() {
	int h, i, j;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++)
		ej[i] = (int *) malloc(2 * sizeof *ej[i]);
	for (h = 0; h < m; h++) {
		scanf("%d%d%d", &i, &j, &ww[h]), ii[h] = i, jj[h] = j;
		if (ww[h] == 1)
			append(i, j), append(j, i);
	}
	d_ = -1, dfs1(-1, 0, 0);
	d_ = -1, dfs1(-1, i_, 0);
	ans = (n - 1) * 2 - d_;
	u = -1, v = -1, dfs2(-1, 0);
	if (u != -1)
		solve(u);
	if (v != -1)
		solve(v);
	printf("%d\n", ans);
	return 0;
}

Compilation message

Main.c: In function 'append':
Main.c:18:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   18 |  if (o >= 2 && (o & o - 1) == 0)
      |                     ~~^~~
Main.c: In function 'main':
Main.c:157:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  157 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:161:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  161 |   scanf("%d%d%d", &i, &j, &ww[h]), ii[h] = i, jj[h] = j;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 1492 KB Output is correct
2 Correct 5 ms 1492 KB Output is correct
3 Correct 5 ms 1300 KB Output is correct
4 Correct 4 ms 1236 KB Output is correct
5 Correct 4 ms 1236 KB Output is correct
6 Correct 3 ms 1048 KB Output is correct
7 Correct 5 ms 1492 KB Output is correct
8 Correct 5 ms 1408 KB Output is correct
9 Correct 5 ms 1440 KB Output is correct
10 Correct 5 ms 1236 KB Output is correct
11 Correct 5 ms 1304 KB Output is correct
12 Correct 4 ms 1236 KB Output is correct
13 Correct 5 ms 1308 KB Output is correct
14 Correct 5 ms 1364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 296 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 1 ms 288 KB Output is correct
40 Correct 0 ms 288 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 0 ms 340 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 296 KB Output is correct
38 Correct 0 ms 340 KB Output is correct
39 Correct 1 ms 288 KB Output is correct
40 Correct 0 ms 288 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 0 ms 340 KB Output is correct
47 Correct 0 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 0 ms 340 KB Output is correct
50 Correct 1 ms 468 KB Output is correct
51 Correct 1 ms 468 KB Output is correct
52 Correct 1 ms 432 KB Output is correct
53 Correct 1 ms 468 KB Output is correct
54 Correct 1 ms 468 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 468 KB Output is correct
57 Correct 1 ms 432 KB Output is correct
58 Correct 1 ms 468 KB Output is correct
59 Correct 1 ms 468 KB Output is correct
60 Correct 1 ms 468 KB Output is correct
61 Correct 1 ms 468 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 5 ms 1492 KB Output is correct
37 Correct 5 ms 1492 KB Output is correct
38 Correct 5 ms 1300 KB Output is correct
39 Correct 4 ms 1236 KB Output is correct
40 Correct 4 ms 1236 KB Output is correct
41 Correct 3 ms 1048 KB Output is correct
42 Correct 5 ms 1492 KB Output is correct
43 Correct 5 ms 1408 KB Output is correct
44 Correct 5 ms 1440 KB Output is correct
45 Correct 5 ms 1236 KB Output is correct
46 Correct 5 ms 1304 KB Output is correct
47 Correct 4 ms 1236 KB Output is correct
48 Correct 5 ms 1308 KB Output is correct
49 Correct 5 ms 1364 KB Output is correct
50 Correct 0 ms 340 KB Output is correct
51 Correct 1 ms 296 KB Output is correct
52 Correct 0 ms 340 KB Output is correct
53 Correct 1 ms 288 KB Output is correct
54 Correct 0 ms 288 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 0 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 292 KB Output is correct
60 Correct 0 ms 340 KB Output is correct
61 Correct 0 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 1 ms 468 KB Output is correct
65 Correct 1 ms 468 KB Output is correct
66 Correct 1 ms 432 KB Output is correct
67 Correct 1 ms 468 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 1 ms 468 KB Output is correct
71 Correct 1 ms 432 KB Output is correct
72 Correct 1 ms 468 KB Output is correct
73 Correct 1 ms 468 KB Output is correct
74 Correct 1 ms 468 KB Output is correct
75 Correct 1 ms 468 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 5 ms 1492 KB Output is correct
79 Correct 5 ms 1492 KB Output is correct
80 Correct 4 ms 1364 KB Output is correct
81 Correct 4 ms 1364 KB Output is correct
82 Correct 4 ms 1204 KB Output is correct
83 Correct 3 ms 1108 KB Output is correct
84 Correct 8 ms 1492 KB Output is correct
85 Correct 6 ms 1364 KB Output is correct
86 Correct 5 ms 1364 KB Output is correct
87 Correct 5 ms 1236 KB Output is correct
88 Incorrect 5 ms 1312 KB Output isn't correct
89 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 5 ms 1492 KB Output is correct
37 Correct 5 ms 1492 KB Output is correct
38 Correct 5 ms 1300 KB Output is correct
39 Correct 4 ms 1236 KB Output is correct
40 Correct 4 ms 1236 KB Output is correct
41 Correct 3 ms 1048 KB Output is correct
42 Correct 5 ms 1492 KB Output is correct
43 Correct 5 ms 1408 KB Output is correct
44 Correct 5 ms 1440 KB Output is correct
45 Correct 5 ms 1236 KB Output is correct
46 Correct 5 ms 1304 KB Output is correct
47 Correct 4 ms 1236 KB Output is correct
48 Correct 5 ms 1308 KB Output is correct
49 Correct 5 ms 1364 KB Output is correct
50 Correct 0 ms 340 KB Output is correct
51 Correct 1 ms 296 KB Output is correct
52 Correct 0 ms 340 KB Output is correct
53 Correct 1 ms 288 KB Output is correct
54 Correct 0 ms 288 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 0 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 292 KB Output is correct
60 Correct 0 ms 340 KB Output is correct
61 Correct 0 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 1 ms 468 KB Output is correct
65 Correct 1 ms 468 KB Output is correct
66 Correct 1 ms 432 KB Output is correct
67 Correct 1 ms 468 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 1 ms 468 KB Output is correct
71 Correct 1 ms 432 KB Output is correct
72 Correct 1 ms 468 KB Output is correct
73 Correct 1 ms 468 KB Output is correct
74 Correct 1 ms 468 KB Output is correct
75 Correct 1 ms 468 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 5 ms 1492 KB Output is correct
79 Correct 5 ms 1492 KB Output is correct
80 Correct 4 ms 1364 KB Output is correct
81 Correct 4 ms 1364 KB Output is correct
82 Correct 4 ms 1204 KB Output is correct
83 Correct 3 ms 1108 KB Output is correct
84 Correct 8 ms 1492 KB Output is correct
85 Correct 6 ms 1364 KB Output is correct
86 Correct 5 ms 1364 KB Output is correct
87 Correct 5 ms 1236 KB Output is correct
88 Incorrect 5 ms 1312 KB Output isn't correct
89 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 288 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 0 ms 340 KB Output is correct
22 Correct 0 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 292 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 0 ms 340 KB Output is correct
36 Correct 5 ms 1492 KB Output is correct
37 Correct 5 ms 1492 KB Output is correct
38 Correct 5 ms 1300 KB Output is correct
39 Correct 4 ms 1236 KB Output is correct
40 Correct 4 ms 1236 KB Output is correct
41 Correct 3 ms 1048 KB Output is correct
42 Correct 5 ms 1492 KB Output is correct
43 Correct 5 ms 1408 KB Output is correct
44 Correct 5 ms 1440 KB Output is correct
45 Correct 5 ms 1236 KB Output is correct
46 Correct 5 ms 1304 KB Output is correct
47 Correct 4 ms 1236 KB Output is correct
48 Correct 5 ms 1308 KB Output is correct
49 Correct 5 ms 1364 KB Output is correct
50 Correct 0 ms 340 KB Output is correct
51 Correct 1 ms 296 KB Output is correct
52 Correct 0 ms 340 KB Output is correct
53 Correct 1 ms 288 KB Output is correct
54 Correct 0 ms 288 KB Output is correct
55 Correct 0 ms 340 KB Output is correct
56 Correct 0 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 292 KB Output is correct
60 Correct 0 ms 340 KB Output is correct
61 Correct 0 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 1 ms 468 KB Output is correct
65 Correct 1 ms 468 KB Output is correct
66 Correct 1 ms 432 KB Output is correct
67 Correct 1 ms 468 KB Output is correct
68 Correct 1 ms 468 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 1 ms 468 KB Output is correct
71 Correct 1 ms 432 KB Output is correct
72 Correct 1 ms 468 KB Output is correct
73 Correct 1 ms 468 KB Output is correct
74 Correct 1 ms 468 KB Output is correct
75 Correct 1 ms 468 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 5 ms 1492 KB Output is correct
79 Correct 5 ms 1492 KB Output is correct
80 Correct 4 ms 1364 KB Output is correct
81 Correct 4 ms 1364 KB Output is correct
82 Correct 4 ms 1204 KB Output is correct
83 Correct 3 ms 1108 KB Output is correct
84 Correct 8 ms 1492 KB Output is correct
85 Correct 6 ms 1364 KB Output is correct
86 Correct 5 ms 1364 KB Output is correct
87 Correct 5 ms 1236 KB Output is correct
88 Incorrect 5 ms 1312 KB Output isn't correct
89 Halted 0 ms 0 KB -