Submission #827298

# Submission time Handle Problem Language Result Execution time Memory
827298 2023-08-16T10:42:20 Z esomer Radio Towers (IOI22_towers) C++17
77 / 100
1078 ms 269332 KB
#include <bits/stdc++.h>
#include "towers.h"

using namespace std;

const int B = 200;

int N, spec, first;
vector<int> H, lw;
vector<pair<int, int>> candidates;
vector<vector<pair<int, int>>> mn, mx;
vector<vector<int>> prefix;

void precalcmx(){
	mx.assign(20, vector<pair<int, int>>(N));
	for(int k = 0; k < 20; k++){
		for(int i = 0; i < N; i++){
			if(k == 0) mx[k][i] = {H[i], i};
			else{
				if(i - (1 << (k-1)) < 0) mx[k][i] = mx[k-1][i];
				else{
					mx[k][i] = max(mx[k-1][i], mx[k-1][i - (1 << (k-1))]);
				}
			}
		}
	}
}

void precalcmn(){
	mn.assign(20, vector<pair<int, int>>(N));
	for(int k = 0; k < 20; k++){
		for(int i = 0; i < N; i++){
			if(k == 0) mn[k][i] = {H[i], i};
			else{
				if(i - (1 << (k-1)) < 0) mn[k][i] = mn[k-1][i];
				else{
					mn[k][i] = min(mn[k-1][i], mn[k-1][i - (1 << (k-1))]);
				}
			}
		}
	}
}

void precalclw(){
	lw.resize(N+1);
	int pw = 0;
	int curr = 2;
	for(int i = 1; i <= N; i++){
		if(i == curr){
			pw++; curr *= 2;
		}
		lw[i] = pw;
	}
}

pair<int, int> get_mx(int l, int r){
	if(r < l) return {-2e9, 0};
	int k = lw[r - l + 1];
	return max(mx[k][r], mx[k][l + (1 << k) - 1]);
}

pair<int, int> get_mn(int l, int r){
	if(r < l) return {2e9, 0};
	int k = lw[r - l + 1];
	return min(mn[k][r], mn[k][l + (1 << k) - 1]);
}

int get_first(int L, vector<int>& pre){
	int lo = L;
	int hi = N - 1;
	int bst = -1;
	int beat = 0;
	if(L > 0) beat = pre[L-1];
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if(pre[mid] > beat){
			bst = mid;
			hi = mid - 1;
		}else lo = mid + 1;
	}
	assert(bst != -1);
	return bst;
}

int get_last(int R, vector<int>& pre){
	int lo = 0;
	int hi = R;
	int bst = -1;
	while(lo <= hi){
		int mid = (lo + hi) / 2;
		if(pre[mid] <= pre[R] - 1){
			bst = mid;
			lo = mid + 1;
		}else hi = mid - 1;
	}
	return bst + 1;
}

void init(int n, vector<int> H1) {
	N = n;
	H = H1;
	first = 1;
	precalcmx();
	precalcmn();
	precalclw();
}

int dnc(int L, int R, int D) {
	if(L == R) {
		return H[L];
	}else if(L > R){
		return 2e9;
	}
	pair<int, int> pr = get_mx(L, R);
	int mx = pr.first;
	int ind = pr.second;
	int mn1 = dnc(ind + 1, R, D);
	int mn2 = dnc(L, ind - 1, D);
	candidates.push_back({min(mx - mn1, mx - mn2), ind});
	return min(mn1, mn2);
}

int max_towers(int L, int R, int D) {
	if(first == 1){
		dnc(0, N-1, D);
		sort(candidates.begin(), candidates.end());
		reverse(candidates.begin(), candidates.end());
		vector<int> good(N, 0);
		for(int l = 0; l < (int)candidates.size(); l += B){
			for(int i = l; i < min(l + B, (int)candidates.size()); i++){
				good[candidates[i].second] = 1;
			}
			vector<int> pre(N);
			for(int i = 0; i < N; i++){
				if(i == 0) pre[i] = good[i];
				else pre[i] = pre[i-1] + good[i];
			}
			prefix.push_back(pre);
		}
		first = 0;
	}
	for(int l = 0; l < (int)candidates.size(); l += B){
		int indmx = l + B - 1;
		if(indmx >= (int)candidates.size()) indmx = (int)candidates.size() - 1;
		if(candidates[indmx].first >= D && l < (int)candidates.size() - 1) continue;
		int total = 0;
		int ind1 = N;
		int ind2 = -1;
		if(l != 0){
			int i = l / B - 1;
			total = prefix[i][R];
			if(L > 0) total -= prefix[i][L-1];
			ind1 = get_first(L, prefix[i]);
			ind2 = get_last(R, prefix[i]);
		}
		for(int i = l; candidates[i].first >= D; i++){
			int ind = candidates[i].second;
			if(ind >= L && ind <= R){
				total++;
				ind1 = min(ind1, ind);
				ind2 = max(ind2, ind);
			}
		}
		if(total == 0) return 1;
		else if(total == 1){
			int ind = ind1;
			int mn1 = get_mn(L, ind - 1).first;
			int mn2 = get_mn(ind + 1, R).first;
			if(mn1 <= H[ind] - D && mn2 <= H[ind] - D) return 2;
			else return 1;
		}else{
			int ans = total + 1;
			int ind = ind1;
			int mn = get_mn(L, ind - 1).first;
			if(mn > H[ind]  - D) ans--;
			ind = ind2;
			mn = get_mn(ind + 1, R).first;
			if(mn > H[ind] - D) ans--;
			return ans;	
		}
	}
}

// int main() {
//   int N, Q;
//   assert(2 == scanf("%d %d", &N, &Q));
//   std::vector<int> H(N);
//   for (int i = 0; i < N; ++i) {
//     assert(1 == scanf("%d", &H[i]));
//   }
//   init(N, H);
//   for (int i = 0; i < Q; ++i) {
//     int L, R, D;
//     assert(3 == scanf("%d %d %d", &L, &R, &D));
//     printf("%d\n", max_towers(L, R, D));
//   }
//   return 0;
// }

Compilation message

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:182:1: warning: control reaches end of non-void function [-Wreturn-type]
  182 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 368 ms 94412 KB Output is correct
2 Correct 765 ms 237956 KB Output is correct
3 Correct 833 ms 237904 KB Output is correct
4 Correct 761 ms 238268 KB Output is correct
5 Correct 921 ms 238344 KB Output is correct
6 Correct 808 ms 238300 KB Output is correct
7 Correct 795 ms 238256 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 1 ms 1104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 1 ms 976 KB Output is correct
3 Correct 1 ms 976 KB Output is correct
4 Correct 1 ms 976 KB Output is correct
5 Correct 1 ms 976 KB Output is correct
6 Correct 1 ms 976 KB Output is correct
7 Correct 1 ms 976 KB Output is correct
8 Correct 1 ms 1172 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 2 ms 1104 KB Output is correct
11 Correct 1 ms 1104 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 1104 KB Output is correct
14 Correct 1 ms 1104 KB Output is correct
15 Correct 1 ms 976 KB Output is correct
16 Correct 1 ms 976 KB Output is correct
17 Correct 1 ms 976 KB Output is correct
18 Correct 1 ms 1104 KB Output is correct
19 Correct 1 ms 1104 KB Output is correct
20 Correct 1 ms 976 KB Output is correct
21 Correct 1 ms 976 KB Output is correct
22 Correct 1 ms 976 KB Output is correct
23 Correct 1 ms 1216 KB Output is correct
24 Correct 1 ms 1104 KB Output is correct
25 Correct 1 ms 592 KB Output is correct
26 Correct 1 ms 976 KB Output is correct
27 Correct 1 ms 976 KB Output is correct
28 Correct 1 ms 976 KB Output is correct
29 Correct 1 ms 976 KB Output is correct
30 Correct 1 ms 976 KB Output is correct
31 Correct 1 ms 976 KB Output is correct
32 Correct 1 ms 1216 KB Output is correct
33 Correct 1 ms 1104 KB Output is correct
34 Correct 1 ms 1104 KB Output is correct
35 Correct 1 ms 1104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 1 ms 976 KB Output is correct
3 Correct 1 ms 976 KB Output is correct
4 Correct 1 ms 976 KB Output is correct
5 Correct 1 ms 976 KB Output is correct
6 Correct 1 ms 976 KB Output is correct
7 Correct 1 ms 976 KB Output is correct
8 Correct 1 ms 1172 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 2 ms 1104 KB Output is correct
11 Correct 1 ms 1104 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 1104 KB Output is correct
14 Correct 1 ms 1104 KB Output is correct
15 Correct 1 ms 976 KB Output is correct
16 Correct 1 ms 976 KB Output is correct
17 Correct 1 ms 976 KB Output is correct
18 Correct 1 ms 1104 KB Output is correct
19 Correct 1 ms 1104 KB Output is correct
20 Correct 1 ms 976 KB Output is correct
21 Correct 1 ms 976 KB Output is correct
22 Correct 1 ms 976 KB Output is correct
23 Correct 1 ms 1216 KB Output is correct
24 Correct 1 ms 1104 KB Output is correct
25 Correct 1 ms 592 KB Output is correct
26 Correct 1 ms 976 KB Output is correct
27 Correct 1 ms 976 KB Output is correct
28 Correct 1 ms 976 KB Output is correct
29 Correct 1 ms 976 KB Output is correct
30 Correct 1 ms 976 KB Output is correct
31 Correct 1 ms 976 KB Output is correct
32 Correct 1 ms 1216 KB Output is correct
33 Correct 1 ms 1104 KB Output is correct
34 Correct 1 ms 1104 KB Output is correct
35 Correct 1 ms 1104 KB Output is correct
36 Correct 83 ms 78012 KB Output is correct
37 Correct 165 ms 164756 KB Output is correct
38 Correct 165 ms 165168 KB Output is correct
39 Correct 138 ms 132480 KB Output is correct
40 Correct 130 ms 132828 KB Output is correct
41 Correct 131 ms 132464 KB Output is correct
42 Correct 131 ms 132460 KB Output is correct
43 Correct 243 ms 238308 KB Output is correct
44 Correct 232 ms 238240 KB Output is correct
45 Correct 226 ms 236096 KB Output is correct
46 Correct 225 ms 235276 KB Output is correct
47 Correct 163 ms 165168 KB Output is correct
48 Correct 132 ms 132456 KB Output is correct
49 Correct 134 ms 132912 KB Output is correct
50 Correct 223 ms 238212 KB Output is correct
51 Correct 227 ms 238128 KB Output is correct
52 Correct 166 ms 165320 KB Output is correct
53 Correct 130 ms 132444 KB Output is correct
54 Correct 132 ms 132792 KB Output is correct
55 Correct 225 ms 238304 KB Output is correct
56 Correct 228 ms 237512 KB Output is correct
57 Correct 155 ms 155348 KB Output is correct
58 Correct 166 ms 165148 KB Output is correct
59 Correct 175 ms 164756 KB Output is correct
60 Correct 132 ms 132476 KB Output is correct
61 Correct 130 ms 132496 KB Output is correct
62 Correct 131 ms 132440 KB Output is correct
63 Correct 132 ms 132880 KB Output is correct
64 Correct 224 ms 238256 KB Output is correct
65 Correct 232 ms 238208 KB Output is correct
66 Correct 227 ms 235324 KB Output is correct
67 Correct 230 ms 237848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 614 ms 163232 KB Output is correct
2 Correct 898 ms 165200 KB Output is correct
3 Correct 949 ms 165204 KB Output is correct
4 Correct 930 ms 132440 KB Output is correct
5 Correct 950 ms 132400 KB Output is correct
6 Correct 877 ms 132484 KB Output is correct
7 Correct 959 ms 132888 KB Output is correct
8 Correct 797 ms 238212 KB Output is correct
9 Correct 901 ms 238224 KB Output is correct
10 Correct 878 ms 236316 KB Output is correct
11 Correct 1012 ms 236248 KB Output is correct
12 Correct 737 ms 238140 KB Output is correct
13 Correct 804 ms 238324 KB Output is correct
14 Correct 0 ms 208 KB Output is correct
15 Correct 1 ms 1104 KB Output is correct
16 Correct 1 ms 1104 KB Output is correct
17 Correct 167 ms 165256 KB Output is correct
18 Correct 134 ms 132504 KB Output is correct
19 Correct 131 ms 132872 KB Output is correct
20 Correct 224 ms 238236 KB Output is correct
21 Correct 234 ms 238060 KB Output is correct
22 Correct 165 ms 165208 KB Output is correct
23 Correct 143 ms 132456 KB Output is correct
24 Correct 131 ms 132824 KB Output is correct
25 Correct 232 ms 238360 KB Output is correct
26 Correct 228 ms 237568 KB Output is correct
27 Correct 1 ms 988 KB Output is correct
28 Correct 1 ms 976 KB Output is correct
29 Correct 1 ms 976 KB Output is correct
30 Correct 1 ms 1104 KB Output is correct
31 Correct 1 ms 1104 KB Output is correct
32 Correct 1 ms 976 KB Output is correct
33 Correct 1 ms 976 KB Output is correct
34 Correct 1 ms 976 KB Output is correct
35 Correct 1 ms 1104 KB Output is correct
36 Correct 1 ms 1104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 265 ms 15968 KB Output is correct
2 Correct 1022 ms 165268 KB Output is correct
3 Correct 924 ms 165148 KB Output is correct
4 Correct 755 ms 132400 KB Output is correct
5 Correct 813 ms 132824 KB Output is correct
6 Correct 852 ms 132400 KB Output is correct
7 Correct 880 ms 132504 KB Output is correct
8 Correct 894 ms 238212 KB Output is correct
9 Correct 783 ms 238300 KB Output is correct
10 Correct 850 ms 235360 KB Output is correct
11 Correct 870 ms 235800 KB Output is correct
12 Correct 171 ms 165288 KB Output is correct
13 Correct 131 ms 132496 KB Output is correct
14 Correct 132 ms 132876 KB Output is correct
15 Correct 226 ms 238300 KB Output is correct
16 Correct 231 ms 237604 KB Output is correct
17 Correct 156 ms 155240 KB Output is correct
18 Correct 172 ms 165168 KB Output is correct
19 Correct 172 ms 164844 KB Output is correct
20 Correct 129 ms 132440 KB Output is correct
21 Correct 131 ms 132480 KB Output is correct
22 Correct 130 ms 132448 KB Output is correct
23 Correct 132 ms 132804 KB Output is correct
24 Correct 223 ms 238264 KB Output is correct
25 Correct 224 ms 238212 KB Output is correct
26 Correct 229 ms 235172 KB Output is correct
27 Correct 228 ms 237748 KB Output is correct
28 Correct 1 ms 976 KB Output is correct
29 Correct 1 ms 976 KB Output is correct
30 Correct 1 ms 976 KB Output is correct
31 Correct 1 ms 1104 KB Output is correct
32 Correct 1 ms 1104 KB Output is correct
33 Correct 1 ms 592 KB Output is correct
34 Correct 1 ms 976 KB Output is correct
35 Correct 1 ms 976 KB Output is correct
36 Correct 1 ms 976 KB Output is correct
37 Correct 1 ms 976 KB Output is correct
38 Correct 1 ms 976 KB Output is correct
39 Correct 2 ms 1024 KB Output is correct
40 Correct 2 ms 1104 KB Output is correct
41 Correct 1 ms 1104 KB Output is correct
42 Correct 1 ms 1104 KB Output is correct
43 Correct 1 ms 1104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 1 ms 976 KB Output is correct
3 Correct 1 ms 976 KB Output is correct
4 Correct 1 ms 976 KB Output is correct
5 Correct 1 ms 976 KB Output is correct
6 Correct 1 ms 976 KB Output is correct
7 Correct 1 ms 976 KB Output is correct
8 Correct 1 ms 1172 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 2 ms 1104 KB Output is correct
11 Correct 1 ms 1104 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 1104 KB Output is correct
14 Correct 1 ms 1104 KB Output is correct
15 Correct 1 ms 976 KB Output is correct
16 Correct 1 ms 976 KB Output is correct
17 Correct 1 ms 976 KB Output is correct
18 Correct 1 ms 1104 KB Output is correct
19 Correct 1 ms 1104 KB Output is correct
20 Correct 1 ms 976 KB Output is correct
21 Correct 1 ms 976 KB Output is correct
22 Correct 1 ms 976 KB Output is correct
23 Correct 1 ms 1216 KB Output is correct
24 Correct 1 ms 1104 KB Output is correct
25 Correct 1 ms 592 KB Output is correct
26 Correct 1 ms 976 KB Output is correct
27 Correct 1 ms 976 KB Output is correct
28 Correct 1 ms 976 KB Output is correct
29 Correct 1 ms 976 KB Output is correct
30 Correct 1 ms 976 KB Output is correct
31 Correct 1 ms 976 KB Output is correct
32 Correct 1 ms 1216 KB Output is correct
33 Correct 1 ms 1104 KB Output is correct
34 Correct 1 ms 1104 KB Output is correct
35 Correct 1 ms 1104 KB Output is correct
36 Correct 83 ms 78012 KB Output is correct
37 Correct 165 ms 164756 KB Output is correct
38 Correct 165 ms 165168 KB Output is correct
39 Correct 138 ms 132480 KB Output is correct
40 Correct 130 ms 132828 KB Output is correct
41 Correct 131 ms 132464 KB Output is correct
42 Correct 131 ms 132460 KB Output is correct
43 Correct 243 ms 238308 KB Output is correct
44 Correct 232 ms 238240 KB Output is correct
45 Correct 226 ms 236096 KB Output is correct
46 Correct 225 ms 235276 KB Output is correct
47 Correct 163 ms 165168 KB Output is correct
48 Correct 132 ms 132456 KB Output is correct
49 Correct 134 ms 132912 KB Output is correct
50 Correct 223 ms 238212 KB Output is correct
51 Correct 227 ms 238128 KB Output is correct
52 Correct 166 ms 165320 KB Output is correct
53 Correct 130 ms 132444 KB Output is correct
54 Correct 132 ms 132792 KB Output is correct
55 Correct 225 ms 238304 KB Output is correct
56 Correct 228 ms 237512 KB Output is correct
57 Correct 155 ms 155348 KB Output is correct
58 Correct 166 ms 165148 KB Output is correct
59 Correct 175 ms 164756 KB Output is correct
60 Correct 132 ms 132476 KB Output is correct
61 Correct 130 ms 132496 KB Output is correct
62 Correct 131 ms 132440 KB Output is correct
63 Correct 132 ms 132880 KB Output is correct
64 Correct 224 ms 238256 KB Output is correct
65 Correct 232 ms 238208 KB Output is correct
66 Correct 227 ms 235324 KB Output is correct
67 Correct 230 ms 237848 KB Output is correct
68 Correct 614 ms 163232 KB Output is correct
69 Correct 898 ms 165200 KB Output is correct
70 Correct 949 ms 165204 KB Output is correct
71 Correct 930 ms 132440 KB Output is correct
72 Correct 950 ms 132400 KB Output is correct
73 Correct 877 ms 132484 KB Output is correct
74 Correct 959 ms 132888 KB Output is correct
75 Correct 797 ms 238212 KB Output is correct
76 Correct 901 ms 238224 KB Output is correct
77 Correct 878 ms 236316 KB Output is correct
78 Correct 1012 ms 236248 KB Output is correct
79 Correct 737 ms 238140 KB Output is correct
80 Correct 804 ms 238324 KB Output is correct
81 Correct 0 ms 208 KB Output is correct
82 Correct 1 ms 1104 KB Output is correct
83 Correct 1 ms 1104 KB Output is correct
84 Correct 167 ms 165256 KB Output is correct
85 Correct 134 ms 132504 KB Output is correct
86 Correct 131 ms 132872 KB Output is correct
87 Correct 224 ms 238236 KB Output is correct
88 Correct 234 ms 238060 KB Output is correct
89 Correct 165 ms 165208 KB Output is correct
90 Correct 143 ms 132456 KB Output is correct
91 Correct 131 ms 132824 KB Output is correct
92 Correct 232 ms 238360 KB Output is correct
93 Correct 228 ms 237568 KB Output is correct
94 Correct 1 ms 988 KB Output is correct
95 Correct 1 ms 976 KB Output is correct
96 Correct 1 ms 976 KB Output is correct
97 Correct 1 ms 1104 KB Output is correct
98 Correct 1 ms 1104 KB Output is correct
99 Correct 1 ms 976 KB Output is correct
100 Correct 1 ms 976 KB Output is correct
101 Correct 1 ms 976 KB Output is correct
102 Correct 1 ms 1104 KB Output is correct
103 Correct 1 ms 1104 KB Output is correct
104 Correct 751 ms 133668 KB Output is correct
105 Correct 940 ms 165152 KB Output is correct
106 Correct 919 ms 164772 KB Output is correct
107 Correct 953 ms 132612 KB Output is correct
108 Correct 1020 ms 132496 KB Output is correct
109 Correct 894 ms 132488 KB Output is correct
110 Correct 869 ms 132868 KB Output is correct
111 Correct 862 ms 238232 KB Output is correct
112 Correct 742 ms 238256 KB Output is correct
113 Correct 713 ms 236588 KB Output is correct
114 Correct 927 ms 234132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 368 ms 94412 KB Output is correct
2 Correct 765 ms 237956 KB Output is correct
3 Correct 833 ms 237904 KB Output is correct
4 Correct 761 ms 238268 KB Output is correct
5 Correct 921 ms 238344 KB Output is correct
6 Correct 808 ms 238300 KB Output is correct
7 Correct 795 ms 238256 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 1 ms 1104 KB Output is correct
10 Correct 1 ms 1104 KB Output is correct
11 Correct 0 ms 336 KB Output is correct
12 Correct 1 ms 976 KB Output is correct
13 Correct 1 ms 976 KB Output is correct
14 Correct 1 ms 976 KB Output is correct
15 Correct 1 ms 976 KB Output is correct
16 Correct 1 ms 976 KB Output is correct
17 Correct 1 ms 976 KB Output is correct
18 Correct 1 ms 1172 KB Output is correct
19 Correct 1 ms 1104 KB Output is correct
20 Correct 2 ms 1104 KB Output is correct
21 Correct 1 ms 1104 KB Output is correct
22 Correct 1 ms 208 KB Output is correct
23 Correct 1 ms 1104 KB Output is correct
24 Correct 1 ms 1104 KB Output is correct
25 Correct 1 ms 976 KB Output is correct
26 Correct 1 ms 976 KB Output is correct
27 Correct 1 ms 976 KB Output is correct
28 Correct 1 ms 1104 KB Output is correct
29 Correct 1 ms 1104 KB Output is correct
30 Correct 1 ms 976 KB Output is correct
31 Correct 1 ms 976 KB Output is correct
32 Correct 1 ms 976 KB Output is correct
33 Correct 1 ms 1216 KB Output is correct
34 Correct 1 ms 1104 KB Output is correct
35 Correct 1 ms 592 KB Output is correct
36 Correct 1 ms 976 KB Output is correct
37 Correct 1 ms 976 KB Output is correct
38 Correct 1 ms 976 KB Output is correct
39 Correct 1 ms 976 KB Output is correct
40 Correct 1 ms 976 KB Output is correct
41 Correct 1 ms 976 KB Output is correct
42 Correct 1 ms 1216 KB Output is correct
43 Correct 1 ms 1104 KB Output is correct
44 Correct 1 ms 1104 KB Output is correct
45 Correct 1 ms 1104 KB Output is correct
46 Correct 83 ms 78012 KB Output is correct
47 Correct 165 ms 164756 KB Output is correct
48 Correct 165 ms 165168 KB Output is correct
49 Correct 138 ms 132480 KB Output is correct
50 Correct 130 ms 132828 KB Output is correct
51 Correct 131 ms 132464 KB Output is correct
52 Correct 131 ms 132460 KB Output is correct
53 Correct 243 ms 238308 KB Output is correct
54 Correct 232 ms 238240 KB Output is correct
55 Correct 226 ms 236096 KB Output is correct
56 Correct 225 ms 235276 KB Output is correct
57 Correct 163 ms 165168 KB Output is correct
58 Correct 132 ms 132456 KB Output is correct
59 Correct 134 ms 132912 KB Output is correct
60 Correct 223 ms 238212 KB Output is correct
61 Correct 227 ms 238128 KB Output is correct
62 Correct 166 ms 165320 KB Output is correct
63 Correct 130 ms 132444 KB Output is correct
64 Correct 132 ms 132792 KB Output is correct
65 Correct 225 ms 238304 KB Output is correct
66 Correct 228 ms 237512 KB Output is correct
67 Correct 155 ms 155348 KB Output is correct
68 Correct 166 ms 165148 KB Output is correct
69 Correct 175 ms 164756 KB Output is correct
70 Correct 132 ms 132476 KB Output is correct
71 Correct 130 ms 132496 KB Output is correct
72 Correct 131 ms 132440 KB Output is correct
73 Correct 132 ms 132880 KB Output is correct
74 Correct 224 ms 238256 KB Output is correct
75 Correct 232 ms 238208 KB Output is correct
76 Correct 227 ms 235324 KB Output is correct
77 Correct 230 ms 237848 KB Output is correct
78 Correct 614 ms 163232 KB Output is correct
79 Correct 898 ms 165200 KB Output is correct
80 Correct 949 ms 165204 KB Output is correct
81 Correct 930 ms 132440 KB Output is correct
82 Correct 950 ms 132400 KB Output is correct
83 Correct 877 ms 132484 KB Output is correct
84 Correct 959 ms 132888 KB Output is correct
85 Correct 797 ms 238212 KB Output is correct
86 Correct 901 ms 238224 KB Output is correct
87 Correct 878 ms 236316 KB Output is correct
88 Correct 1012 ms 236248 KB Output is correct
89 Correct 737 ms 238140 KB Output is correct
90 Correct 804 ms 238324 KB Output is correct
91 Correct 0 ms 208 KB Output is correct
92 Correct 1 ms 1104 KB Output is correct
93 Correct 1 ms 1104 KB Output is correct
94 Correct 167 ms 165256 KB Output is correct
95 Correct 134 ms 132504 KB Output is correct
96 Correct 131 ms 132872 KB Output is correct
97 Correct 224 ms 238236 KB Output is correct
98 Correct 234 ms 238060 KB Output is correct
99 Correct 165 ms 165208 KB Output is correct
100 Correct 143 ms 132456 KB Output is correct
101 Correct 131 ms 132824 KB Output is correct
102 Correct 232 ms 238360 KB Output is correct
103 Correct 228 ms 237568 KB Output is correct
104 Correct 1 ms 988 KB Output is correct
105 Correct 1 ms 976 KB Output is correct
106 Correct 1 ms 976 KB Output is correct
107 Correct 1 ms 1104 KB Output is correct
108 Correct 1 ms 1104 KB Output is correct
109 Correct 1 ms 976 KB Output is correct
110 Correct 1 ms 976 KB Output is correct
111 Correct 1 ms 976 KB Output is correct
112 Correct 1 ms 1104 KB Output is correct
113 Correct 1 ms 1104 KB Output is correct
114 Correct 265 ms 15968 KB Output is correct
115 Correct 1022 ms 165268 KB Output is correct
116 Correct 924 ms 165148 KB Output is correct
117 Correct 755 ms 132400 KB Output is correct
118 Correct 813 ms 132824 KB Output is correct
119 Correct 852 ms 132400 KB Output is correct
120 Correct 880 ms 132504 KB Output is correct
121 Correct 894 ms 238212 KB Output is correct
122 Correct 783 ms 238300 KB Output is correct
123 Correct 850 ms 235360 KB Output is correct
124 Correct 870 ms 235800 KB Output is correct
125 Correct 171 ms 165288 KB Output is correct
126 Correct 131 ms 132496 KB Output is correct
127 Correct 132 ms 132876 KB Output is correct
128 Correct 226 ms 238300 KB Output is correct
129 Correct 231 ms 237604 KB Output is correct
130 Correct 156 ms 155240 KB Output is correct
131 Correct 172 ms 165168 KB Output is correct
132 Correct 172 ms 164844 KB Output is correct
133 Correct 129 ms 132440 KB Output is correct
134 Correct 131 ms 132480 KB Output is correct
135 Correct 130 ms 132448 KB Output is correct
136 Correct 132 ms 132804 KB Output is correct
137 Correct 223 ms 238264 KB Output is correct
138 Correct 224 ms 238212 KB Output is correct
139 Correct 229 ms 235172 KB Output is correct
140 Correct 228 ms 237748 KB Output is correct
141 Correct 1 ms 976 KB Output is correct
142 Correct 1 ms 976 KB Output is correct
143 Correct 1 ms 976 KB Output is correct
144 Correct 1 ms 1104 KB Output is correct
145 Correct 1 ms 1104 KB Output is correct
146 Correct 1 ms 592 KB Output is correct
147 Correct 1 ms 976 KB Output is correct
148 Correct 1 ms 976 KB Output is correct
149 Correct 1 ms 976 KB Output is correct
150 Correct 1 ms 976 KB Output is correct
151 Correct 1 ms 976 KB Output is correct
152 Correct 2 ms 1024 KB Output is correct
153 Correct 2 ms 1104 KB Output is correct
154 Correct 1 ms 1104 KB Output is correct
155 Correct 1 ms 1104 KB Output is correct
156 Correct 1 ms 1104 KB Output is correct
157 Correct 751 ms 133668 KB Output is correct
158 Correct 940 ms 165152 KB Output is correct
159 Correct 919 ms 164772 KB Output is correct
160 Correct 953 ms 132612 KB Output is correct
161 Correct 1020 ms 132496 KB Output is correct
162 Correct 894 ms 132488 KB Output is correct
163 Correct 869 ms 132868 KB Output is correct
164 Correct 862 ms 238232 KB Output is correct
165 Correct 742 ms 238256 KB Output is correct
166 Correct 713 ms 236588 KB Output is correct
167 Correct 927 ms 234132 KB Output is correct
168 Correct 0 ms 208 KB Output is correct
169 Correct 587 ms 27976 KB Output is correct
170 Correct 1078 ms 165632 KB Output is correct
171 Correct 947 ms 165300 KB Output is correct
172 Correct 922 ms 132396 KB Output is correct
173 Runtime error 551 ms 269332 KB Execution killed with signal 6
174 Halted 0 ms 0 KB -