Submission #252408

# Submission time Handle Problem Language Result Execution time Memory
252408 2020-07-25T13:27:55 Z Saboon Duathlon (APIO18_duathlon) C++14
82 / 100
539 ms 1048580 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 3e5 + 20;
const int mod = 1e9 + 7;

vector<int> g[maxn], t[maxn];
int dw[maxn], h[maxn], rt[maxn], a[maxn], sz[maxn];
bool visited[maxn];
int sz2[maxn];
ll answer = 0;

void dfs2(int v, int par = -1){
	sz2[v] = a[v];
	for (auto u : t[v]){
		if (u != par){
			dfs2(u, v);
			sz2[v] += sz2[u];
			answer += 1ll * a[v] * sz2[u] * (sz[rt[v]] - sz2[u] - a[v]);
		}
	}
	if (par != -1)
		answer += 1ll * a[v] * (sz2[v] - a[v]) * (sz[rt[v]] - sz2[v]);
}

int dfs(int v, int root){
	rt[v] = root;
	visited[v] = true;
	int ret = h[v];
	sz[v] = 1;
	dw[v] = v;
	a[v] = 1;
	for (auto u : g[v]){
		if (!visited[u]){
			h[u] = h[v] + 1;
			int k = dfs(u, root);
			sz[v] += sz[u];
			if (k <= h[v]){
				a[v] = a[u];
				dw[v] = dw[u];
			}
			ret = min(ret, k);
		}
		else if (h[u] < h[v] - 1){
			dw[v] = v;
			a[v] = h[v] - h[u] + 1;
			ret = h[u];
		}
	}
	return ret;
}

int e1[maxn], e2[maxn];
int par[55];

int get_par(int v){ return par[v] < 0 ? v : par[v] = get_par(par[v]); }

void merge(int v, int u){
	if ((v = get_par(v)) == (u = get_par(u)))
		return;
	par[v] = u;
}

bool ok[55][55][55];

int main(){
	ios_base::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	if (n <= 50){
		for (int i = 1; i <= m; i++)
			cin >> e1[i] >> e2[i];
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				for (int k = 1; k <= n; k++)
					if (i != j and i != k and j != k)
						ok[i][j][k] = 1;
		for (int x = 1; x <= n; x++){
			memset(par, -1, sizeof par);
			for (int i = 1; i <= m; i++)
				if (e1[i] != x and e2[i] != x)
					merge(e1[i], e2[i]);
			for (int i = 1; i <= n; i++)
				for (int j = 1; j <= n; j++)
					for (int k = 1; k <= n; k++)
						if (i != x and k != x and j != x and get_par(i) != get_par(j) and get_par(j) != get_par(k))
							ok[i][j][k] = 0;
			for (int i = 1; i <= n; i++)
				for (int j = 1; j <= n; j++)
					if (i != x and j != x and get_par(i) != get_par(j))
						ok[x][i][j] = ok[i][j][x] = 0;
		}
		int answer = 0;
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				for (int k = 1; k <= n; k++)
					if (i != j and j != k and k != i and ok[i][j][k])
						answer += ok[i][j][k];
		cout << answer << endl;
		return 0;
	}
	for (int i = 0; i < m; i++){
		int v, u;
		cin >> v >> u;
		g[v].push_back(u);
		g[u].push_back(v);
	}
	for (int v = 1; v <= n; v++)
		if (!visited[v])
			dfs(v, v);
	for (int i = 1; i <= n; i++)
		for (auto j : g[i])
			if (dw[i] != dw[j])
				t[dw[i]].push_back(dw[j]);
	for (int v = 1; v <= n; v++)
		if (h[v] == 0)
			dfs2(dw[v]);
	for (int c = 1; c <= n; c++){
		if (a[dw[c]] == 1)
			continue;
		int tot = 0;
		for (auto u : g[c]){
			if (h[u] == h[c]+1 and dw[u] != dw[c]){
				answer -= 2ll * (a[dw[c]]-1) * sz[u] * tot;
				tot += sz[u];
			}	
			if (h[u] == h[c]-1 and dw[u] != dw[c]){
				answer -= 2ll * (a[dw[c]]-1) * (sz[rt[c]] - sz[c]) * tot;
				tot += (sz[rt[c]] - sz[c]);
			}
		}
	}
	for (int v = 1; v <= n; v++)
		if (dw[v] == v and a[v] >= 3)
			answer -= 1ll*a[v]*(a[v]-1)*(a[v]-2);
	for (int f = 1; f <= n; f++){
		if (a[dw[f]] == 1)
			continue;
		int subsz = 1;
		for (auto u : g[f]){
			if (h[u] == h[f]+1 and dw[u] != dw[f])
				subsz += sz[u];
			if (h[u] == h[f]-1 and dw[u] != dw[f])
				subsz += (sz[rt[f]] - sz[f]);
		}
		int outsz = sz[rt[f]] - subsz;
		answer += 2ll * (a[dw[f]]-1) * (outsz-1);
	}
	cout << answer << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14464 KB Output is correct
2 Correct 10 ms 14464 KB Output is correct
3 Correct 8 ms 14464 KB Output is correct
4 Correct 8 ms 14464 KB Output is correct
5 Correct 8 ms 14464 KB Output is correct
6 Correct 8 ms 14464 KB Output is correct
7 Correct 8 ms 14464 KB Output is correct
8 Correct 8 ms 14464 KB Output is correct
9 Correct 11 ms 14464 KB Output is correct
10 Correct 11 ms 14464 KB Output is correct
11 Correct 9 ms 14464 KB Output is correct
12 Correct 8 ms 14464 KB Output is correct
13 Correct 8 ms 14464 KB Output is correct
14 Correct 8 ms 14464 KB Output is correct
15 Correct 8 ms 14464 KB Output is correct
16 Correct 8 ms 14464 KB Output is correct
17 Correct 8 ms 14464 KB Output is correct
18 Correct 8 ms 14464 KB Output is correct
19 Correct 8 ms 14464 KB Output is correct
20 Correct 8 ms 14464 KB Output is correct
21 Correct 8 ms 14464 KB Output is correct
22 Correct 8 ms 14464 KB Output is correct
23 Correct 8 ms 14464 KB Output is correct
24 Correct 8 ms 14464 KB Output is correct
25 Correct 8 ms 14464 KB Output is correct
26 Correct 8 ms 14464 KB Output is correct
27 Correct 8 ms 14400 KB Output is correct
28 Correct 8 ms 14464 KB Output is correct
29 Correct 10 ms 14464 KB Output is correct
30 Correct 8 ms 14464 KB Output is correct
31 Correct 8 ms 14464 KB Output is correct
32 Correct 8 ms 14464 KB Output is correct
33 Correct 8 ms 14464 KB Output is correct
34 Correct 8 ms 14464 KB Output is correct
35 Correct 8 ms 14464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14464 KB Output is correct
2 Correct 10 ms 14464 KB Output is correct
3 Correct 8 ms 14464 KB Output is correct
4 Correct 8 ms 14464 KB Output is correct
5 Correct 8 ms 14464 KB Output is correct
6 Correct 8 ms 14464 KB Output is correct
7 Correct 8 ms 14464 KB Output is correct
8 Correct 8 ms 14464 KB Output is correct
9 Correct 11 ms 14464 KB Output is correct
10 Correct 11 ms 14464 KB Output is correct
11 Correct 9 ms 14464 KB Output is correct
12 Correct 8 ms 14464 KB Output is correct
13 Correct 8 ms 14464 KB Output is correct
14 Correct 8 ms 14464 KB Output is correct
15 Correct 8 ms 14464 KB Output is correct
16 Correct 8 ms 14464 KB Output is correct
17 Correct 8 ms 14464 KB Output is correct
18 Correct 8 ms 14464 KB Output is correct
19 Correct 8 ms 14464 KB Output is correct
20 Correct 8 ms 14464 KB Output is correct
21 Correct 8 ms 14464 KB Output is correct
22 Correct 8 ms 14464 KB Output is correct
23 Correct 8 ms 14464 KB Output is correct
24 Correct 8 ms 14464 KB Output is correct
25 Correct 8 ms 14464 KB Output is correct
26 Correct 8 ms 14464 KB Output is correct
27 Correct 8 ms 14400 KB Output is correct
28 Correct 8 ms 14464 KB Output is correct
29 Correct 10 ms 14464 KB Output is correct
30 Correct 8 ms 14464 KB Output is correct
31 Correct 8 ms 14464 KB Output is correct
32 Correct 8 ms 14464 KB Output is correct
33 Correct 8 ms 14464 KB Output is correct
34 Correct 8 ms 14464 KB Output is correct
35 Correct 8 ms 14464 KB Output is correct
36 Correct 28 ms 14592 KB Output is correct
37 Correct 58 ms 14592 KB Output is correct
38 Correct 49 ms 14592 KB Output is correct
39 Correct 47 ms 14712 KB Output is correct
40 Correct 45 ms 14592 KB Output is correct
41 Correct 43 ms 14592 KB Output is correct
42 Correct 50 ms 14640 KB Output is correct
43 Correct 50 ms 14592 KB Output is correct
44 Correct 61 ms 14592 KB Output is correct
45 Correct 50 ms 14592 KB Output is correct
46 Correct 52 ms 14592 KB Output is correct
47 Correct 8 ms 14464 KB Output is correct
48 Correct 51 ms 14592 KB Output is correct
49 Correct 38 ms 14592 KB Output is correct
50 Correct 33 ms 14592 KB Output is correct
51 Correct 49 ms 14712 KB Output is correct
52 Correct 45 ms 14592 KB Output is correct
53 Correct 47 ms 14592 KB Output is correct
54 Correct 45 ms 14592 KB Output is correct
55 Correct 46 ms 14592 KB Output is correct
56 Correct 45 ms 14592 KB Output is correct
57 Correct 49 ms 14592 KB Output is correct
58 Correct 47 ms 14592 KB Output is correct
59 Correct 54 ms 14592 KB Output is correct
60 Correct 62 ms 14592 KB Output is correct
61 Correct 69 ms 14592 KB Output is correct
62 Correct 69 ms 14592 KB Output is correct
63 Correct 42 ms 14592 KB Output is correct
64 Correct 45 ms 14592 KB Output is correct
65 Correct 44 ms 14592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 77 ms 27512 KB Output is correct
2 Correct 81 ms 27492 KB Output is correct
3 Correct 104 ms 25592 KB Output is correct
4 Correct 84 ms 26616 KB Output is correct
5 Correct 84 ms 23672 KB Output is correct
6 Correct 91 ms 24312 KB Output is correct
7 Correct 89 ms 23416 KB Output is correct
8 Correct 91 ms 24056 KB Output is correct
9 Correct 90 ms 22648 KB Output is correct
10 Correct 86 ms 23032 KB Output is correct
11 Correct 72 ms 21624 KB Output is correct
12 Correct 72 ms 21496 KB Output is correct
13 Correct 85 ms 21624 KB Output is correct
14 Correct 67 ms 21496 KB Output is correct
15 Correct 70 ms 21368 KB Output is correct
16 Correct 67 ms 20984 KB Output is correct
17 Correct 10 ms 16896 KB Output is correct
18 Correct 11 ms 16896 KB Output is correct
19 Correct 11 ms 16768 KB Output is correct
20 Correct 12 ms 16768 KB Output is correct
21 Correct 11 ms 16768 KB Output is correct
22 Correct 15 ms 16768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14592 KB Output is correct
2 Correct 8 ms 14592 KB Output is correct
3 Correct 9 ms 14592 KB Output is correct
4 Correct 8 ms 14592 KB Output is correct
5 Correct 9 ms 14592 KB Output is correct
6 Correct 8 ms 14592 KB Output is correct
7 Correct 9 ms 14592 KB Output is correct
8 Correct 8 ms 14592 KB Output is correct
9 Correct 12 ms 14592 KB Output is correct
10 Correct 9 ms 14592 KB Output is correct
11 Correct 9 ms 14592 KB Output is correct
12 Correct 8 ms 14592 KB Output is correct
13 Correct 8 ms 14592 KB Output is correct
14 Correct 8 ms 14592 KB Output is correct
15 Correct 8 ms 14592 KB Output is correct
16 Correct 8 ms 14592 KB Output is correct
17 Correct 8 ms 14592 KB Output is correct
18 Correct 8 ms 14592 KB Output is correct
19 Correct 10 ms 14592 KB Output is correct
20 Correct 8 ms 14592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 82 ms 23416 KB Output is correct
2 Correct 89 ms 23416 KB Output is correct
3 Correct 86 ms 23420 KB Output is correct
4 Correct 88 ms 23424 KB Output is correct
5 Correct 83 ms 23424 KB Output is correct
6 Correct 97 ms 27384 KB Output is correct
7 Correct 103 ms 26104 KB Output is correct
8 Correct 111 ms 25320 KB Output is correct
9 Correct 100 ms 24568 KB Output is correct
10 Correct 89 ms 23416 KB Output is correct
11 Correct 97 ms 23544 KB Output is correct
12 Correct 102 ms 23416 KB Output is correct
13 Correct 92 ms 23392 KB Output is correct
14 Correct 75 ms 23168 KB Output is correct
15 Correct 78 ms 22904 KB Output is correct
16 Correct 48 ms 21624 KB Output is correct
17 Correct 62 ms 23920 KB Output is correct
18 Correct 61 ms 23920 KB Output is correct
19 Correct 61 ms 23984 KB Output is correct
20 Correct 61 ms 23928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14592 KB Output is correct
2 Correct 10 ms 14592 KB Output is correct
3 Correct 9 ms 14592 KB Output is correct
4 Correct 8 ms 14592 KB Output is correct
5 Correct 9 ms 14592 KB Output is correct
6 Correct 8 ms 14592 KB Output is correct
7 Correct 9 ms 14592 KB Output is correct
8 Correct 8 ms 14464 KB Output is correct
9 Correct 8 ms 14464 KB Output is correct
10 Correct 9 ms 14592 KB Output is correct
11 Correct 8 ms 14592 KB Output is correct
12 Correct 9 ms 14592 KB Output is correct
13 Correct 9 ms 14592 KB Output is correct
14 Correct 10 ms 14592 KB Output is correct
15 Correct 8 ms 14592 KB Output is correct
16 Correct 12 ms 14592 KB Output is correct
17 Correct 8 ms 14592 KB Output is correct
18 Correct 9 ms 14592 KB Output is correct
19 Correct 9 ms 14592 KB Output is correct
20 Correct 9 ms 14464 KB Output is correct
21 Correct 9 ms 14592 KB Output is correct
22 Correct 9 ms 14592 KB Output is correct
23 Correct 9 ms 14592 KB Output is correct
24 Correct 9 ms 14592 KB Output is correct
25 Correct 11 ms 14464 KB Output is correct
26 Correct 9 ms 14592 KB Output is correct
27 Correct 8 ms 14464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 95 ms 23416 KB Output is correct
2 Correct 86 ms 23288 KB Output is correct
3 Correct 96 ms 22264 KB Output is correct
4 Correct 93 ms 21368 KB Output is correct
5 Correct 87 ms 20856 KB Output is correct
6 Correct 84 ms 20472 KB Output is correct
7 Correct 76 ms 20344 KB Output is correct
8 Correct 77 ms 20216 KB Output is correct
9 Correct 87 ms 20216 KB Output is correct
10 Correct 75 ms 20216 KB Output is correct
11 Correct 75 ms 20216 KB Output is correct
12 Correct 72 ms 20344 KB Output is correct
13 Correct 68 ms 20344 KB Output is correct
14 Correct 74 ms 21752 KB Output is correct
15 Correct 113 ms 25464 KB Output is correct
16 Correct 111 ms 24312 KB Output is correct
17 Correct 106 ms 24568 KB Output is correct
18 Correct 101 ms 23544 KB Output is correct
19 Correct 93 ms 21368 KB Output is correct
20 Correct 97 ms 21368 KB Output is correct
21 Correct 94 ms 21368 KB Output is correct
22 Correct 85 ms 21164 KB Output is correct
23 Correct 77 ms 20856 KB Output is correct
24 Correct 88 ms 22648 KB Output is correct
25 Correct 93 ms 22648 KB Output is correct
26 Correct 87 ms 22008 KB Output is correct
27 Correct 91 ms 21880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14464 KB Output is correct
2 Correct 10 ms 14464 KB Output is correct
3 Correct 8 ms 14464 KB Output is correct
4 Correct 8 ms 14464 KB Output is correct
5 Correct 8 ms 14464 KB Output is correct
6 Correct 8 ms 14464 KB Output is correct
7 Correct 8 ms 14464 KB Output is correct
8 Correct 8 ms 14464 KB Output is correct
9 Correct 11 ms 14464 KB Output is correct
10 Correct 11 ms 14464 KB Output is correct
11 Correct 9 ms 14464 KB Output is correct
12 Correct 8 ms 14464 KB Output is correct
13 Correct 8 ms 14464 KB Output is correct
14 Correct 8 ms 14464 KB Output is correct
15 Correct 8 ms 14464 KB Output is correct
16 Correct 8 ms 14464 KB Output is correct
17 Correct 8 ms 14464 KB Output is correct
18 Correct 8 ms 14464 KB Output is correct
19 Correct 8 ms 14464 KB Output is correct
20 Correct 8 ms 14464 KB Output is correct
21 Correct 8 ms 14464 KB Output is correct
22 Correct 8 ms 14464 KB Output is correct
23 Correct 8 ms 14464 KB Output is correct
24 Correct 8 ms 14464 KB Output is correct
25 Correct 8 ms 14464 KB Output is correct
26 Correct 8 ms 14464 KB Output is correct
27 Correct 8 ms 14400 KB Output is correct
28 Correct 8 ms 14464 KB Output is correct
29 Correct 10 ms 14464 KB Output is correct
30 Correct 8 ms 14464 KB Output is correct
31 Correct 8 ms 14464 KB Output is correct
32 Correct 8 ms 14464 KB Output is correct
33 Correct 8 ms 14464 KB Output is correct
34 Correct 8 ms 14464 KB Output is correct
35 Correct 8 ms 14464 KB Output is correct
36 Correct 28 ms 14592 KB Output is correct
37 Correct 58 ms 14592 KB Output is correct
38 Correct 49 ms 14592 KB Output is correct
39 Correct 47 ms 14712 KB Output is correct
40 Correct 45 ms 14592 KB Output is correct
41 Correct 43 ms 14592 KB Output is correct
42 Correct 50 ms 14640 KB Output is correct
43 Correct 50 ms 14592 KB Output is correct
44 Correct 61 ms 14592 KB Output is correct
45 Correct 50 ms 14592 KB Output is correct
46 Correct 52 ms 14592 KB Output is correct
47 Correct 8 ms 14464 KB Output is correct
48 Correct 51 ms 14592 KB Output is correct
49 Correct 38 ms 14592 KB Output is correct
50 Correct 33 ms 14592 KB Output is correct
51 Correct 49 ms 14712 KB Output is correct
52 Correct 45 ms 14592 KB Output is correct
53 Correct 47 ms 14592 KB Output is correct
54 Correct 45 ms 14592 KB Output is correct
55 Correct 46 ms 14592 KB Output is correct
56 Correct 45 ms 14592 KB Output is correct
57 Correct 49 ms 14592 KB Output is correct
58 Correct 47 ms 14592 KB Output is correct
59 Correct 54 ms 14592 KB Output is correct
60 Correct 62 ms 14592 KB Output is correct
61 Correct 69 ms 14592 KB Output is correct
62 Correct 69 ms 14592 KB Output is correct
63 Correct 42 ms 14592 KB Output is correct
64 Correct 45 ms 14592 KB Output is correct
65 Correct 44 ms 14592 KB Output is correct
66 Correct 8 ms 14464 KB Output is correct
67 Correct 8 ms 14592 KB Output is correct
68 Runtime error 539 ms 1048580 KB Execution killed with signal 9 (could be triggered by violating memory limits)
69 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14464 KB Output is correct
2 Correct 10 ms 14464 KB Output is correct
3 Correct 8 ms 14464 KB Output is correct
4 Correct 8 ms 14464 KB Output is correct
5 Correct 8 ms 14464 KB Output is correct
6 Correct 8 ms 14464 KB Output is correct
7 Correct 8 ms 14464 KB Output is correct
8 Correct 8 ms 14464 KB Output is correct
9 Correct 11 ms 14464 KB Output is correct
10 Correct 11 ms 14464 KB Output is correct
11 Correct 9 ms 14464 KB Output is correct
12 Correct 8 ms 14464 KB Output is correct
13 Correct 8 ms 14464 KB Output is correct
14 Correct 8 ms 14464 KB Output is correct
15 Correct 8 ms 14464 KB Output is correct
16 Correct 8 ms 14464 KB Output is correct
17 Correct 8 ms 14464 KB Output is correct
18 Correct 8 ms 14464 KB Output is correct
19 Correct 8 ms 14464 KB Output is correct
20 Correct 8 ms 14464 KB Output is correct
21 Correct 8 ms 14464 KB Output is correct
22 Correct 8 ms 14464 KB Output is correct
23 Correct 8 ms 14464 KB Output is correct
24 Correct 8 ms 14464 KB Output is correct
25 Correct 8 ms 14464 KB Output is correct
26 Correct 8 ms 14464 KB Output is correct
27 Correct 8 ms 14400 KB Output is correct
28 Correct 8 ms 14464 KB Output is correct
29 Correct 10 ms 14464 KB Output is correct
30 Correct 8 ms 14464 KB Output is correct
31 Correct 8 ms 14464 KB Output is correct
32 Correct 8 ms 14464 KB Output is correct
33 Correct 8 ms 14464 KB Output is correct
34 Correct 8 ms 14464 KB Output is correct
35 Correct 8 ms 14464 KB Output is correct
36 Correct 28 ms 14592 KB Output is correct
37 Correct 58 ms 14592 KB Output is correct
38 Correct 49 ms 14592 KB Output is correct
39 Correct 47 ms 14712 KB Output is correct
40 Correct 45 ms 14592 KB Output is correct
41 Correct 43 ms 14592 KB Output is correct
42 Correct 50 ms 14640 KB Output is correct
43 Correct 50 ms 14592 KB Output is correct
44 Correct 61 ms 14592 KB Output is correct
45 Correct 50 ms 14592 KB Output is correct
46 Correct 52 ms 14592 KB Output is correct
47 Correct 8 ms 14464 KB Output is correct
48 Correct 51 ms 14592 KB Output is correct
49 Correct 38 ms 14592 KB Output is correct
50 Correct 33 ms 14592 KB Output is correct
51 Correct 49 ms 14712 KB Output is correct
52 Correct 45 ms 14592 KB Output is correct
53 Correct 47 ms 14592 KB Output is correct
54 Correct 45 ms 14592 KB Output is correct
55 Correct 46 ms 14592 KB Output is correct
56 Correct 45 ms 14592 KB Output is correct
57 Correct 49 ms 14592 KB Output is correct
58 Correct 47 ms 14592 KB Output is correct
59 Correct 54 ms 14592 KB Output is correct
60 Correct 62 ms 14592 KB Output is correct
61 Correct 69 ms 14592 KB Output is correct
62 Correct 69 ms 14592 KB Output is correct
63 Correct 42 ms 14592 KB Output is correct
64 Correct 45 ms 14592 KB Output is correct
65 Correct 44 ms 14592 KB Output is correct
66 Correct 77 ms 27512 KB Output is correct
67 Correct 81 ms 27492 KB Output is correct
68 Correct 104 ms 25592 KB Output is correct
69 Correct 84 ms 26616 KB Output is correct
70 Correct 84 ms 23672 KB Output is correct
71 Correct 91 ms 24312 KB Output is correct
72 Correct 89 ms 23416 KB Output is correct
73 Correct 91 ms 24056 KB Output is correct
74 Correct 90 ms 22648 KB Output is correct
75 Correct 86 ms 23032 KB Output is correct
76 Correct 72 ms 21624 KB Output is correct
77 Correct 72 ms 21496 KB Output is correct
78 Correct 85 ms 21624 KB Output is correct
79 Correct 67 ms 21496 KB Output is correct
80 Correct 70 ms 21368 KB Output is correct
81 Correct 67 ms 20984 KB Output is correct
82 Correct 10 ms 16896 KB Output is correct
83 Correct 11 ms 16896 KB Output is correct
84 Correct 11 ms 16768 KB Output is correct
85 Correct 12 ms 16768 KB Output is correct
86 Correct 11 ms 16768 KB Output is correct
87 Correct 15 ms 16768 KB Output is correct
88 Correct 8 ms 14592 KB Output is correct
89 Correct 8 ms 14592 KB Output is correct
90 Correct 9 ms 14592 KB Output is correct
91 Correct 8 ms 14592 KB Output is correct
92 Correct 9 ms 14592 KB Output is correct
93 Correct 8 ms 14592 KB Output is correct
94 Correct 9 ms 14592 KB Output is correct
95 Correct 8 ms 14592 KB Output is correct
96 Correct 12 ms 14592 KB Output is correct
97 Correct 9 ms 14592 KB Output is correct
98 Correct 9 ms 14592 KB Output is correct
99 Correct 8 ms 14592 KB Output is correct
100 Correct 8 ms 14592 KB Output is correct
101 Correct 8 ms 14592 KB Output is correct
102 Correct 8 ms 14592 KB Output is correct
103 Correct 8 ms 14592 KB Output is correct
104 Correct 8 ms 14592 KB Output is correct
105 Correct 8 ms 14592 KB Output is correct
106 Correct 10 ms 14592 KB Output is correct
107 Correct 8 ms 14592 KB Output is correct
108 Correct 82 ms 23416 KB Output is correct
109 Correct 89 ms 23416 KB Output is correct
110 Correct 86 ms 23420 KB Output is correct
111 Correct 88 ms 23424 KB Output is correct
112 Correct 83 ms 23424 KB Output is correct
113 Correct 97 ms 27384 KB Output is correct
114 Correct 103 ms 26104 KB Output is correct
115 Correct 111 ms 25320 KB Output is correct
116 Correct 100 ms 24568 KB Output is correct
117 Correct 89 ms 23416 KB Output is correct
118 Correct 97 ms 23544 KB Output is correct
119 Correct 102 ms 23416 KB Output is correct
120 Correct 92 ms 23392 KB Output is correct
121 Correct 75 ms 23168 KB Output is correct
122 Correct 78 ms 22904 KB Output is correct
123 Correct 48 ms 21624 KB Output is correct
124 Correct 62 ms 23920 KB Output is correct
125 Correct 61 ms 23920 KB Output is correct
126 Correct 61 ms 23984 KB Output is correct
127 Correct 61 ms 23928 KB Output is correct
128 Correct 8 ms 14592 KB Output is correct
129 Correct 10 ms 14592 KB Output is correct
130 Correct 9 ms 14592 KB Output is correct
131 Correct 8 ms 14592 KB Output is correct
132 Correct 9 ms 14592 KB Output is correct
133 Correct 8 ms 14592 KB Output is correct
134 Correct 9 ms 14592 KB Output is correct
135 Correct 8 ms 14464 KB Output is correct
136 Correct 8 ms 14464 KB Output is correct
137 Correct 9 ms 14592 KB Output is correct
138 Correct 8 ms 14592 KB Output is correct
139 Correct 9 ms 14592 KB Output is correct
140 Correct 9 ms 14592 KB Output is correct
141 Correct 10 ms 14592 KB Output is correct
142 Correct 8 ms 14592 KB Output is correct
143 Correct 12 ms 14592 KB Output is correct
144 Correct 8 ms 14592 KB Output is correct
145 Correct 9 ms 14592 KB Output is correct
146 Correct 9 ms 14592 KB Output is correct
147 Correct 9 ms 14464 KB Output is correct
148 Correct 9 ms 14592 KB Output is correct
149 Correct 9 ms 14592 KB Output is correct
150 Correct 9 ms 14592 KB Output is correct
151 Correct 9 ms 14592 KB Output is correct
152 Correct 11 ms 14464 KB Output is correct
153 Correct 9 ms 14592 KB Output is correct
154 Correct 8 ms 14464 KB Output is correct
155 Correct 95 ms 23416 KB Output is correct
156 Correct 86 ms 23288 KB Output is correct
157 Correct 96 ms 22264 KB Output is correct
158 Correct 93 ms 21368 KB Output is correct
159 Correct 87 ms 20856 KB Output is correct
160 Correct 84 ms 20472 KB Output is correct
161 Correct 76 ms 20344 KB Output is correct
162 Correct 77 ms 20216 KB Output is correct
163 Correct 87 ms 20216 KB Output is correct
164 Correct 75 ms 20216 KB Output is correct
165 Correct 75 ms 20216 KB Output is correct
166 Correct 72 ms 20344 KB Output is correct
167 Correct 68 ms 20344 KB Output is correct
168 Correct 74 ms 21752 KB Output is correct
169 Correct 113 ms 25464 KB Output is correct
170 Correct 111 ms 24312 KB Output is correct
171 Correct 106 ms 24568 KB Output is correct
172 Correct 101 ms 23544 KB Output is correct
173 Correct 93 ms 21368 KB Output is correct
174 Correct 97 ms 21368 KB Output is correct
175 Correct 94 ms 21368 KB Output is correct
176 Correct 85 ms 21164 KB Output is correct
177 Correct 77 ms 20856 KB Output is correct
178 Correct 88 ms 22648 KB Output is correct
179 Correct 93 ms 22648 KB Output is correct
180 Correct 87 ms 22008 KB Output is correct
181 Correct 91 ms 21880 KB Output is correct
182 Correct 8 ms 14464 KB Output is correct
183 Correct 8 ms 14592 KB Output is correct
184 Runtime error 539 ms 1048580 KB Execution killed with signal 9 (could be triggered by violating memory limits)
185 Halted 0 ms 0 KB -