Submission #828880

# Submission time Handle Problem Language Result Execution time Memory
828880 2023-08-17T18:21:51 Z QwertyPi From Hacks to Snitches (BOI21_watchmen) C++14
50 / 100
6000 ms 200352 KB
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")

using namespace std;

const int MAXN = 2.5e5 + 11;
const int MAXV = 2750 + 11;
const int MAXC = 1500 + 11;
const int MAXA = 2e6 + 11;
int cyc[MAXN], ci[MAXN], cl[MAXN], vi[MAXN];
vector<int> G[MAXN], H[MAXN];
int dp[MAXN], dp2[MAXV][MAXC];
bool vis[MAXN], vis2[MAXV][MAXC];
vector<pair<int, int>> ch[MAXA];
vector<int> cycles[MAXV];

struct edge{
	int u, v;
};

bool in_cycle(int v){
	return cyc[v] != 0;
}

int cycle_nxt(int v){
	assert(cyc[v] != 0);
	return cycles[cyc[v]][(ci[v] + 1) % cl[v]];
}

int cycle_prv(int v){
	assert(cyc[v] != 0);
	return cycles[cyc[v]][(ci[v] + cl[v] - 1) % cl[v]];
}

int32_t main(){
	cin.tie(0); cout.tie(0)->sync_with_stdio(false);
	int n, m; cin >> n >> m;
	vector<edge> E;
	for(int i = 0; i < m; i++){
		int u, v; cin >> u >> v;
		E.push_back({u, v});
	}
	int s_cyc = 0;
	int k; cin >> k;
	for(int i = 0; i < k; i++){
		vector<int> v;
		int l; cin >> l;
		for(int j = 0; j < l; j++){
			int u; cin >> u; v.push_back(u);
		}
		cycles[i + 1] = v;
		for(int j = 0; j < l; j++) cyc[v[j]] = i + 1, ci[v[j]] = j, cl[v[j]] = v.size(), vi[v[j]] = 1 + s_cyc + j; s_cyc += l;
	}

	for(int i = 0; i < m; i++){
		edge e = E[i];
		if(!in_cycle(e.u)) swap(e.u, e.v);
		if(in_cycle(e.u) && in_cycle(e.v)){
			if(e.u == cycle_nxt(e.v) || e.u == cycle_prv(e.v))
				continue;
			H[e.u].push_back(e.v);
			H[e.v].push_back(e.u);
		}else{
			G[e.u].push_back(e.v);
			G[e.v].push_back(e.u);
		}
	}
	// for(int i = 1; i <= n; i++) cout << cyc[i] << ' '; cout << endl;
	// for(int i = 1; i <= n; i++) cout << ci[i] << ' '; cout << endl;
	// for(int i = 1; i <= n; i++) cout << vi[i] << ' '; cout << endl;

	memset(dp, 0x3f, sizeof(dp));
	memset(dp2, 0x3f, sizeof(dp2));

	dp[1] = 0; ch[0].push_back({1, 0});
	for(int d = 0; d < MAXA; d++){
		for(auto [v, i] : ch[d]){
			// printf("dist[(%d %d)] = %d\n", v, i, d);
			if(!in_cycle(v)){
				assert(i == 0);
				if(vis[v]) continue; vis[v] = true;
				for(auto u : G[v]){
					if(!in_cycle(u)){
						if(dp[v] + 1 < dp[u]){
							dp[u] = dp[v] + 1;
							ch[d + 1].push_back({u, 0});
						}
					}else{
						vector<int> J;
						J.push_back(0); J.push_back(1);
						J.push_back((((ci[u] - dp[v]) % cl[u]) + cl[u]) % cl[u]);
						for(int j : J){
							int dst = dp[v] + 1 + j;
							if(dst % cl[u] == ci[u]) continue;
							if(dst < dp2[vi[u]][dst % cl[u]]){
								dp2[vi[u]][dst % cl[u]] = dst;
								ch[dst].push_back({u, dst % cl[u]});
							}
						}
					}
				}
			}else{
				if(!vis[v]){
					for(int i = 0; i < cl[v]; i++){
						dp[v] = min(dp[v], dp2[vi[v]][i]);
					}
					// printf("dp[%d] = %d\n", v, dp[v]);
					vis[v] = true;
					for(auto u : G[v]){
						assert(!in_cycle(u));
						if(dp[v] + 1 < dp[u]){
							dp[u] = dp[v] + 1;
							ch[d + 1].push_back({u, 0});
						}
					}
				}

				assert(d % cl[v] != ci[v]);

				if(vis2[vi[v]][d % cl[v]]) continue; vis2[vi[v]][d % cl[v]] = true;
				// stationery
				if((d + 1) % cl[v] != ci[v] && d + 1 < dp2[vi[v]][(d + 1) % cl[v]]){
					dp2[vi[v]][(d + 1) % cl[v]] = d + 1;
					ch[d + 1].push_back({v, (d + 1) % cl[v]});
				}

				for(auto u : H[v]){
					for(int j = 0; j < cl[u] / __gcd(cl[u], cl[v]); j++){
						int dst = d + 1 + j * cl[v];
						if(dst % cl[u] != ci[u] && dst < dp2[vi[u]][dst % cl[u]]){
							dp2[vi[u]][dst % cl[u]] = dst;
							ch[dst].push_back({u, dst % cl[u]});
						}
					}
				}

				// forward
				int u = cycle_nxt(v);
				if(d + 1 < dp2[vi[u]][(d + 1) % cl[u]]){
					dp2[vi[u]][(d + 1) % cl[u]] = d + 1;
					ch[d + 1].push_back({u, (d + 1) % cl[u]});
				}
				
				// backward
				u = cycle_prv(v);
				if((d + 1) % cl[v] != ci[v] && (d + 2) % cl[v] != ci[v] && d + 1 < dp2[vi[u]][(d + 1) % cl[u]]){
					dp2[vi[u]][(d + 1) % cl[u]] = d + 1;
					ch[d + 1].push_back({u, (d + 1) % cl[u]});
				}
			}
		}
		ch[d].clear();
	}
	if(dp[n] == 0x3f3f3f3f){
		cout << "impossible" << endl;
	}else{
		cout << dp[n] << endl;
	}
}

Compilation message

watchmen.cpp: In function 'int32_t main()':
watchmen.cpp:53:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   53 |   for(int j = 0; j < l; j++) cyc[v[j]] = i + 1, ci[v[j]] = j, cl[v[j]] = v.size(), vi[v[j]] = 1 + s_cyc + j; s_cyc += l;
      |   ^~~
watchmen.cpp:53:110: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   53 |   for(int j = 0; j < l; j++) cyc[v[j]] = i + 1, ci[v[j]] = j, cl[v[j]] = v.size(), vi[v[j]] = 1 + s_cyc + j; s_cyc += l;
      |                                                                                                              ^~~~~
watchmen.cpp:78:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   78 |   for(auto [v, i] : ch[d]){
      |            ^
watchmen.cpp:82:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   82 |     if(vis[v]) continue; vis[v] = true;
      |     ^~
watchmen.cpp:82:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   82 |     if(vis[v]) continue; vis[v] = true;
      |                          ^~~
watchmen.cpp:121:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  121 |     if(vis2[vi[v]][d % cl[v]]) continue; vis2[vi[v]][d % cl[v]] = true;
      |     ^~
watchmen.cpp:121:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  121 |     if(vis2[vi[v]][d % cl[v]]) continue; vis2[vi[v]][d % cl[v]] = true;
      |                                          ^~~~
# Verdict Execution time Memory Grader output
1 Correct 92 ms 78332 KB Output is correct
2 Correct 76 ms 85000 KB Output is correct
3 Correct 75 ms 83764 KB Output is correct
4 Correct 116 ms 83428 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 71 ms 83528 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 90 ms 78336 KB Output is correct
2 Correct 83 ms 85064 KB Output is correct
3 Correct 72 ms 83784 KB Output is correct
4 Correct 114 ms 83388 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 77 ms 83588 KB Output is correct
7 Correct 72 ms 83916 KB Output is correct
8 Correct 86 ms 83888 KB Output is correct
9 Correct 74 ms 84164 KB Output is correct
10 Correct 80 ms 82976 KB Output is correct
11 Correct 74 ms 82336 KB Output is correct
12 Correct 70 ms 83524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 90 ms 78336 KB Output is correct
2 Correct 83 ms 85064 KB Output is correct
3 Correct 72 ms 83784 KB Output is correct
4 Correct 114 ms 83388 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 77 ms 83588 KB Output is correct
7 Correct 72 ms 83916 KB Output is correct
8 Correct 86 ms 83888 KB Output is correct
9 Correct 74 ms 84164 KB Output is correct
10 Correct 80 ms 82976 KB Output is correct
11 Correct 74 ms 82336 KB Output is correct
12 Correct 70 ms 83524 KB Output is correct
13 Correct 90 ms 78280 KB Output is correct
14 Correct 74 ms 84924 KB Output is correct
15 Correct 71 ms 83828 KB Output is correct
16 Correct 131 ms 83408 KB Output is correct
17 Correct 44 ms 76640 KB Output is correct
18 Correct 83 ms 83528 KB Output is correct
19 Correct 68 ms 83856 KB Output is correct
20 Correct 67 ms 84008 KB Output is correct
21 Correct 68 ms 84152 KB Output is correct
22 Correct 91 ms 82940 KB Output is correct
23 Correct 72 ms 82340 KB Output is correct
24 Correct 79 ms 83472 KB Output is correct
25 Correct 827 ms 148320 KB Output is correct
26 Correct 800 ms 154276 KB Output is correct
27 Correct 700 ms 150500 KB Output is correct
28 Correct 659 ms 154812 KB Output is correct
29 Correct 1044 ms 141688 KB Output is correct
30 Correct 1151 ms 144480 KB Output is correct
31 Correct 778 ms 154252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 90 ms 78336 KB Output is correct
2 Correct 83 ms 85064 KB Output is correct
3 Correct 72 ms 83784 KB Output is correct
4 Correct 114 ms 83388 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 77 ms 83588 KB Output is correct
7 Correct 72 ms 83916 KB Output is correct
8 Correct 86 ms 83888 KB Output is correct
9 Correct 74 ms 84164 KB Output is correct
10 Correct 80 ms 82976 KB Output is correct
11 Correct 74 ms 82336 KB Output is correct
12 Correct 70 ms 83524 KB Output is correct
13 Correct 90 ms 78280 KB Output is correct
14 Correct 74 ms 84924 KB Output is correct
15 Correct 71 ms 83828 KB Output is correct
16 Correct 131 ms 83408 KB Output is correct
17 Correct 44 ms 76640 KB Output is correct
18 Correct 83 ms 83528 KB Output is correct
19 Correct 68 ms 83856 KB Output is correct
20 Correct 67 ms 84008 KB Output is correct
21 Correct 68 ms 84152 KB Output is correct
22 Correct 91 ms 82940 KB Output is correct
23 Correct 72 ms 82340 KB Output is correct
24 Correct 79 ms 83472 KB Output is correct
25 Correct 827 ms 148320 KB Output is correct
26 Correct 800 ms 154276 KB Output is correct
27 Correct 700 ms 150500 KB Output is correct
28 Correct 659 ms 154812 KB Output is correct
29 Correct 1044 ms 141688 KB Output is correct
30 Correct 1151 ms 144480 KB Output is correct
31 Correct 778 ms 154252 KB Output is correct
32 Correct 100 ms 78304 KB Output is correct
33 Correct 92 ms 85032 KB Output is correct
34 Correct 76 ms 83872 KB Output is correct
35 Correct 114 ms 83524 KB Output is correct
36 Correct 40 ms 76748 KB Output is correct
37 Correct 77 ms 83656 KB Output is correct
38 Correct 79 ms 84060 KB Output is correct
39 Correct 75 ms 84040 KB Output is correct
40 Correct 77 ms 84264 KB Output is correct
41 Correct 98 ms 83044 KB Output is correct
42 Correct 73 ms 82528 KB Output is correct
43 Correct 74 ms 83632 KB Output is correct
44 Correct 743 ms 148352 KB Output is correct
45 Correct 748 ms 154464 KB Output is correct
46 Correct 700 ms 150524 KB Output is correct
47 Correct 661 ms 154904 KB Output is correct
48 Correct 1056 ms 141668 KB Output is correct
49 Correct 1215 ms 144652 KB Output is correct
50 Correct 897 ms 154220 KB Output is correct
51 Correct 932 ms 175812 KB Output is correct
52 Correct 993 ms 200352 KB Output is correct
53 Correct 896 ms 178724 KB Output is correct
54 Correct 666 ms 152844 KB Output is correct
55 Execution timed out 6038 ms 152560 KB Time limit exceeded
56 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 92 ms 78332 KB Output is correct
2 Correct 76 ms 85000 KB Output is correct
3 Correct 75 ms 83764 KB Output is correct
4 Correct 116 ms 83428 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 71 ms 83528 KB Output is correct
7 Correct 90 ms 78336 KB Output is correct
8 Correct 83 ms 85064 KB Output is correct
9 Correct 72 ms 83784 KB Output is correct
10 Correct 114 ms 83388 KB Output is correct
11 Correct 38 ms 76748 KB Output is correct
12 Correct 77 ms 83588 KB Output is correct
13 Correct 72 ms 83916 KB Output is correct
14 Correct 86 ms 83888 KB Output is correct
15 Correct 74 ms 84164 KB Output is correct
16 Correct 80 ms 82976 KB Output is correct
17 Correct 74 ms 82336 KB Output is correct
18 Correct 70 ms 83524 KB Output is correct
19 Correct 41 ms 76372 KB Output is correct
20 Correct 39 ms 76380 KB Output is correct
21 Correct 41 ms 76372 KB Output is correct
22 Correct 93 ms 78180 KB Output is correct
23 Correct 79 ms 84980 KB Output is correct
24 Correct 80 ms 83840 KB Output is correct
25 Correct 126 ms 83400 KB Output is correct
26 Correct 47 ms 76752 KB Output is correct
27 Correct 73 ms 83532 KB Output is correct
28 Correct 73 ms 83884 KB Output is correct
29 Correct 72 ms 83972 KB Output is correct
30 Correct 71 ms 84192 KB Output is correct
31 Correct 107 ms 82888 KB Output is correct
32 Correct 67 ms 82384 KB Output is correct
33 Correct 94 ms 83528 KB Output is correct
34 Correct 819 ms 147420 KB Output is correct
35 Correct 798 ms 143412 KB Output is correct
36 Correct 1016 ms 143340 KB Output is correct
37 Correct 936 ms 150124 KB Output is correct
38 Correct 886 ms 147284 KB Output is correct
39 Correct 1091 ms 141140 KB Output is correct
40 Correct 1615 ms 142388 KB Output is correct
41 Correct 1291 ms 141536 KB Output is correct
42 Correct 769 ms 147324 KB Output is correct
43 Correct 908 ms 151964 KB Output is correct
44 Correct 953 ms 152016 KB Output is correct
45 Correct 1006 ms 145224 KB Output is correct
46 Correct 868 ms 147284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 92 ms 78332 KB Output is correct
2 Correct 76 ms 85000 KB Output is correct
3 Correct 75 ms 83764 KB Output is correct
4 Correct 116 ms 83428 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 71 ms 83528 KB Output is correct
7 Correct 90 ms 78336 KB Output is correct
8 Correct 83 ms 85064 KB Output is correct
9 Correct 72 ms 83784 KB Output is correct
10 Correct 114 ms 83388 KB Output is correct
11 Correct 38 ms 76748 KB Output is correct
12 Correct 77 ms 83588 KB Output is correct
13 Correct 72 ms 83916 KB Output is correct
14 Correct 86 ms 83888 KB Output is correct
15 Correct 74 ms 84164 KB Output is correct
16 Correct 80 ms 82976 KB Output is correct
17 Correct 74 ms 82336 KB Output is correct
18 Correct 70 ms 83524 KB Output is correct
19 Correct 90 ms 78280 KB Output is correct
20 Correct 74 ms 84924 KB Output is correct
21 Correct 71 ms 83828 KB Output is correct
22 Correct 131 ms 83408 KB Output is correct
23 Correct 44 ms 76640 KB Output is correct
24 Correct 83 ms 83528 KB Output is correct
25 Correct 68 ms 83856 KB Output is correct
26 Correct 67 ms 84008 KB Output is correct
27 Correct 68 ms 84152 KB Output is correct
28 Correct 91 ms 82940 KB Output is correct
29 Correct 72 ms 82340 KB Output is correct
30 Correct 79 ms 83472 KB Output is correct
31 Correct 827 ms 148320 KB Output is correct
32 Correct 800 ms 154276 KB Output is correct
33 Correct 700 ms 150500 KB Output is correct
34 Correct 659 ms 154812 KB Output is correct
35 Correct 1044 ms 141688 KB Output is correct
36 Correct 1151 ms 144480 KB Output is correct
37 Correct 778 ms 154252 KB Output is correct
38 Correct 41 ms 76372 KB Output is correct
39 Correct 39 ms 76380 KB Output is correct
40 Correct 41 ms 76372 KB Output is correct
41 Correct 93 ms 78180 KB Output is correct
42 Correct 79 ms 84980 KB Output is correct
43 Correct 80 ms 83840 KB Output is correct
44 Correct 126 ms 83400 KB Output is correct
45 Correct 47 ms 76752 KB Output is correct
46 Correct 73 ms 83532 KB Output is correct
47 Correct 73 ms 83884 KB Output is correct
48 Correct 72 ms 83972 KB Output is correct
49 Correct 71 ms 84192 KB Output is correct
50 Correct 107 ms 82888 KB Output is correct
51 Correct 67 ms 82384 KB Output is correct
52 Correct 94 ms 83528 KB Output is correct
53 Correct 819 ms 147420 KB Output is correct
54 Correct 798 ms 143412 KB Output is correct
55 Correct 1016 ms 143340 KB Output is correct
56 Correct 936 ms 150124 KB Output is correct
57 Correct 886 ms 147284 KB Output is correct
58 Correct 1091 ms 141140 KB Output is correct
59 Correct 1615 ms 142388 KB Output is correct
60 Correct 1291 ms 141536 KB Output is correct
61 Correct 769 ms 147324 KB Output is correct
62 Correct 908 ms 151964 KB Output is correct
63 Correct 953 ms 152016 KB Output is correct
64 Correct 1006 ms 145224 KB Output is correct
65 Correct 868 ms 147284 KB Output is correct
66 Correct 52 ms 76364 KB Output is correct
67 Correct 45 ms 76344 KB Output is correct
68 Correct 44 ms 76420 KB Output is correct
69 Correct 102 ms 78776 KB Output is correct
70 Correct 90 ms 86124 KB Output is correct
71 Correct 86 ms 84920 KB Output is correct
72 Correct 128 ms 84480 KB Output is correct
73 Correct 48 ms 76696 KB Output is correct
74 Correct 85 ms 84672 KB Output is correct
75 Correct 85 ms 85084 KB Output is correct
76 Correct 91 ms 85076 KB Output is correct
77 Correct 92 ms 85328 KB Output is correct
78 Correct 90 ms 84072 KB Output is correct
79 Correct 84 ms 83504 KB Output is correct
80 Correct 87 ms 84692 KB Output is correct
81 Correct 769 ms 169588 KB Output is correct
82 Correct 868 ms 175588 KB Output is correct
83 Correct 715 ms 171696 KB Output is correct
84 Correct 740 ms 176100 KB Output is correct
85 Correct 1292 ms 163032 KB Output is correct
86 Correct 1297 ms 165748 KB Output is correct
87 Correct 874 ms 175484 KB Output is correct
88 Correct 939 ms 168688 KB Output is correct
89 Correct 883 ms 164644 KB Output is correct
90 Correct 935 ms 164624 KB Output is correct
91 Correct 877 ms 171424 KB Output is correct
92 Correct 887 ms 168608 KB Output is correct
93 Correct 1150 ms 162464 KB Output is correct
94 Correct 1713 ms 163432 KB Output is correct
95 Correct 1189 ms 162748 KB Output is correct
96 Correct 863 ms 168528 KB Output is correct
97 Correct 879 ms 173192 KB Output is correct
98 Correct 872 ms 173256 KB Output is correct
99 Correct 876 ms 166448 KB Output is correct
100 Correct 796 ms 168556 KB Output is correct
101 Correct 864 ms 170640 KB Output is correct
102 Correct 754 ms 173412 KB Output is correct
103 Correct 884 ms 170804 KB Output is correct
104 Execution timed out 6021 ms 170492 KB Time limit exceeded
105 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 92 ms 78332 KB Output is correct
2 Correct 76 ms 85000 KB Output is correct
3 Correct 75 ms 83764 KB Output is correct
4 Correct 116 ms 83428 KB Output is correct
5 Correct 38 ms 76748 KB Output is correct
6 Correct 71 ms 83528 KB Output is correct
7 Correct 90 ms 78336 KB Output is correct
8 Correct 83 ms 85064 KB Output is correct
9 Correct 72 ms 83784 KB Output is correct
10 Correct 114 ms 83388 KB Output is correct
11 Correct 38 ms 76748 KB Output is correct
12 Correct 77 ms 83588 KB Output is correct
13 Correct 72 ms 83916 KB Output is correct
14 Correct 86 ms 83888 KB Output is correct
15 Correct 74 ms 84164 KB Output is correct
16 Correct 80 ms 82976 KB Output is correct
17 Correct 74 ms 82336 KB Output is correct
18 Correct 70 ms 83524 KB Output is correct
19 Correct 90 ms 78280 KB Output is correct
20 Correct 74 ms 84924 KB Output is correct
21 Correct 71 ms 83828 KB Output is correct
22 Correct 131 ms 83408 KB Output is correct
23 Correct 44 ms 76640 KB Output is correct
24 Correct 83 ms 83528 KB Output is correct
25 Correct 68 ms 83856 KB Output is correct
26 Correct 67 ms 84008 KB Output is correct
27 Correct 68 ms 84152 KB Output is correct
28 Correct 91 ms 82940 KB Output is correct
29 Correct 72 ms 82340 KB Output is correct
30 Correct 79 ms 83472 KB Output is correct
31 Correct 827 ms 148320 KB Output is correct
32 Correct 800 ms 154276 KB Output is correct
33 Correct 700 ms 150500 KB Output is correct
34 Correct 659 ms 154812 KB Output is correct
35 Correct 1044 ms 141688 KB Output is correct
36 Correct 1151 ms 144480 KB Output is correct
37 Correct 778 ms 154252 KB Output is correct
38 Correct 100 ms 78304 KB Output is correct
39 Correct 92 ms 85032 KB Output is correct
40 Correct 76 ms 83872 KB Output is correct
41 Correct 114 ms 83524 KB Output is correct
42 Correct 40 ms 76748 KB Output is correct
43 Correct 77 ms 83656 KB Output is correct
44 Correct 79 ms 84060 KB Output is correct
45 Correct 75 ms 84040 KB Output is correct
46 Correct 77 ms 84264 KB Output is correct
47 Correct 98 ms 83044 KB Output is correct
48 Correct 73 ms 82528 KB Output is correct
49 Correct 74 ms 83632 KB Output is correct
50 Correct 743 ms 148352 KB Output is correct
51 Correct 748 ms 154464 KB Output is correct
52 Correct 700 ms 150524 KB Output is correct
53 Correct 661 ms 154904 KB Output is correct
54 Correct 1056 ms 141668 KB Output is correct
55 Correct 1215 ms 144652 KB Output is correct
56 Correct 897 ms 154220 KB Output is correct
57 Correct 932 ms 175812 KB Output is correct
58 Correct 993 ms 200352 KB Output is correct
59 Correct 896 ms 178724 KB Output is correct
60 Correct 666 ms 152844 KB Output is correct
61 Execution timed out 6038 ms 152560 KB Time limit exceeded
62 Halted 0 ms 0 KB -