Submission #544586

# Submission time Handle Problem Language Result Execution time Memory
544586 2022-04-02T13:10:42 Z hollwo_pelw Jail (JOI22_jail) C++17
100 / 100
2253 ms 164936 KB
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/trie_policy.hpp>
// #include <ext/rope>

using namespace std;
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;

void Hollwo_Pelw();

signed main(){
#ifndef hollwo_pelw_local
	if (fopen("jail.inp", "r")){
		freopen("jail.inp", "r", stdin);
		freopen("jail.out", "w", stdout);
	}
#else
	auto start = chrono::steady_clock::now();
#endif
	cin.tie(0), cout.tie(0) -> sync_with_stdio(0);
	int testcases = 1;
	cin >> testcases;
	for (int test = 1; test <= testcases; test++){
		// cout << "Case #" << test << ": ";
		Hollwo_Pelw();
	}
#ifdef hollwo_pelw_local
	auto end = chrono::steady_clock::now();
	cout << "\nExcution time : " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl;
#endif
}

const int N = 1.2e5 + 5, M = N << 3;

int n, nxt[N], siz[N], par[N], tin[N], h[N], timer;
vector<int> adj[N];
// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------
void pre_dfs(int u, int p) {
	h[u] = h[par[u] = p] + 1;
	siz[u] = 1, nxt[u] = u;
	for (int &v : adj[u]) {
		if (v == p) swap(v, adj[u].back());
		if (v == p) return adj[u].pop_back();

		pre_dfs(v, u);
		siz[u] += siz[v];

		if (siz[v] > siz[adj[u][0]])
			swap(v, adj[u][0]);
	}
}

void dfs_hld(int u) {
	tin[u] = ++ timer;
	for (int &v : adj[u]) {
		if (v == adj[u][0])
			nxt[v] = nxt[u];
		dfs_hld(v);
	}
}

inline void __build_hld__() {
	timer = 0, pre_dfs(1, 0), dfs_hld(1);
}
// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------
int m, nnode, vis[M], f[N], path[N][2];
int st[M], lc[M], rc[M];
vector<int> g[2][M];

#define tm ((tl + tr) >> 1)

int build(int t, int tl = 1, int tr = n) {
	int id = ++ nnode;
	if (tl == tr) {
		if (f[tl]) {
			g[t][id].push_back(f[tl]);
			g[t ^ 1][f[tl]].push_back(id);

			// cout << "AMONGUS : ";
			// if (!t) cout << id << " -> " << f[tl] << '\n';
			// else	cout << f[tl] << " -> " << id << '\n';
		}
	} else {
		lc[id] = build(t, tl, tm);
		rc[id] = build(t, tm + 1, tr);

		g[t][id].push_back(lc[id]);
		g[t][id].push_back(rc[id]);
		g[t ^ 1][lc[id]].push_back(id);
		g[t ^ 1][rc[id]].push_back(id);

		// if (!t) cout << id << " -> " << lc[id] << '\n';
		// else	cout << lc[id] << " -> " << id << '\n';

		// if (!t) cout << id << " -> " << rc[id] << '\n';
		// else	cout << rc[id] << " -> " << id << '\n';
	}
	return id;
}

void add_edge(int l, int r, int t, int v, int id, int tl = 1, int tr = n) {
	if (l > tr || tl > r) return ;
	if (l <= tl && tr <= r) {

		// cout << "madge : ";

		// if (!t) cout << v << " -> " << id << '\n';
		// else	cout << id << " -> " << v << '\n';

		g[t][v].push_back(id);
		g[t ^ 1][id].push_back(v);
		return ;
	}
	add_edge(l, r, t, v, lc[id], tl, tm);
	add_edge(l, r, t, v, rc[id], tm + 1, tr);
}

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

void update(int rt, int s, int ed, int u, int v) {
	while (nxt[u] != nxt[v]) {
		if (h[nxt[u]] > h[nxt[v]])
			swap(u, v);
		add_edge(tin[nxt[v]], tin[v], s, ed, rt);
		v = par[nxt[v]];
	}
	if (tin[u] > tin[v])
		swap(u, v);
	add_edge(tin[u], tin[v], s, ed, rt);
}

// void upd(int s, int ed, int u, int v) { -> OK
// 	while (u != v) {
// 		if (h[u] > h[v]) swap(u, v);
// 		if (f[v]) {
// 			g[s][ed].push_back(f[v]);
// 			g[s ^ 1][f[v]].push_back(ed);
// 		}
// 		v = par[v];
// 	}

// 	if (f[v]) {
// 		g[s][ed].push_back(f[v]);
// 		g[s ^ 1][f[v]].push_back(ed);	
// 	}
// }

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

vector<int> ord;

void dfs1(int u) {
	vis[u] = 1;
	for (int v : g[0][u])
		if (!vis[v]) dfs1(v);
	ord.push_back(u);
}

void dfs2(int u, int c) {
	vis[u] = c;
	for (int v : g[1][u])
		if (!vis[v]) dfs2(v, c);
}

// ------->>>>>>>>>>>>> <<<<<<<<<<<<<-------

void Hollwo_Pelw(){
	cin >> n;
	for (int i = 1, u, v; i < n; i++) {
		cin >> u >> v;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	__build_hld__();

	// for (int i = 1; i <= n; i++)
	// 	cout << tin[i] << " \n"[i == n];
	// for (int i = 1; i <= n; i++)
	// 	cout << nxt[i] << " \n"[i == n];

	cin >> m, nnode = m;
	for (int i = 1; i <= m; i++) {
		cin >> path[i][0] >> path[i][1];
	}

	for (int s = 0; s < 2; s++) {
		// cout << "\nDEBUG " << s << "\n\n";
		fill(f + 1, f + n + 1, 0);
		for (int i = 1; i <= m; i++)
			f[tin[path[i][s]]] = i;

		int rt = build(s);

		for (int i = 1; i <= m; i++)
			// upd(s, i, path[i][0], path[i][1]);
			update(rt, s, i, path[i][0], path[i][1]);
	}
	
	int cnt = 0;
	
	fill(vis + 1, vis + nnode + 1, 0);
	for (int i = 1; i <= nnode; i++)
		if (!vis[i]) dfs1(i);

	fill(vis + 1, vis + nnode + 1, 0);
	reverse(ord.begin(), ord.end());
	for (int i : ord)
		if (!vis[i]) dfs2(i, ++ cnt);
	ord.clear();

	set<int> distinct;

	for (int i = 1; i <= m; i++)
		distinct.insert(vis[i]);

	cout << ((int) distinct.size() == m ? "Yes\n" : "No\n");

	for (int i = 1; i <= n; i++)
		adj[i].clear();
	for (int i = 1; i <= nnode; i++)
		g[0][i].clear(), g[1][i].clear();
}

Compilation message

jail.cpp: In function 'int main()':
jail.cpp:15:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   freopen("jail.inp", "r", stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
jail.cpp:16:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |   freopen("jail.out", "w", stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 23 ms 48340 KB Output is correct
2 Correct 23 ms 48184 KB Output is correct
3 Correct 22 ms 48212 KB Output is correct
4 Correct 39 ms 48320 KB Output is correct
5 Correct 57 ms 48332 KB Output is correct
6 Correct 24 ms 48292 KB Output is correct
7 Correct 24 ms 48340 KB Output is correct
8 Correct 30 ms 48340 KB Output is correct
9 Correct 79 ms 50960 KB Output is correct
10 Correct 127 ms 94812 KB Output is correct
11 Correct 32 ms 48212 KB Output is correct
12 Correct 87 ms 48340 KB Output is correct
13 Correct 271 ms 109160 KB Output is correct
14 Correct 278 ms 109412 KB Output is correct
15 Correct 558 ms 118988 KB Output is correct
16 Correct 1037 ms 156900 KB Output is correct
17 Correct 352 ms 125884 KB Output is correct
18 Correct 283 ms 121240 KB Output is correct
19 Correct 312 ms 122224 KB Output is correct
20 Correct 299 ms 122188 KB Output is correct
21 Correct 374 ms 123836 KB Output is correct
22 Correct 213 ms 104824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 48212 KB Output is correct
2 Correct 21 ms 48200 KB Output is correct
3 Correct 25 ms 48376 KB Output is correct
4 Correct 25 ms 48276 KB Output is correct
5 Correct 26 ms 48320 KB Output is correct
6 Correct 26 ms 48340 KB Output is correct
7 Correct 25 ms 48340 KB Output is correct
8 Correct 25 ms 48420 KB Output is correct
9 Correct 26 ms 48324 KB Output is correct
10 Correct 26 ms 48312 KB Output is correct
11 Correct 24 ms 48344 KB Output is correct
12 Correct 23 ms 48376 KB Output is correct
13 Correct 23 ms 48320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 48212 KB Output is correct
2 Correct 21 ms 48200 KB Output is correct
3 Correct 25 ms 48376 KB Output is correct
4 Correct 25 ms 48276 KB Output is correct
5 Correct 26 ms 48320 KB Output is correct
6 Correct 26 ms 48340 KB Output is correct
7 Correct 25 ms 48340 KB Output is correct
8 Correct 25 ms 48420 KB Output is correct
9 Correct 26 ms 48324 KB Output is correct
10 Correct 26 ms 48312 KB Output is correct
11 Correct 24 ms 48344 KB Output is correct
12 Correct 23 ms 48376 KB Output is correct
13 Correct 23 ms 48320 KB Output is correct
14 Correct 24 ms 48252 KB Output is correct
15 Correct 22 ms 48220 KB Output is correct
16 Correct 23 ms 48300 KB Output is correct
17 Correct 26 ms 48400 KB Output is correct
18 Correct 25 ms 48340 KB Output is correct
19 Correct 25 ms 48212 KB Output is correct
20 Correct 25 ms 48340 KB Output is correct
21 Correct 25 ms 48288 KB Output is correct
22 Correct 25 ms 48340 KB Output is correct
23 Correct 24 ms 48212 KB Output is correct
24 Correct 23 ms 48256 KB Output is correct
25 Correct 25 ms 48340 KB Output is correct
26 Correct 24 ms 48376 KB Output is correct
27 Correct 25 ms 48304 KB Output is correct
28 Correct 25 ms 48268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 48212 KB Output is correct
2 Correct 21 ms 48200 KB Output is correct
3 Correct 25 ms 48376 KB Output is correct
4 Correct 25 ms 48276 KB Output is correct
5 Correct 26 ms 48320 KB Output is correct
6 Correct 26 ms 48340 KB Output is correct
7 Correct 25 ms 48340 KB Output is correct
8 Correct 25 ms 48420 KB Output is correct
9 Correct 26 ms 48324 KB Output is correct
10 Correct 26 ms 48312 KB Output is correct
11 Correct 24 ms 48344 KB Output is correct
12 Correct 23 ms 48376 KB Output is correct
13 Correct 23 ms 48320 KB Output is correct
14 Correct 24 ms 48252 KB Output is correct
15 Correct 22 ms 48220 KB Output is correct
16 Correct 23 ms 48300 KB Output is correct
17 Correct 26 ms 48400 KB Output is correct
18 Correct 25 ms 48340 KB Output is correct
19 Correct 25 ms 48212 KB Output is correct
20 Correct 25 ms 48340 KB Output is correct
21 Correct 25 ms 48288 KB Output is correct
22 Correct 25 ms 48340 KB Output is correct
23 Correct 24 ms 48212 KB Output is correct
24 Correct 23 ms 48256 KB Output is correct
25 Correct 25 ms 48340 KB Output is correct
26 Correct 24 ms 48376 KB Output is correct
27 Correct 25 ms 48304 KB Output is correct
28 Correct 25 ms 48268 KB Output is correct
29 Correct 26 ms 48356 KB Output is correct
30 Correct 28 ms 48340 KB Output is correct
31 Correct 30 ms 48360 KB Output is correct
32 Correct 26 ms 48368 KB Output is correct
33 Correct 25 ms 48276 KB Output is correct
34 Correct 27 ms 48340 KB Output is correct
35 Correct 26 ms 48404 KB Output is correct
36 Correct 27 ms 48340 KB Output is correct
37 Correct 25 ms 48304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 48212 KB Output is correct
2 Correct 21 ms 48200 KB Output is correct
3 Correct 25 ms 48376 KB Output is correct
4 Correct 25 ms 48276 KB Output is correct
5 Correct 26 ms 48320 KB Output is correct
6 Correct 26 ms 48340 KB Output is correct
7 Correct 25 ms 48340 KB Output is correct
8 Correct 25 ms 48420 KB Output is correct
9 Correct 26 ms 48324 KB Output is correct
10 Correct 26 ms 48312 KB Output is correct
11 Correct 24 ms 48344 KB Output is correct
12 Correct 23 ms 48376 KB Output is correct
13 Correct 23 ms 48320 KB Output is correct
14 Correct 24 ms 48252 KB Output is correct
15 Correct 22 ms 48220 KB Output is correct
16 Correct 23 ms 48300 KB Output is correct
17 Correct 26 ms 48400 KB Output is correct
18 Correct 25 ms 48340 KB Output is correct
19 Correct 25 ms 48212 KB Output is correct
20 Correct 25 ms 48340 KB Output is correct
21 Correct 25 ms 48288 KB Output is correct
22 Correct 25 ms 48340 KB Output is correct
23 Correct 24 ms 48212 KB Output is correct
24 Correct 23 ms 48256 KB Output is correct
25 Correct 25 ms 48340 KB Output is correct
26 Correct 24 ms 48376 KB Output is correct
27 Correct 25 ms 48304 KB Output is correct
28 Correct 25 ms 48268 KB Output is correct
29 Correct 26 ms 48356 KB Output is correct
30 Correct 28 ms 48340 KB Output is correct
31 Correct 30 ms 48360 KB Output is correct
32 Correct 26 ms 48368 KB Output is correct
33 Correct 25 ms 48276 KB Output is correct
34 Correct 27 ms 48340 KB Output is correct
35 Correct 26 ms 48404 KB Output is correct
36 Correct 27 ms 48340 KB Output is correct
37 Correct 25 ms 48304 KB Output is correct
38 Correct 79 ms 51020 KB Output is correct
39 Correct 129 ms 94788 KB Output is correct
40 Correct 107 ms 50944 KB Output is correct
41 Correct 104 ms 51000 KB Output is correct
42 Correct 92 ms 51176 KB Output is correct
43 Correct 64 ms 50516 KB Output is correct
44 Correct 51 ms 49156 KB Output is correct
45 Correct 150 ms 85452 KB Output is correct
46 Correct 147 ms 85504 KB Output is correct
47 Correct 133 ms 90048 KB Output is correct
48 Correct 135 ms 90012 KB Output is correct
49 Correct 144 ms 85624 KB Output is correct
50 Correct 144 ms 85720 KB Output is correct
51 Correct 135 ms 86704 KB Output is correct
52 Correct 132 ms 86760 KB Output is correct
53 Correct 50 ms 51276 KB Output is correct
54 Correct 153 ms 85440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 48216 KB Output is correct
2 Correct 22 ms 48180 KB Output is correct
3 Correct 24 ms 48260 KB Output is correct
4 Correct 25 ms 48224 KB Output is correct
5 Correct 33 ms 48212 KB Output is correct
6 Correct 25 ms 48244 KB Output is correct
7 Correct 25 ms 48376 KB Output is correct
8 Correct 23 ms 48244 KB Output is correct
9 Correct 26 ms 48176 KB Output is correct
10 Correct 23 ms 48212 KB Output is correct
11 Correct 25 ms 48212 KB Output is correct
12 Correct 27 ms 48340 KB Output is correct
13 Correct 72 ms 48332 KB Output is correct
14 Correct 102 ms 48340 KB Output is correct
15 Correct 84 ms 48380 KB Output is correct
16 Correct 280 ms 89196 KB Output is correct
17 Correct 813 ms 112640 KB Output is correct
18 Correct 1445 ms 144244 KB Output is correct
19 Correct 400 ms 93756 KB Output is correct
20 Correct 371 ms 93780 KB Output is correct
21 Correct 398 ms 94044 KB Output is correct
22 Correct 767 ms 110572 KB Output is correct
23 Correct 564 ms 110272 KB Output is correct
24 Correct 618 ms 110776 KB Output is correct
25 Correct 639 ms 111084 KB Output is correct
26 Correct 614 ms 110936 KB Output is correct
27 Correct 746 ms 117172 KB Output is correct
28 Correct 741 ms 116340 KB Output is correct
29 Correct 738 ms 110524 KB Output is correct
30 Correct 509 ms 104628 KB Output is correct
31 Correct 484 ms 105044 KB Output is correct
32 Correct 545 ms 103992 KB Output is correct
33 Correct 510 ms 105156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 48340 KB Output is correct
2 Correct 23 ms 48184 KB Output is correct
3 Correct 22 ms 48212 KB Output is correct
4 Correct 39 ms 48320 KB Output is correct
5 Correct 57 ms 48332 KB Output is correct
6 Correct 24 ms 48292 KB Output is correct
7 Correct 24 ms 48340 KB Output is correct
8 Correct 30 ms 48340 KB Output is correct
9 Correct 79 ms 50960 KB Output is correct
10 Correct 127 ms 94812 KB Output is correct
11 Correct 32 ms 48212 KB Output is correct
12 Correct 87 ms 48340 KB Output is correct
13 Correct 271 ms 109160 KB Output is correct
14 Correct 278 ms 109412 KB Output is correct
15 Correct 558 ms 118988 KB Output is correct
16 Correct 1037 ms 156900 KB Output is correct
17 Correct 352 ms 125884 KB Output is correct
18 Correct 283 ms 121240 KB Output is correct
19 Correct 312 ms 122224 KB Output is correct
20 Correct 299 ms 122188 KB Output is correct
21 Correct 374 ms 123836 KB Output is correct
22 Correct 213 ms 104824 KB Output is correct
23 Correct 22 ms 48212 KB Output is correct
24 Correct 21 ms 48200 KB Output is correct
25 Correct 25 ms 48376 KB Output is correct
26 Correct 25 ms 48276 KB Output is correct
27 Correct 26 ms 48320 KB Output is correct
28 Correct 26 ms 48340 KB Output is correct
29 Correct 25 ms 48340 KB Output is correct
30 Correct 25 ms 48420 KB Output is correct
31 Correct 26 ms 48324 KB Output is correct
32 Correct 26 ms 48312 KB Output is correct
33 Correct 24 ms 48344 KB Output is correct
34 Correct 23 ms 48376 KB Output is correct
35 Correct 23 ms 48320 KB Output is correct
36 Correct 24 ms 48252 KB Output is correct
37 Correct 22 ms 48220 KB Output is correct
38 Correct 23 ms 48300 KB Output is correct
39 Correct 26 ms 48400 KB Output is correct
40 Correct 25 ms 48340 KB Output is correct
41 Correct 25 ms 48212 KB Output is correct
42 Correct 25 ms 48340 KB Output is correct
43 Correct 25 ms 48288 KB Output is correct
44 Correct 25 ms 48340 KB Output is correct
45 Correct 24 ms 48212 KB Output is correct
46 Correct 23 ms 48256 KB Output is correct
47 Correct 25 ms 48340 KB Output is correct
48 Correct 24 ms 48376 KB Output is correct
49 Correct 25 ms 48304 KB Output is correct
50 Correct 25 ms 48268 KB Output is correct
51 Correct 26 ms 48356 KB Output is correct
52 Correct 28 ms 48340 KB Output is correct
53 Correct 30 ms 48360 KB Output is correct
54 Correct 26 ms 48368 KB Output is correct
55 Correct 25 ms 48276 KB Output is correct
56 Correct 27 ms 48340 KB Output is correct
57 Correct 26 ms 48404 KB Output is correct
58 Correct 27 ms 48340 KB Output is correct
59 Correct 25 ms 48304 KB Output is correct
60 Correct 79 ms 51020 KB Output is correct
61 Correct 129 ms 94788 KB Output is correct
62 Correct 107 ms 50944 KB Output is correct
63 Correct 104 ms 51000 KB Output is correct
64 Correct 92 ms 51176 KB Output is correct
65 Correct 64 ms 50516 KB Output is correct
66 Correct 51 ms 49156 KB Output is correct
67 Correct 150 ms 85452 KB Output is correct
68 Correct 147 ms 85504 KB Output is correct
69 Correct 133 ms 90048 KB Output is correct
70 Correct 135 ms 90012 KB Output is correct
71 Correct 144 ms 85624 KB Output is correct
72 Correct 144 ms 85720 KB Output is correct
73 Correct 135 ms 86704 KB Output is correct
74 Correct 132 ms 86760 KB Output is correct
75 Correct 50 ms 51276 KB Output is correct
76 Correct 153 ms 85440 KB Output is correct
77 Correct 23 ms 48216 KB Output is correct
78 Correct 22 ms 48180 KB Output is correct
79 Correct 24 ms 48260 KB Output is correct
80 Correct 25 ms 48224 KB Output is correct
81 Correct 33 ms 48212 KB Output is correct
82 Correct 25 ms 48244 KB Output is correct
83 Correct 25 ms 48376 KB Output is correct
84 Correct 23 ms 48244 KB Output is correct
85 Correct 26 ms 48176 KB Output is correct
86 Correct 23 ms 48212 KB Output is correct
87 Correct 25 ms 48212 KB Output is correct
88 Correct 27 ms 48340 KB Output is correct
89 Correct 72 ms 48332 KB Output is correct
90 Correct 102 ms 48340 KB Output is correct
91 Correct 84 ms 48380 KB Output is correct
92 Correct 280 ms 89196 KB Output is correct
93 Correct 813 ms 112640 KB Output is correct
94 Correct 1445 ms 144244 KB Output is correct
95 Correct 400 ms 93756 KB Output is correct
96 Correct 371 ms 93780 KB Output is correct
97 Correct 398 ms 94044 KB Output is correct
98 Correct 767 ms 110572 KB Output is correct
99 Correct 564 ms 110272 KB Output is correct
100 Correct 618 ms 110776 KB Output is correct
101 Correct 639 ms 111084 KB Output is correct
102 Correct 614 ms 110936 KB Output is correct
103 Correct 746 ms 117172 KB Output is correct
104 Correct 741 ms 116340 KB Output is correct
105 Correct 738 ms 110524 KB Output is correct
106 Correct 509 ms 104628 KB Output is correct
107 Correct 484 ms 105044 KB Output is correct
108 Correct 545 ms 103992 KB Output is correct
109 Correct 510 ms 105156 KB Output is correct
110 Correct 98 ms 48460 KB Output is correct
111 Correct 62 ms 48344 KB Output is correct
112 Correct 694 ms 121444 KB Output is correct
113 Correct 354 ms 100044 KB Output is correct
114 Correct 534 ms 110108 KB Output is correct
115 Correct 141 ms 86368 KB Output is correct
116 Correct 431 ms 96864 KB Output is correct
117 Correct 2253 ms 164936 KB Output is correct
118 Correct 200 ms 85640 KB Output is correct
119 Correct 194 ms 85748 KB Output is correct
120 Correct 47 ms 52688 KB Output is correct
121 Correct 609 ms 102008 KB Output is correct
122 Correct 574 ms 102072 KB Output is correct
123 Correct 450 ms 103520 KB Output is correct
124 Correct 435 ms 102528 KB Output is correct
125 Correct 482 ms 105188 KB Output is correct
126 Correct 1459 ms 156296 KB Output is correct
127 Correct 734 ms 128676 KB Output is correct
128 Correct 485 ms 130916 KB Output is correct
129 Correct 471 ms 129032 KB Output is correct
130 Correct 464 ms 130048 KB Output is correct