Submission #853064

# Submission time Handle Problem Language Result Execution time Memory
853064 2023-09-23T11:34:44 Z mickey080929 Closing Time (IOI23_closing) C++17
100 / 100
415 ms 84440 KB
#include "closing.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll inf = 2e18;

struct SegmentTree{
	int n, sz;
	vector<pair<ll,int>> tree;
	void init(int n_) {
		n = n_;
		sz = 1 << (__lg(n-1) + 1);
		tree.resize(sz<<1);
		build();
	}
	void build() {
        for (int i=0; i<sz; i++) tree[sz+i] = {inf, i};
        for (int i=sz-1; i>=1; i--) tree[i] = min(tree[i<<1], tree[i<<1|1]);
    };
	void ins(int pos, ll val) {
		tree[pos+sz] = {val, pos};
		for (pos += sz; pos > 1; pos >>= 1)
			tree[pos>>1] = min(tree[pos], tree[pos^1]);
	}
	void del(int tar) { ins(tar, inf); }
	pair<ll,int> get_top() { return tree[1]; }
};

SegmentTree xtoa, xtoab, atoab, atox, abtoa;

vector<int> par;
vector<ll> distX, distY;
vector<vector<pair<int,ll>>> adj;

void dfs1(int x, int p) {
	for (auto &[y, c] : adj[x]) {
		if (y == p) continue;
		par[y] = x;
		distX[y] = distX[x] + c;
		dfs1(y, x);
	}
}

void dfs2(int x, int p) {
	for (auto &[y, c] : adj[x]) {
		if (y == p) continue;
		distY[y] = distY[x] + c;
		dfs2(y, x);
	}
}

void init(int n) {
	par.assign(n, 0);
	distX.assign(n, 0);
	distY.assign(n, 0);
	adj.assign(n, vector<pair<int,ll>>());
}

int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) {
	init(N);
	for (int i=0; i<N-1; i++) {
		adj[U[i]].emplace_back(V[i], (ll)W[i]);
		adj[V[i]].emplace_back(U[i], (ll)W[i]);
	}
	par[X] = -1; distX[X] = 0;
	dfs1(X, -1);
	distY[Y] = 0;
	dfs2(Y, -1);
	vector<ll> A(N, 0), B(N, 0);
	for (int i=0; i<N; i++) {
		A[i] = min(distX[i], distY[i]);
		B[i] = max(distX[i], distY[i]) - A[i];	
	}
	int ans = 0;
	ll sum = 0;
	vector<ll> t = A;
	sort(t.begin(), t.end());
	for (int i=0; i<N; i++) {
		sum += t[i];
		if (sum > K) break;
		ans ++;
	}
	vector<int> inpath(N, 0);
	int x = Y;
	int cnt = 0;
	while (x != -1) {
		inpath[x] = 1;
		cnt ++;
		x = par[x];
	}
	vector<ll> cost1(2*cnt+1, 0), cost2(2*(N-cnt)+1, 0);
	t.clear();
	xtoa.init(N); xtoab.init(N);
	atoab.init(N); atox.init(N);
	abtoa.init(N);
	for (int i=0; i<N; i++) {
		if (inpath[i]) {
			cost1[cnt] += A[i];
			t.push_back(B[i]);
		}
		else {
			xtoa.ins(i, A[i]);
			xtoab.ins(i, A[i]+B[i]);
		}
	}
	sort(t.begin(), t.end());
	for (int i=0; i<cnt; i++) cost1[cnt+i+1] = cost1[cnt+i] + t[i];
	ll cur = 0;
	for (int i=1; i<=2*(N-cnt); i++) {
		ll t1 = xtoa.get_top().first;
		ll t2 = atoab.get_top().first;
		ll t3 = xtoab.get_top().first + abtoa.get_top().first;
		ll t4 = xtoab.get_top().first + atox.get_top().first;
		if (t1 < t2 && t1 < t3 && t1 < t4) {
			cur += t1;
			int idx = xtoa.get_top().second;
			xtoa.del(idx);
			xtoab.del(idx);
			atoab.ins(idx, B[idx]);
			atox.ins(idx, -A[idx]);
		}
		else if (t2 < t3 && t2 < t4) {
			cur += t2;
			int idx = atoab.get_top().second;
			atoab.del(idx);
			atox.del(idx);
			abtoa.ins(idx, -B[idx]);
		}
		else if (t3 < t4) {
			cur += t3;
			int idx1 = xtoab.get_top().second, idx2 = abtoa.get_top().second;
			xtoa.del(idx1);
			xtoab.del(idx1);
			atoab.ins(idx2, B[idx2]);
			atox.ins(idx2, -A[idx2]);
			abtoa.ins(idx1, -B[idx1]);
			abtoa.del(idx2);
		}
		else {
			cur += t4;
			int idx1 = xtoab.get_top().second, idx2 = atox.get_top().second;
			xtoa.del(idx1);
			xtoa.ins(idx2, A[idx2]);
			xtoab.del(idx1);
			xtoab.ins(idx2, A[idx2]+B[idx2]);
			atoab.del(idx2);
			atox.del(idx2);
			abtoa.ins(idx1, -B[idx1]);
		}
		cost2[i] = cur;
	}
	int j = 0;
	for (int i=cnt*2; i>=cnt; i--) {
		if (cost1[i] > K) continue;
		while (j < (N-cnt)*2 && cost1[i] + cost2[j+1] <= K) j ++;
		ans = max(ans, i + j);
	}

    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 302 ms 80528 KB Output is correct
2 Correct 231 ms 84440 KB Output is correct
3 Correct 111 ms 5972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 600 KB Output is correct
20 Correct 1 ms 436 KB Output is correct
21 Correct 1 ms 604 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 436 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 600 KB Output is correct
20 Correct 1 ms 436 KB Output is correct
21 Correct 1 ms 604 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 2 ms 444 KB Output is correct
26 Correct 4 ms 1628 KB Output is correct
27 Correct 3 ms 1532 KB Output is correct
28 Correct 2 ms 1628 KB Output is correct
29 Correct 3 ms 1628 KB Output is correct
30 Correct 3 ms 1628 KB Output is correct
31 Correct 2 ms 1728 KB Output is correct
32 Correct 2 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 432 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 432 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 344 KB Output is correct
34 Correct 0 ms 344 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 432 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 1 ms 600 KB Output is correct
42 Correct 1 ms 440 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 1 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 1 ms 348 KB Output is correct
48 Correct 1 ms 348 KB Output is correct
49 Correct 1 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 600 KB Output is correct
21 Correct 1 ms 436 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 432 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 344 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 0 ms 344 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 1 ms 344 KB Output is correct
44 Correct 1 ms 344 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 432 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 1 ms 600 KB Output is correct
49 Correct 1 ms 440 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 1 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 1 ms 348 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 444 KB Output is correct
59 Correct 1 ms 444 KB Output is correct
60 Correct 1 ms 344 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 432 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 604 KB Output is correct
69 Correct 1 ms 604 KB Output is correct
70 Correct 1 ms 604 KB Output is correct
71 Correct 1 ms 604 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 480 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 600 KB Output is correct
21 Correct 1 ms 436 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 2 ms 444 KB Output is correct
27 Correct 4 ms 1628 KB Output is correct
28 Correct 3 ms 1532 KB Output is correct
29 Correct 2 ms 1628 KB Output is correct
30 Correct 3 ms 1628 KB Output is correct
31 Correct 3 ms 1628 KB Output is correct
32 Correct 2 ms 1728 KB Output is correct
33 Correct 2 ms 1628 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 344 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 0 ms 432 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 1 ms 344 KB Output is correct
48 Correct 1 ms 344 KB Output is correct
49 Correct 0 ms 344 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 344 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 432 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 ms 600 KB Output is correct
57 Correct 1 ms 440 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 444 KB Output is correct
67 Correct 1 ms 444 KB Output is correct
68 Correct 1 ms 344 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 432 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 604 KB Output is correct
79 Correct 1 ms 604 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 480 KB Output is correct
84 Correct 2 ms 348 KB Output is correct
85 Correct 3 ms 632 KB Output is correct
86 Correct 2 ms 444 KB Output is correct
87 Correct 3 ms 348 KB Output is correct
88 Correct 3 ms 348 KB Output is correct
89 Correct 4 ms 1512 KB Output is correct
90 Correct 3 ms 1368 KB Output is correct
91 Correct 4 ms 1628 KB Output is correct
92 Correct 3 ms 1372 KB Output is correct
93 Correct 3 ms 1368 KB Output is correct
94 Correct 2 ms 1628 KB Output is correct
95 Correct 2 ms 1628 KB Output is correct
96 Correct 3 ms 1628 KB Output is correct
97 Correct 3 ms 1628 KB Output is correct
98 Correct 4 ms 1372 KB Output is correct
99 Correct 3 ms 1472 KB Output is correct
100 Correct 3 ms 1372 KB Output is correct
101 Correct 3 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 436 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 600 KB Output is correct
21 Correct 1 ms 436 KB Output is correct
22 Correct 1 ms 604 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 1 ms 604 KB Output is correct
26 Correct 2 ms 444 KB Output is correct
27 Correct 4 ms 1628 KB Output is correct
28 Correct 3 ms 1532 KB Output is correct
29 Correct 2 ms 1628 KB Output is correct
30 Correct 3 ms 1628 KB Output is correct
31 Correct 3 ms 1628 KB Output is correct
32 Correct 2 ms 1728 KB Output is correct
33 Correct 2 ms 1628 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 344 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 0 ms 432 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 1 ms 344 KB Output is correct
48 Correct 1 ms 344 KB Output is correct
49 Correct 0 ms 344 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 1 ms 344 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 432 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 ms 600 KB Output is correct
57 Correct 1 ms 440 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 444 KB Output is correct
67 Correct 1 ms 444 KB Output is correct
68 Correct 1 ms 344 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 432 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 604 KB Output is correct
77 Correct 1 ms 604 KB Output is correct
78 Correct 1 ms 604 KB Output is correct
79 Correct 1 ms 604 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 480 KB Output is correct
84 Correct 2 ms 348 KB Output is correct
85 Correct 3 ms 632 KB Output is correct
86 Correct 2 ms 444 KB Output is correct
87 Correct 3 ms 348 KB Output is correct
88 Correct 3 ms 348 KB Output is correct
89 Correct 4 ms 1512 KB Output is correct
90 Correct 3 ms 1368 KB Output is correct
91 Correct 4 ms 1628 KB Output is correct
92 Correct 3 ms 1372 KB Output is correct
93 Correct 3 ms 1368 KB Output is correct
94 Correct 2 ms 1628 KB Output is correct
95 Correct 2 ms 1628 KB Output is correct
96 Correct 3 ms 1628 KB Output is correct
97 Correct 3 ms 1628 KB Output is correct
98 Correct 4 ms 1372 KB Output is correct
99 Correct 3 ms 1472 KB Output is correct
100 Correct 3 ms 1372 KB Output is correct
101 Correct 3 ms 600 KB Output is correct
102 Correct 143 ms 5788 KB Output is correct
103 Correct 155 ms 5780 KB Output is correct
104 Correct 283 ms 82260 KB Output is correct
105 Correct 204 ms 8132 KB Output is correct
106 Correct 162 ms 5336 KB Output is correct
107 Correct 214 ms 70076 KB Output is correct
108 Correct 223 ms 70760 KB Output is correct
109 Correct 123 ms 79192 KB Output is correct
110 Correct 415 ms 74080 KB Output is correct
111 Correct 224 ms 76112 KB Output is correct
112 Correct 364 ms 73708 KB Output is correct
113 Correct 339 ms 72488 KB Output is correct
114 Correct 326 ms 73116 KB Output is correct
115 Correct 121 ms 80956 KB Output is correct
116 Correct 330 ms 75028 KB Output is correct
117 Correct 331 ms 75968 KB Output is correct
118 Correct 379 ms 73684 KB Output is correct
119 Correct 218 ms 12552 KB Output is correct
120 Correct 116 ms 3196 KB Output is correct