Submission #1064051

# Submission time Handle Problem Language Result Execution time Memory
1064051 2024-08-18T08:47:21 Z AmirAli_H1 Closing Time (IOI23_closing) C++17
83 / 100
1000 ms 39868 KB
// In the name of Allah

#include <bits/stdc++.h>
#include "closing.h"
using namespace std;

typedef			long long				ll;
typedef			pair<int, int>			pii;
typedef			pair<ll, ll>			pll;

#define			F						first
#define			S						second
#define			endl					'\n'
#define			sep						' '
#define			pb						push_back
#define			Mp						make_pair
#define			all(x)					(x).begin(),(x).end()
#define			len(x)					((ll) (x).size())

const int maxn = 4e5 + 7;

int n, u1, u2; ll R;
vector<pll> adj[maxn];
ll val[maxn], val1[maxn], val2[maxn];
ll sm1[maxn], sm2[maxn], mn1[maxn], mn2[maxn];
vector<ll> ls1; vector<pll> ls2;

void dfs(int v, int p = -1) {
	for (auto f : adj[v]) {
		int u = f.F; ll w = f.S;
		if (u == p) continue;
		val[u] = val[v] + w;
		dfs(u, v);
	}
}

int cal(ll R) {
	sort(all(ls1)); sort(all(ls2));
	
	for (int i = 0; i < len(ls1); i++) {
		if (i == 0) sm1[i] = ls1[i];
		else sm1[i] = sm1[i - 1] + ls1[i];
	}
	for (int i = 1; i <= len(ls2); i++) {
		sm2[i] = sm2[i - 1] + ls2[i - 1].F;
	}
	
	for (int i = 0; i < len(ls2); i++) {
		mn1[i] = ls2[i].S - ls2[i].F; mn2[i] = ls2[i].S;
	}
	for (int i = 1; i < len(ls2); i++) mn1[i] = min(mn1[i], mn1[i - 1]);
	for (int i = len(ls2) - 2; i >= 0; i--) mn2[i] = min(mn2[i], mn2[i + 1]);
	
	int ans = 0;
	for (int i = 0; i <= 2 * len(ls2); i++) {
		int x = i, j = i / 2;
		if (i % 2 == 0) {
			ll w = R - sm2[j];
			if (w >= 0) {
				x += upper_bound(sm1, sm1 + len(ls1), w) - sm1;
				ans = max(ans, x);
			}
		}
		else {
			ll wx = min(mn1[j] + ls2[j].F, mn2[j]);
			ll w = R - sm2[j] - wx;
			if (w >= 0) {
				x += upper_bound(sm1, sm1 + len(ls1), w) - sm1;
				ans = max(ans, x);
			}
		}
	}
	
	return ans;
}

int max_score(int N, int X, int Y, long long K, vector<int> U, vector<int> V, vector<int> W) {
	n = N; u1 = X; u2 = Y; R = K;
	for (int i = 0; i < n; i++) adj[i].clear();
	
	for (int i = 0; i < n - 1; i++) {
		int u = U[i], v = V[i]; ll w = W[i];
		adj[u].pb(Mp(v, w)); adj[v].pb(Mp(u, w));
	}
	
	val[u1] = 0; dfs(u1);
	for (int i = 0; i < n; i++) val1[i] = val[i];
	
	val[u2] = 0; dfs(u2);
	for (int i = 0; i < n; i++) val2[i] = val[i];
	
	for (int i = 0; i < n; i++) {
		if (2 * min(val1[i], val2[i]) <= max(val1[i], val2[i])) {
			ls1.pb(min(val1[i], val2[i]));
			ls1.pb(max(val1[i], val2[i]) - min(val1[i], val2[i]));
		}
		else {
			ls2.pb(Mp(max(val1[i], val2[i]), min(val1[i], val2[i])));
		}
	}
	
	int ans = 0;
	
	ls1.clear(); ls2.clear();
	for (int i = 0; i < n; i++) {
		ls1.pb(min(val1[i], val2[i]));
	}
	ans = max(ans, cal(R));
	
	for (int v = 0; v < n; v++) {
		if (val1[v] + val2[v] != val1[u2]) continue;
		if (max(val1[v], val2[v]) > R) continue;
		int x = 0; ll valx = R;
		ls1.clear(); ls2.clear();
		for (int i = 0; i < n; i++) {
			if (val1[i] + val2[i] == val1[u2]) {
				if (i == v) {
					valx -= max(val1[i], val2[i]); x += 2;
				}
				else {
					if (val1[i] < val1[v]) {
						valx -= val1[i]; x += 1;
						ls1.pb(max(0ll, val2[i] - val1[i]));
					}
					else {
						valx -= val2[i]; x += 1;
						ls1.pb(max(0ll, val1[i] - val2[i]));
					}
				}
			}
			else {
				if (2 * min(val1[i], val2[i]) <= max(val1[i], val2[i])) {
					ls1.pb(min(val1[i], val2[i]));
					ls1.pb(max(val1[i], val2[i]) - min(val1[i], val2[i]));
				}
				else {
					ls2.pb(Mp(max(val1[i], val2[i]), min(val1[i], val2[i])));
				}
			}
		}
		if (valx >= 0) ans = max(ans, x + cal(valx));
	}
	
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 95 ms 36964 KB Output is correct
2 Correct 102 ms 39868 KB Output is correct
3 Correct 53 ms 12372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9820 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9816 KB Output is correct
4 Correct 4 ms 9820 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9816 KB Output is correct
8 Correct 4 ms 9820 KB Output is correct
9 Correct 4 ms 9760 KB Output is correct
10 Correct 4 ms 9820 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9820 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9816 KB Output is correct
4 Correct 4 ms 9820 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9816 KB Output is correct
8 Correct 4 ms 9820 KB Output is correct
9 Correct 4 ms 9760 KB Output is correct
10 Correct 4 ms 9820 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9872 KB Output is correct
16 Correct 4 ms 9816 KB Output is correct
17 Correct 4 ms 9820 KB Output is correct
18 Correct 4 ms 9716 KB Output is correct
19 Correct 4 ms 9816 KB Output is correct
20 Correct 4 ms 9820 KB Output is correct
21 Correct 7 ms 9820 KB Output is correct
22 Correct 4 ms 9820 KB Output is correct
23 Correct 5 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9820 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9816 KB Output is correct
4 Correct 4 ms 9820 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9816 KB Output is correct
8 Correct 4 ms 9820 KB Output is correct
9 Correct 4 ms 9760 KB Output is correct
10 Correct 4 ms 9820 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9872 KB Output is correct
16 Correct 4 ms 9816 KB Output is correct
17 Correct 4 ms 9820 KB Output is correct
18 Correct 4 ms 9716 KB Output is correct
19 Correct 4 ms 9816 KB Output is correct
20 Correct 4 ms 9820 KB Output is correct
21 Correct 7 ms 9820 KB Output is correct
22 Correct 4 ms 9820 KB Output is correct
23 Correct 5 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
25 Correct 6 ms 9820 KB Output is correct
26 Correct 6 ms 10332 KB Output is correct
27 Correct 5 ms 10420 KB Output is correct
28 Correct 179 ms 10320 KB Output is correct
29 Correct 152 ms 10328 KB Output is correct
30 Correct 14 ms 10332 KB Output is correct
31 Correct 23 ms 10332 KB Output is correct
32 Correct 23 ms 10332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9820 KB Output is correct
4 Correct 4 ms 9816 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9820 KB Output is correct
8 Correct 4 ms 9764 KB Output is correct
9 Correct 4 ms 9820 KB Output is correct
10 Correct 4 ms 9820 KB Output is correct
11 Correct 5 ms 9820 KB Output is correct
12 Correct 5 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9800 KB Output is correct
15 Correct 4 ms 9820 KB Output is correct
16 Correct 4 ms 9820 KB Output is correct
17 Correct 5 ms 9816 KB Output is correct
18 Correct 4 ms 9672 KB Output is correct
19 Correct 4 ms 9816 KB Output is correct
20 Correct 4 ms 9816 KB Output is correct
21 Correct 4 ms 9820 KB Output is correct
22 Correct 4 ms 9820 KB Output is correct
23 Correct 4 ms 9820 KB Output is correct
24 Correct 4 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9820 KB Output is correct
4 Correct 4 ms 9816 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9820 KB Output is correct
8 Correct 4 ms 9816 KB Output is correct
9 Correct 4 ms 9820 KB Output is correct
10 Correct 4 ms 9760 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9820 KB Output is correct
16 Correct 4 ms 9872 KB Output is correct
17 Correct 4 ms 9816 KB Output is correct
18 Correct 4 ms 9820 KB Output is correct
19 Correct 4 ms 9820 KB Output is correct
20 Correct 4 ms 9764 KB Output is correct
21 Correct 4 ms 9820 KB Output is correct
22 Correct 4 ms 9820 KB Output is correct
23 Correct 5 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
25 Correct 4 ms 9820 KB Output is correct
26 Correct 4 ms 9800 KB Output is correct
27 Correct 4 ms 9820 KB Output is correct
28 Correct 4 ms 9820 KB Output is correct
29 Correct 5 ms 9816 KB Output is correct
30 Correct 4 ms 9672 KB Output is correct
31 Correct 4 ms 9816 KB Output is correct
32 Correct 4 ms 9816 KB Output is correct
33 Correct 4 ms 9820 KB Output is correct
34 Correct 4 ms 9820 KB Output is correct
35 Correct 4 ms 9820 KB Output is correct
36 Correct 4 ms 9820 KB Output is correct
37 Correct 4 ms 9816 KB Output is correct
38 Correct 5 ms 9820 KB Output is correct
39 Correct 4 ms 9820 KB Output is correct
40 Correct 4 ms 9820 KB Output is correct
41 Correct 4 ms 9820 KB Output is correct
42 Correct 4 ms 9820 KB Output is correct
43 Correct 5 ms 9820 KB Output is correct
44 Correct 7 ms 9816 KB Output is correct
45 Correct 5 ms 9820 KB Output is correct
46 Correct 4 ms 9820 KB Output is correct
47 Correct 4 ms 9820 KB Output is correct
48 Correct 4 ms 9820 KB Output is correct
49 Correct 6 ms 9816 KB Output is correct
50 Correct 5 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9820 KB Output is correct
4 Correct 4 ms 9816 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9820 KB Output is correct
8 Correct 4 ms 9816 KB Output is correct
9 Correct 4 ms 9820 KB Output is correct
10 Correct 4 ms 9760 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9820 KB Output is correct
16 Correct 4 ms 9872 KB Output is correct
17 Correct 4 ms 9816 KB Output is correct
18 Correct 4 ms 9820 KB Output is correct
19 Correct 4 ms 9716 KB Output is correct
20 Correct 4 ms 9816 KB Output is correct
21 Correct 4 ms 9820 KB Output is correct
22 Correct 7 ms 9820 KB Output is correct
23 Correct 4 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
25 Correct 5 ms 9820 KB Output is correct
26 Correct 4 ms 9820 KB Output is correct
27 Correct 4 ms 9764 KB Output is correct
28 Correct 4 ms 9820 KB Output is correct
29 Correct 4 ms 9820 KB Output is correct
30 Correct 5 ms 9820 KB Output is correct
31 Correct 5 ms 9820 KB Output is correct
32 Correct 4 ms 9820 KB Output is correct
33 Correct 4 ms 9800 KB Output is correct
34 Correct 4 ms 9820 KB Output is correct
35 Correct 4 ms 9820 KB Output is correct
36 Correct 5 ms 9816 KB Output is correct
37 Correct 4 ms 9672 KB Output is correct
38 Correct 4 ms 9816 KB Output is correct
39 Correct 4 ms 9816 KB Output is correct
40 Correct 4 ms 9820 KB Output is correct
41 Correct 4 ms 9820 KB Output is correct
42 Correct 4 ms 9820 KB Output is correct
43 Correct 4 ms 9820 KB Output is correct
44 Correct 4 ms 9816 KB Output is correct
45 Correct 5 ms 9820 KB Output is correct
46 Correct 4 ms 9820 KB Output is correct
47 Correct 4 ms 9820 KB Output is correct
48 Correct 4 ms 9820 KB Output is correct
49 Correct 4 ms 9820 KB Output is correct
50 Correct 5 ms 9820 KB Output is correct
51 Correct 7 ms 9816 KB Output is correct
52 Correct 5 ms 9820 KB Output is correct
53 Correct 4 ms 9820 KB Output is correct
54 Correct 4 ms 9820 KB Output is correct
55 Correct 4 ms 9820 KB Output is correct
56 Correct 6 ms 9816 KB Output is correct
57 Correct 5 ms 9820 KB Output is correct
58 Correct 5 ms 9816 KB Output is correct
59 Correct 4 ms 9820 KB Output is correct
60 Correct 4 ms 9820 KB Output is correct
61 Correct 5 ms 9820 KB Output is correct
62 Correct 4 ms 9820 KB Output is correct
63 Correct 4 ms 9820 KB Output is correct
64 Correct 4 ms 9820 KB Output is correct
65 Correct 4 ms 9820 KB Output is correct
66 Correct 5 ms 9816 KB Output is correct
67 Correct 4 ms 9816 KB Output is correct
68 Correct 5 ms 9816 KB Output is correct
69 Correct 7 ms 9940 KB Output is correct
70 Correct 4 ms 9796 KB Output is correct
71 Correct 5 ms 9820 KB Output is correct
72 Correct 5 ms 9820 KB Output is correct
73 Correct 4 ms 9820 KB Output is correct
74 Correct 4 ms 9820 KB Output is correct
75 Correct 4 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9820 KB Output is correct
4 Correct 4 ms 9816 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9820 KB Output is correct
8 Correct 4 ms 9816 KB Output is correct
9 Correct 4 ms 9820 KB Output is correct
10 Correct 4 ms 9760 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9820 KB Output is correct
16 Correct 4 ms 9872 KB Output is correct
17 Correct 4 ms 9816 KB Output is correct
18 Correct 4 ms 9820 KB Output is correct
19 Correct 4 ms 9716 KB Output is correct
20 Correct 4 ms 9816 KB Output is correct
21 Correct 4 ms 9820 KB Output is correct
22 Correct 7 ms 9820 KB Output is correct
23 Correct 4 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
25 Correct 5 ms 9820 KB Output is correct
26 Correct 6 ms 9820 KB Output is correct
27 Correct 6 ms 10332 KB Output is correct
28 Correct 5 ms 10420 KB Output is correct
29 Correct 179 ms 10320 KB Output is correct
30 Correct 152 ms 10328 KB Output is correct
31 Correct 14 ms 10332 KB Output is correct
32 Correct 23 ms 10332 KB Output is correct
33 Correct 23 ms 10332 KB Output is correct
34 Correct 4 ms 9820 KB Output is correct
35 Correct 4 ms 9764 KB Output is correct
36 Correct 4 ms 9820 KB Output is correct
37 Correct 4 ms 9820 KB Output is correct
38 Correct 5 ms 9820 KB Output is correct
39 Correct 5 ms 9820 KB Output is correct
40 Correct 4 ms 9820 KB Output is correct
41 Correct 4 ms 9800 KB Output is correct
42 Correct 4 ms 9820 KB Output is correct
43 Correct 4 ms 9820 KB Output is correct
44 Correct 5 ms 9816 KB Output is correct
45 Correct 4 ms 9672 KB Output is correct
46 Correct 4 ms 9816 KB Output is correct
47 Correct 4 ms 9816 KB Output is correct
48 Correct 4 ms 9820 KB Output is correct
49 Correct 4 ms 9820 KB Output is correct
50 Correct 4 ms 9820 KB Output is correct
51 Correct 4 ms 9820 KB Output is correct
52 Correct 4 ms 9816 KB Output is correct
53 Correct 5 ms 9820 KB Output is correct
54 Correct 4 ms 9820 KB Output is correct
55 Correct 4 ms 9820 KB Output is correct
56 Correct 4 ms 9820 KB Output is correct
57 Correct 4 ms 9820 KB Output is correct
58 Correct 5 ms 9820 KB Output is correct
59 Correct 7 ms 9816 KB Output is correct
60 Correct 5 ms 9820 KB Output is correct
61 Correct 4 ms 9820 KB Output is correct
62 Correct 4 ms 9820 KB Output is correct
63 Correct 4 ms 9820 KB Output is correct
64 Correct 6 ms 9816 KB Output is correct
65 Correct 5 ms 9820 KB Output is correct
66 Correct 5 ms 9816 KB Output is correct
67 Correct 4 ms 9820 KB Output is correct
68 Correct 4 ms 9820 KB Output is correct
69 Correct 5 ms 9820 KB Output is correct
70 Correct 4 ms 9820 KB Output is correct
71 Correct 4 ms 9820 KB Output is correct
72 Correct 4 ms 9820 KB Output is correct
73 Correct 4 ms 9820 KB Output is correct
74 Correct 5 ms 9816 KB Output is correct
75 Correct 4 ms 9816 KB Output is correct
76 Correct 5 ms 9816 KB Output is correct
77 Correct 7 ms 9940 KB Output is correct
78 Correct 4 ms 9796 KB Output is correct
79 Correct 5 ms 9820 KB Output is correct
80 Correct 5 ms 9820 KB Output is correct
81 Correct 4 ms 9820 KB Output is correct
82 Correct 4 ms 9820 KB Output is correct
83 Correct 4 ms 9820 KB Output is correct
84 Correct 5 ms 10072 KB Output is correct
85 Correct 6 ms 9820 KB Output is correct
86 Correct 7 ms 9820 KB Output is correct
87 Correct 7 ms 9792 KB Output is correct
88 Correct 9 ms 9820 KB Output is correct
89 Correct 6 ms 10332 KB Output is correct
90 Correct 7 ms 10332 KB Output is correct
91 Correct 32 ms 10332 KB Output is correct
92 Correct 5 ms 10328 KB Output is correct
93 Correct 7 ms 10076 KB Output is correct
94 Correct 26 ms 10328 KB Output is correct
95 Correct 171 ms 10360 KB Output is correct
96 Correct 20 ms 10076 KB Output is correct
97 Correct 232 ms 10076 KB Output is correct
98 Correct 10 ms 10328 KB Output is correct
99 Correct 6 ms 10384 KB Output is correct
100 Correct 6 ms 10076 KB Output is correct
101 Correct 5 ms 10000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 9692 KB Output is correct
2 Correct 4 ms 9820 KB Output is correct
3 Correct 4 ms 9820 KB Output is correct
4 Correct 4 ms 9816 KB Output is correct
5 Correct 4 ms 9820 KB Output is correct
6 Correct 4 ms 9820 KB Output is correct
7 Correct 4 ms 9820 KB Output is correct
8 Correct 4 ms 9816 KB Output is correct
9 Correct 4 ms 9820 KB Output is correct
10 Correct 4 ms 9760 KB Output is correct
11 Correct 4 ms 9820 KB Output is correct
12 Correct 4 ms 9820 KB Output is correct
13 Correct 4 ms 9820 KB Output is correct
14 Correct 4 ms 9820 KB Output is correct
15 Correct 4 ms 9820 KB Output is correct
16 Correct 4 ms 9872 KB Output is correct
17 Correct 4 ms 9816 KB Output is correct
18 Correct 4 ms 9820 KB Output is correct
19 Correct 4 ms 9716 KB Output is correct
20 Correct 4 ms 9816 KB Output is correct
21 Correct 4 ms 9820 KB Output is correct
22 Correct 7 ms 9820 KB Output is correct
23 Correct 4 ms 9820 KB Output is correct
24 Correct 5 ms 9820 KB Output is correct
25 Correct 5 ms 9820 KB Output is correct
26 Correct 6 ms 9820 KB Output is correct
27 Correct 6 ms 10332 KB Output is correct
28 Correct 5 ms 10420 KB Output is correct
29 Correct 179 ms 10320 KB Output is correct
30 Correct 152 ms 10328 KB Output is correct
31 Correct 14 ms 10332 KB Output is correct
32 Correct 23 ms 10332 KB Output is correct
33 Correct 23 ms 10332 KB Output is correct
34 Correct 4 ms 9820 KB Output is correct
35 Correct 4 ms 9764 KB Output is correct
36 Correct 4 ms 9820 KB Output is correct
37 Correct 4 ms 9820 KB Output is correct
38 Correct 5 ms 9820 KB Output is correct
39 Correct 5 ms 9820 KB Output is correct
40 Correct 4 ms 9820 KB Output is correct
41 Correct 4 ms 9800 KB Output is correct
42 Correct 4 ms 9820 KB Output is correct
43 Correct 4 ms 9820 KB Output is correct
44 Correct 5 ms 9816 KB Output is correct
45 Correct 4 ms 9672 KB Output is correct
46 Correct 4 ms 9816 KB Output is correct
47 Correct 4 ms 9816 KB Output is correct
48 Correct 4 ms 9820 KB Output is correct
49 Correct 4 ms 9820 KB Output is correct
50 Correct 4 ms 9820 KB Output is correct
51 Correct 4 ms 9820 KB Output is correct
52 Correct 4 ms 9816 KB Output is correct
53 Correct 5 ms 9820 KB Output is correct
54 Correct 4 ms 9820 KB Output is correct
55 Correct 4 ms 9820 KB Output is correct
56 Correct 4 ms 9820 KB Output is correct
57 Correct 4 ms 9820 KB Output is correct
58 Correct 5 ms 9820 KB Output is correct
59 Correct 7 ms 9816 KB Output is correct
60 Correct 5 ms 9820 KB Output is correct
61 Correct 4 ms 9820 KB Output is correct
62 Correct 4 ms 9820 KB Output is correct
63 Correct 4 ms 9820 KB Output is correct
64 Correct 6 ms 9816 KB Output is correct
65 Correct 5 ms 9820 KB Output is correct
66 Correct 5 ms 9816 KB Output is correct
67 Correct 4 ms 9820 KB Output is correct
68 Correct 4 ms 9820 KB Output is correct
69 Correct 5 ms 9820 KB Output is correct
70 Correct 4 ms 9820 KB Output is correct
71 Correct 4 ms 9820 KB Output is correct
72 Correct 4 ms 9820 KB Output is correct
73 Correct 4 ms 9820 KB Output is correct
74 Correct 5 ms 9816 KB Output is correct
75 Correct 4 ms 9816 KB Output is correct
76 Correct 5 ms 9816 KB Output is correct
77 Correct 7 ms 9940 KB Output is correct
78 Correct 4 ms 9796 KB Output is correct
79 Correct 5 ms 9820 KB Output is correct
80 Correct 5 ms 9820 KB Output is correct
81 Correct 4 ms 9820 KB Output is correct
82 Correct 4 ms 9820 KB Output is correct
83 Correct 4 ms 9820 KB Output is correct
84 Correct 5 ms 10072 KB Output is correct
85 Correct 6 ms 9820 KB Output is correct
86 Correct 7 ms 9820 KB Output is correct
87 Correct 7 ms 9792 KB Output is correct
88 Correct 9 ms 9820 KB Output is correct
89 Correct 6 ms 10332 KB Output is correct
90 Correct 7 ms 10332 KB Output is correct
91 Correct 32 ms 10332 KB Output is correct
92 Correct 5 ms 10328 KB Output is correct
93 Correct 7 ms 10076 KB Output is correct
94 Correct 26 ms 10328 KB Output is correct
95 Correct 171 ms 10360 KB Output is correct
96 Correct 20 ms 10076 KB Output is correct
97 Correct 232 ms 10076 KB Output is correct
98 Correct 10 ms 10328 KB Output is correct
99 Correct 6 ms 10384 KB Output is correct
100 Correct 6 ms 10076 KB Output is correct
101 Correct 5 ms 10000 KB Output is correct
102 Correct 109 ms 12380 KB Output is correct
103 Correct 109 ms 12384 KB Output is correct
104 Execution timed out 1075 ms 39508 KB Time limit exceeded
105 Halted 0 ms 0 KB -