Submission #829374

# Submission time Handle Problem Language Result Execution time Memory
829374 2023-08-18T09:57:53 Z QwertyPi Uplifting Excursion (BOI22_vault) C++14
80 / 100
1949 ms 456080 KB
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#define int long long

using namespace std;

const int M = 300 + 11;
const int X = M * M;
const int INF = 1LL << 60;
int a[M * 2];
int s[M * 2];

int norm(int x, int m){
	if(x >= 0) return x;
	return (x % m + m) % m;
}

int dp_p[M][X], dp_n[M][X];
void solve(int m, int L, vector<int> a, int dp[M][X]){
	for(int i = 0; i <= m; i++){
		fill(dp[i], dp[i] + X, -INF);
	}
	for(int i = 1; i <= m; i++) s[i] = min(L, s[i - 1] + i * a[i]);

	dp[0][0] = 0;
	for(int i = 1; i <= m; i++){
		for(int j = 0; j <= m * (i - 1); j++){
			int left = norm(s[i] - s[i - 1] + j - a[i] * i, i);
			int right = min(s[i] + j - s[i - 1], m * i);
			int inc = i;
			int delta = ((s[i] - left) - (s[i - 1] - j)) / i;
			for(int k = left; k <= right; k += inc){
				dp[i][k] = max(dp[i][k], dp[i - 1][j] + delta);
				delta--;
			}
		}
	}
}

int32_t main(){
	int m, L; cin >> m >> L;
	for(int i = 0; i <= m * 2; i++) cin >> a[i];
	
	if(L < 0){
		reverse(a, a + m * 2 + 1); L = -L;
	}

	int sum_p = 0, sum_n = 0;
	for(int i = m + 1; i <= m * 2; i++) {
		sum_p += (i - m) * a[i];
	}
	for(int i = m - 1; i >= 0; i--) {
		sum_n += (m - i) * a[i];
	}

	if(sum_p < L){
		cout << "impossible" << endl;
		return 0;
	}

	int lim = min(sum_n, sum_p - L);

	// positive
	vector<int> b_pos {0}, b_neg {0};
	for(int i = 1; i <= m; i++){
		b_pos.push_back(a[m + i]);
		b_neg.push_back(a[m - i]);
	}

	solve(m, lim + L, b_pos, dp_p);
	solve(m, lim, b_neg, dp_n);

	int ans = -INF;
	for(int i = 0; i <= m * m * 2; i++){
		ans = max(ans, dp_p[m][i] + dp_n[m][i]);
	}
	if(L < 0){
		cout << "impossible" << endl;
		return 0;
	}

	if(ans <= -INF / 2){
		cout << "impossible" << endl;
	}else{
		cout << a[m] + ans << endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4820 KB Output is correct
2 Correct 2 ms 6356 KB Output is correct
3 Correct 1 ms 3284 KB Output is correct
4 Correct 7 ms 16980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 31 ms 77556 KB Output is correct
7 Correct 30 ms 77548 KB Output is correct
8 Correct 31 ms 77420 KB Output is correct
9 Correct 32 ms 77516 KB Output is correct
10 Correct 30 ms 77512 KB Output is correct
11 Correct 30 ms 77552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4820 KB Output is correct
2 Correct 2 ms 6356 KB Output is correct
3 Correct 1 ms 3284 KB Output is correct
4 Correct 7 ms 16980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 31 ms 77556 KB Output is correct
7 Correct 30 ms 77548 KB Output is correct
8 Correct 31 ms 77420 KB Output is correct
9 Correct 32 ms 77516 KB Output is correct
10 Correct 30 ms 77512 KB Output is correct
11 Correct 30 ms 77552 KB Output is correct
12 Correct 2 ms 4820 KB Output is correct
13 Correct 2 ms 6356 KB Output is correct
14 Correct 1 ms 3284 KB Output is correct
15 Correct 6 ms 16980 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 30 ms 77452 KB Output is correct
18 Correct 29 ms 77524 KB Output is correct
19 Correct 30 ms 77520 KB Output is correct
20 Correct 30 ms 77524 KB Output is correct
21 Correct 27 ms 77528 KB Output is correct
22 Correct 27 ms 77500 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 100 ms 153248 KB Output is correct
25 Correct 66 ms 153248 KB Output is correct
26 Correct 98 ms 153248 KB Output is correct
27 Correct 100 ms 153192 KB Output is correct
28 Correct 55 ms 153216 KB Output is correct
29 Correct 59 ms 153236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 16980 KB Output is correct
2 Correct 18 ms 47220 KB Output is correct
3 Correct 22 ms 47188 KB Output is correct
4 Correct 18 ms 47248 KB Output is correct
5 Correct 18 ms 47188 KB Output is correct
6 Correct 18 ms 47200 KB Output is correct
7 Correct 18 ms 47172 KB Output is correct
8 Correct 17 ms 47264 KB Output is correct
9 Correct 18 ms 47200 KB Output is correct
10 Correct 17 ms 47188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 16980 KB Output is correct
2 Correct 18 ms 47220 KB Output is correct
3 Correct 22 ms 47188 KB Output is correct
4 Correct 18 ms 47248 KB Output is correct
5 Correct 18 ms 47188 KB Output is correct
6 Correct 18 ms 47200 KB Output is correct
7 Correct 18 ms 47172 KB Output is correct
8 Correct 17 ms 47264 KB Output is correct
9 Correct 18 ms 47200 KB Output is correct
10 Correct 17 ms 47188 KB Output is correct
11 Correct 2 ms 4820 KB Output is correct
12 Correct 2 ms 6356 KB Output is correct
13 Correct 1 ms 3272 KB Output is correct
14 Correct 6 ms 16980 KB Output is correct
15 Correct 18 ms 47264 KB Output is correct
16 Correct 19 ms 47172 KB Output is correct
17 Correct 18 ms 47188 KB Output is correct
18 Correct 18 ms 47240 KB Output is correct
19 Correct 21 ms 47236 KB Output is correct
20 Correct 19 ms 47188 KB Output is correct
21 Correct 22 ms 47220 KB Output is correct
22 Correct 20 ms 47224 KB Output is correct
23 Correct 20 ms 47188 KB Output is correct
24 Correct 21 ms 47152 KB Output is correct
25 Correct 16 ms 47188 KB Output is correct
26 Correct 15 ms 47184 KB Output is correct
27 Correct 17 ms 47180 KB Output is correct
28 Correct 23 ms 47220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 16980 KB Output is correct
2 Correct 18 ms 47220 KB Output is correct
3 Correct 22 ms 47188 KB Output is correct
4 Correct 18 ms 47248 KB Output is correct
5 Correct 18 ms 47188 KB Output is correct
6 Correct 18 ms 47200 KB Output is correct
7 Correct 18 ms 47172 KB Output is correct
8 Correct 17 ms 47264 KB Output is correct
9 Correct 18 ms 47200 KB Output is correct
10 Correct 17 ms 47188 KB Output is correct
11 Correct 8 ms 16932 KB Output is correct
12 Correct 18 ms 47252 KB Output is correct
13 Correct 22 ms 47184 KB Output is correct
14 Correct 16 ms 47248 KB Output is correct
15 Correct 15 ms 47188 KB Output is correct
16 Correct 18 ms 47220 KB Output is correct
17 Correct 19 ms 47264 KB Output is correct
18 Correct 22 ms 47272 KB Output is correct
19 Correct 20 ms 47152 KB Output is correct
20 Correct 18 ms 47208 KB Output is correct
21 Correct 29 ms 77488 KB Output is correct
22 Correct 27 ms 77496 KB Output is correct
23 Correct 28 ms 77516 KB Output is correct
24 Correct 38 ms 77472 KB Output is correct
25 Correct 26 ms 77436 KB Output is correct
26 Correct 27 ms 77440 KB Output is correct
27 Correct 36 ms 77564 KB Output is correct
28 Correct 27 ms 77540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4820 KB Output is correct
2 Correct 2 ms 6356 KB Output is correct
3 Correct 1 ms 3284 KB Output is correct
4 Correct 7 ms 16980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 31 ms 77556 KB Output is correct
7 Correct 30 ms 77548 KB Output is correct
8 Correct 31 ms 77420 KB Output is correct
9 Correct 32 ms 77516 KB Output is correct
10 Correct 30 ms 77512 KB Output is correct
11 Correct 30 ms 77552 KB Output is correct
12 Correct 7 ms 16980 KB Output is correct
13 Correct 18 ms 47220 KB Output is correct
14 Correct 22 ms 47188 KB Output is correct
15 Correct 18 ms 47248 KB Output is correct
16 Correct 18 ms 47188 KB Output is correct
17 Correct 18 ms 47200 KB Output is correct
18 Correct 18 ms 47172 KB Output is correct
19 Correct 17 ms 47264 KB Output is correct
20 Correct 18 ms 47200 KB Output is correct
21 Correct 17 ms 47188 KB Output is correct
22 Correct 2 ms 4820 KB Output is correct
23 Correct 2 ms 6356 KB Output is correct
24 Correct 1 ms 3272 KB Output is correct
25 Correct 6 ms 16980 KB Output is correct
26 Correct 18 ms 47264 KB Output is correct
27 Correct 19 ms 47172 KB Output is correct
28 Correct 18 ms 47188 KB Output is correct
29 Correct 18 ms 47240 KB Output is correct
30 Correct 21 ms 47236 KB Output is correct
31 Correct 19 ms 47188 KB Output is correct
32 Correct 22 ms 47220 KB Output is correct
33 Correct 20 ms 47224 KB Output is correct
34 Correct 20 ms 47188 KB Output is correct
35 Correct 21 ms 47152 KB Output is correct
36 Correct 16 ms 47188 KB Output is correct
37 Correct 15 ms 47184 KB Output is correct
38 Correct 17 ms 47180 KB Output is correct
39 Correct 23 ms 47220 KB Output is correct
40 Correct 8 ms 16932 KB Output is correct
41 Correct 18 ms 47252 KB Output is correct
42 Correct 22 ms 47184 KB Output is correct
43 Correct 16 ms 47248 KB Output is correct
44 Correct 15 ms 47188 KB Output is correct
45 Correct 18 ms 47220 KB Output is correct
46 Correct 19 ms 47264 KB Output is correct
47 Correct 22 ms 47272 KB Output is correct
48 Correct 20 ms 47152 KB Output is correct
49 Correct 18 ms 47208 KB Output is correct
50 Correct 29 ms 77488 KB Output is correct
51 Correct 27 ms 77496 KB Output is correct
52 Correct 28 ms 77516 KB Output is correct
53 Correct 38 ms 77472 KB Output is correct
54 Correct 26 ms 77436 KB Output is correct
55 Correct 27 ms 77440 KB Output is correct
56 Correct 36 ms 77564 KB Output is correct
57 Correct 27 ms 77540 KB Output is correct
58 Correct 2 ms 4820 KB Output is correct
59 Correct 2 ms 6356 KB Output is correct
60 Correct 1 ms 3284 KB Output is correct
61 Correct 8 ms 16980 KB Output is correct
62 Correct 0 ms 212 KB Output is correct
63 Correct 30 ms 77496 KB Output is correct
64 Correct 29 ms 77480 KB Output is correct
65 Correct 31 ms 77612 KB Output is correct
66 Correct 32 ms 77532 KB Output is correct
67 Correct 31 ms 77524 KB Output is correct
68 Correct 35 ms 77516 KB Output is correct
69 Correct 18 ms 47184 KB Output is correct
70 Correct 20 ms 47272 KB Output is correct
71 Correct 19 ms 47172 KB Output is correct
72 Correct 19 ms 47180 KB Output is correct
73 Correct 18 ms 47176 KB Output is correct
74 Correct 16 ms 47188 KB Output is correct
75 Correct 16 ms 47208 KB Output is correct
76 Correct 15 ms 47156 KB Output is correct
77 Correct 20 ms 47232 KB Output is correct
78 Correct 15 ms 47260 KB Output is correct
79 Correct 17 ms 47192 KB Output is correct
80 Correct 22 ms 47244 KB Output is correct
81 Correct 24 ms 47192 KB Output is correct
82 Correct 17 ms 47152 KB Output is correct
83 Correct 27 ms 77504 KB Output is correct
84 Correct 26 ms 77448 KB Output is correct
85 Correct 29 ms 77540 KB Output is correct
86 Correct 36 ms 77528 KB Output is correct
87 Correct 33 ms 77492 KB Output is correct
88 Correct 36 ms 77488 KB Output is correct
89 Correct 27 ms 77524 KB Output is correct
90 Correct 28 ms 77464 KB Output is correct
91 Correct 30 ms 77536 KB Output is correct
92 Correct 40 ms 77512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 16980 KB Output is correct
2 Correct 18 ms 47220 KB Output is correct
3 Correct 22 ms 47188 KB Output is correct
4 Correct 18 ms 47248 KB Output is correct
5 Correct 18 ms 47188 KB Output is correct
6 Correct 18 ms 47200 KB Output is correct
7 Correct 18 ms 47172 KB Output is correct
8 Correct 17 ms 47264 KB Output is correct
9 Correct 18 ms 47200 KB Output is correct
10 Correct 17 ms 47188 KB Output is correct
11 Correct 8 ms 16932 KB Output is correct
12 Correct 18 ms 47252 KB Output is correct
13 Correct 22 ms 47184 KB Output is correct
14 Correct 16 ms 47248 KB Output is correct
15 Correct 15 ms 47188 KB Output is correct
16 Correct 18 ms 47220 KB Output is correct
17 Correct 19 ms 47264 KB Output is correct
18 Correct 22 ms 47272 KB Output is correct
19 Correct 20 ms 47152 KB Output is correct
20 Correct 18 ms 47208 KB Output is correct
21 Correct 29 ms 77488 KB Output is correct
22 Correct 27 ms 77496 KB Output is correct
23 Correct 28 ms 77516 KB Output is correct
24 Correct 38 ms 77472 KB Output is correct
25 Correct 26 ms 77436 KB Output is correct
26 Correct 27 ms 77440 KB Output is correct
27 Correct 36 ms 77564 KB Output is correct
28 Correct 27 ms 77540 KB Output is correct
29 Correct 9 ms 16904 KB Output is correct
30 Correct 18 ms 47188 KB Output is correct
31 Correct 19 ms 47268 KB Output is correct
32 Correct 21 ms 47160 KB Output is correct
33 Correct 15 ms 47188 KB Output is correct
34 Correct 16 ms 47144 KB Output is correct
35 Correct 20 ms 47156 KB Output is correct
36 Correct 20 ms 47188 KB Output is correct
37 Correct 24 ms 47180 KB Output is correct
38 Correct 16 ms 47244 KB Output is correct
39 Correct 25 ms 77524 KB Output is correct
40 Correct 25 ms 77512 KB Output is correct
41 Correct 33 ms 77436 KB Output is correct
42 Correct 31 ms 77468 KB Output is correct
43 Correct 27 ms 77524 KB Output is correct
44 Correct 27 ms 77512 KB Output is correct
45 Correct 25 ms 77460 KB Output is correct
46 Correct 25 ms 77556 KB Output is correct
47 Correct 62 ms 153196 KB Output is correct
48 Correct 59 ms 153204 KB Output is correct
49 Correct 69 ms 153168 KB Output is correct
50 Correct 70 ms 153128 KB Output is correct
51 Correct 73 ms 153208 KB Output is correct
52 Correct 93 ms 153188 KB Output is correct
53 Correct 78 ms 153164 KB Output is correct
54 Correct 64 ms 153204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4820 KB Output is correct
2 Correct 2 ms 6356 KB Output is correct
3 Correct 1 ms 3284 KB Output is correct
4 Correct 7 ms 16980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 31 ms 77556 KB Output is correct
7 Correct 30 ms 77548 KB Output is correct
8 Correct 31 ms 77420 KB Output is correct
9 Correct 32 ms 77516 KB Output is correct
10 Correct 30 ms 77512 KB Output is correct
11 Correct 30 ms 77552 KB Output is correct
12 Correct 2 ms 4820 KB Output is correct
13 Correct 2 ms 6356 KB Output is correct
14 Correct 1 ms 3284 KB Output is correct
15 Correct 6 ms 16980 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 30 ms 77452 KB Output is correct
18 Correct 29 ms 77524 KB Output is correct
19 Correct 30 ms 77520 KB Output is correct
20 Correct 30 ms 77524 KB Output is correct
21 Correct 27 ms 77528 KB Output is correct
22 Correct 27 ms 77500 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 100 ms 153248 KB Output is correct
25 Correct 66 ms 153248 KB Output is correct
26 Correct 98 ms 153248 KB Output is correct
27 Correct 100 ms 153192 KB Output is correct
28 Correct 55 ms 153216 KB Output is correct
29 Correct 59 ms 153236 KB Output is correct
30 Correct 7 ms 16980 KB Output is correct
31 Correct 18 ms 47220 KB Output is correct
32 Correct 22 ms 47188 KB Output is correct
33 Correct 18 ms 47248 KB Output is correct
34 Correct 18 ms 47188 KB Output is correct
35 Correct 18 ms 47200 KB Output is correct
36 Correct 18 ms 47172 KB Output is correct
37 Correct 17 ms 47264 KB Output is correct
38 Correct 18 ms 47200 KB Output is correct
39 Correct 17 ms 47188 KB Output is correct
40 Correct 2 ms 4820 KB Output is correct
41 Correct 2 ms 6356 KB Output is correct
42 Correct 1 ms 3272 KB Output is correct
43 Correct 6 ms 16980 KB Output is correct
44 Correct 18 ms 47264 KB Output is correct
45 Correct 19 ms 47172 KB Output is correct
46 Correct 18 ms 47188 KB Output is correct
47 Correct 18 ms 47240 KB Output is correct
48 Correct 21 ms 47236 KB Output is correct
49 Correct 19 ms 47188 KB Output is correct
50 Correct 22 ms 47220 KB Output is correct
51 Correct 20 ms 47224 KB Output is correct
52 Correct 20 ms 47188 KB Output is correct
53 Correct 21 ms 47152 KB Output is correct
54 Correct 16 ms 47188 KB Output is correct
55 Correct 15 ms 47184 KB Output is correct
56 Correct 17 ms 47180 KB Output is correct
57 Correct 23 ms 47220 KB Output is correct
58 Correct 8 ms 16932 KB Output is correct
59 Correct 18 ms 47252 KB Output is correct
60 Correct 22 ms 47184 KB Output is correct
61 Correct 16 ms 47248 KB Output is correct
62 Correct 15 ms 47188 KB Output is correct
63 Correct 18 ms 47220 KB Output is correct
64 Correct 19 ms 47264 KB Output is correct
65 Correct 22 ms 47272 KB Output is correct
66 Correct 20 ms 47152 KB Output is correct
67 Correct 18 ms 47208 KB Output is correct
68 Correct 29 ms 77488 KB Output is correct
69 Correct 27 ms 77496 KB Output is correct
70 Correct 28 ms 77516 KB Output is correct
71 Correct 38 ms 77472 KB Output is correct
72 Correct 26 ms 77436 KB Output is correct
73 Correct 27 ms 77440 KB Output is correct
74 Correct 36 ms 77564 KB Output is correct
75 Correct 27 ms 77540 KB Output is correct
76 Correct 2 ms 4820 KB Output is correct
77 Correct 2 ms 6356 KB Output is correct
78 Correct 1 ms 3284 KB Output is correct
79 Correct 8 ms 16980 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 30 ms 77496 KB Output is correct
82 Correct 29 ms 77480 KB Output is correct
83 Correct 31 ms 77612 KB Output is correct
84 Correct 32 ms 77532 KB Output is correct
85 Correct 31 ms 77524 KB Output is correct
86 Correct 35 ms 77516 KB Output is correct
87 Correct 18 ms 47184 KB Output is correct
88 Correct 20 ms 47272 KB Output is correct
89 Correct 19 ms 47172 KB Output is correct
90 Correct 19 ms 47180 KB Output is correct
91 Correct 18 ms 47176 KB Output is correct
92 Correct 16 ms 47188 KB Output is correct
93 Correct 16 ms 47208 KB Output is correct
94 Correct 15 ms 47156 KB Output is correct
95 Correct 20 ms 47232 KB Output is correct
96 Correct 15 ms 47260 KB Output is correct
97 Correct 17 ms 47192 KB Output is correct
98 Correct 22 ms 47244 KB Output is correct
99 Correct 24 ms 47192 KB Output is correct
100 Correct 17 ms 47152 KB Output is correct
101 Correct 27 ms 77504 KB Output is correct
102 Correct 26 ms 77448 KB Output is correct
103 Correct 29 ms 77540 KB Output is correct
104 Correct 36 ms 77528 KB Output is correct
105 Correct 33 ms 77492 KB Output is correct
106 Correct 36 ms 77488 KB Output is correct
107 Correct 27 ms 77524 KB Output is correct
108 Correct 28 ms 77464 KB Output is correct
109 Correct 30 ms 77536 KB Output is correct
110 Correct 40 ms 77512 KB Output is correct
111 Correct 9 ms 16904 KB Output is correct
112 Correct 18 ms 47188 KB Output is correct
113 Correct 19 ms 47268 KB Output is correct
114 Correct 21 ms 47160 KB Output is correct
115 Correct 15 ms 47188 KB Output is correct
116 Correct 16 ms 47144 KB Output is correct
117 Correct 20 ms 47156 KB Output is correct
118 Correct 20 ms 47188 KB Output is correct
119 Correct 24 ms 47180 KB Output is correct
120 Correct 16 ms 47244 KB Output is correct
121 Correct 25 ms 77524 KB Output is correct
122 Correct 25 ms 77512 KB Output is correct
123 Correct 33 ms 77436 KB Output is correct
124 Correct 31 ms 77468 KB Output is correct
125 Correct 27 ms 77524 KB Output is correct
126 Correct 27 ms 77512 KB Output is correct
127 Correct 25 ms 77460 KB Output is correct
128 Correct 25 ms 77556 KB Output is correct
129 Correct 62 ms 153196 KB Output is correct
130 Correct 59 ms 153204 KB Output is correct
131 Correct 69 ms 153168 KB Output is correct
132 Correct 70 ms 153128 KB Output is correct
133 Correct 73 ms 153208 KB Output is correct
134 Correct 93 ms 153188 KB Output is correct
135 Correct 78 ms 153164 KB Output is correct
136 Correct 64 ms 153204 KB Output is correct
137 Correct 2 ms 4820 KB Output is correct
138 Correct 3 ms 6356 KB Output is correct
139 Correct 1 ms 3284 KB Output is correct
140 Correct 6 ms 16980 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 27 ms 77468 KB Output is correct
143 Correct 26 ms 77524 KB Output is correct
144 Correct 36 ms 77468 KB Output is correct
145 Correct 44 ms 77444 KB Output is correct
146 Correct 32 ms 77524 KB Output is correct
147 Correct 29 ms 77484 KB Output is correct
148 Correct 1 ms 212 KB Output is correct
149 Correct 81 ms 153232 KB Output is correct
150 Correct 82 ms 153248 KB Output is correct
151 Correct 111 ms 153252 KB Output is correct
152 Correct 102 ms 153224 KB Output is correct
153 Correct 63 ms 153240 KB Output is correct
154 Correct 66 ms 153236 KB Output is correct
155 Correct 17 ms 47232 KB Output is correct
156 Correct 15 ms 47180 KB Output is correct
157 Correct 15 ms 47188 KB Output is correct
158 Correct 15 ms 47188 KB Output is correct
159 Correct 20 ms 47160 KB Output is correct
160 Correct 20 ms 47208 KB Output is correct
161 Correct 19 ms 47188 KB Output is correct
162 Correct 17 ms 47188 KB Output is correct
163 Correct 16 ms 47188 KB Output is correct
164 Correct 26 ms 77476 KB Output is correct
165 Correct 26 ms 77500 KB Output is correct
166 Correct 39 ms 77424 KB Output is correct
167 Correct 34 ms 77456 KB Output is correct
168 Correct 33 ms 77524 KB Output is correct
169 Correct 26 ms 77516 KB Output is correct
170 Correct 16 ms 47176 KB Output is correct
171 Correct 19 ms 47188 KB Output is correct
172 Correct 20 ms 47188 KB Output is correct
173 Correct 19 ms 47184 KB Output is correct
174 Correct 20 ms 47272 KB Output is correct
175 Correct 29 ms 77524 KB Output is correct
176 Correct 28 ms 77524 KB Output is correct
177 Correct 27 ms 77532 KB Output is correct
178 Correct 31 ms 77512 KB Output is correct
179 Correct 78 ms 153220 KB Output is correct
180 Correct 69 ms 153188 KB Output is correct
181 Correct 77 ms 153248 KB Output is correct
182 Correct 85 ms 153124 KB Output is correct
183 Correct 72 ms 153164 KB Output is correct
184 Correct 78 ms 153352 KB Output is correct
185 Correct 107 ms 153248 KB Output is correct
186 Correct 101 ms 153248 KB Output is correct
187 Correct 95 ms 153192 KB Output is correct
188 Correct 87 ms 153176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 16980 KB Output is correct
2 Correct 18 ms 47220 KB Output is correct
3 Correct 22 ms 47188 KB Output is correct
4 Correct 18 ms 47248 KB Output is correct
5 Correct 18 ms 47188 KB Output is correct
6 Correct 18 ms 47200 KB Output is correct
7 Correct 18 ms 47172 KB Output is correct
8 Correct 17 ms 47264 KB Output is correct
9 Correct 18 ms 47200 KB Output is correct
10 Correct 17 ms 47188 KB Output is correct
11 Correct 8 ms 16932 KB Output is correct
12 Correct 18 ms 47252 KB Output is correct
13 Correct 22 ms 47184 KB Output is correct
14 Correct 16 ms 47248 KB Output is correct
15 Correct 15 ms 47188 KB Output is correct
16 Correct 18 ms 47220 KB Output is correct
17 Correct 19 ms 47264 KB Output is correct
18 Correct 22 ms 47272 KB Output is correct
19 Correct 20 ms 47152 KB Output is correct
20 Correct 18 ms 47208 KB Output is correct
21 Correct 29 ms 77488 KB Output is correct
22 Correct 27 ms 77496 KB Output is correct
23 Correct 28 ms 77516 KB Output is correct
24 Correct 38 ms 77472 KB Output is correct
25 Correct 26 ms 77436 KB Output is correct
26 Correct 27 ms 77440 KB Output is correct
27 Correct 36 ms 77564 KB Output is correct
28 Correct 27 ms 77540 KB Output is correct
29 Correct 9 ms 16904 KB Output is correct
30 Correct 18 ms 47188 KB Output is correct
31 Correct 19 ms 47268 KB Output is correct
32 Correct 21 ms 47160 KB Output is correct
33 Correct 15 ms 47188 KB Output is correct
34 Correct 16 ms 47144 KB Output is correct
35 Correct 20 ms 47156 KB Output is correct
36 Correct 20 ms 47188 KB Output is correct
37 Correct 24 ms 47180 KB Output is correct
38 Correct 16 ms 47244 KB Output is correct
39 Correct 25 ms 77524 KB Output is correct
40 Correct 25 ms 77512 KB Output is correct
41 Correct 33 ms 77436 KB Output is correct
42 Correct 31 ms 77468 KB Output is correct
43 Correct 27 ms 77524 KB Output is correct
44 Correct 27 ms 77512 KB Output is correct
45 Correct 25 ms 77460 KB Output is correct
46 Correct 25 ms 77556 KB Output is correct
47 Correct 62 ms 153196 KB Output is correct
48 Correct 59 ms 153204 KB Output is correct
49 Correct 69 ms 153168 KB Output is correct
50 Correct 70 ms 153128 KB Output is correct
51 Correct 73 ms 153208 KB Output is correct
52 Correct 93 ms 153188 KB Output is correct
53 Correct 78 ms 153164 KB Output is correct
54 Correct 64 ms 153204 KB Output is correct
55 Correct 9 ms 16980 KB Output is correct
56 Correct 22 ms 47200 KB Output is correct
57 Correct 17 ms 47152 KB Output is correct
58 Correct 16 ms 47164 KB Output is correct
59 Correct 16 ms 47156 KB Output is correct
60 Correct 16 ms 47184 KB Output is correct
61 Correct 15 ms 47244 KB Output is correct
62 Correct 14 ms 47232 KB Output is correct
63 Correct 21 ms 47188 KB Output is correct
64 Correct 23 ms 47164 KB Output is correct
65 Correct 29 ms 77524 KB Output is correct
66 Correct 27 ms 77452 KB Output is correct
67 Correct 35 ms 77464 KB Output is correct
68 Correct 25 ms 77448 KB Output is correct
69 Correct 26 ms 77524 KB Output is correct
70 Correct 27 ms 77448 KB Output is correct
71 Correct 32 ms 77516 KB Output is correct
72 Correct 35 ms 77448 KB Output is correct
73 Correct 56 ms 153172 KB Output is correct
74 Correct 55 ms 153224 KB Output is correct
75 Correct 76 ms 153200 KB Output is correct
76 Correct 62 ms 153204 KB Output is correct
77 Correct 89 ms 153196 KB Output is correct
78 Correct 97 ms 153192 KB Output is correct
79 Correct 69 ms 153248 KB Output is correct
80 Correct 91 ms 153168 KB Output is correct
81 Correct 1949 ms 456048 KB Output is correct
82 Incorrect 937 ms 456080 KB Output isn't correct
83 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4820 KB Output is correct
2 Correct 2 ms 6356 KB Output is correct
3 Correct 1 ms 3284 KB Output is correct
4 Correct 7 ms 16980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 31 ms 77556 KB Output is correct
7 Correct 30 ms 77548 KB Output is correct
8 Correct 31 ms 77420 KB Output is correct
9 Correct 32 ms 77516 KB Output is correct
10 Correct 30 ms 77512 KB Output is correct
11 Correct 30 ms 77552 KB Output is correct
12 Correct 2 ms 4820 KB Output is correct
13 Correct 2 ms 6356 KB Output is correct
14 Correct 1 ms 3284 KB Output is correct
15 Correct 6 ms 16980 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 30 ms 77452 KB Output is correct
18 Correct 29 ms 77524 KB Output is correct
19 Correct 30 ms 77520 KB Output is correct
20 Correct 30 ms 77524 KB Output is correct
21 Correct 27 ms 77528 KB Output is correct
22 Correct 27 ms 77500 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 100 ms 153248 KB Output is correct
25 Correct 66 ms 153248 KB Output is correct
26 Correct 98 ms 153248 KB Output is correct
27 Correct 100 ms 153192 KB Output is correct
28 Correct 55 ms 153216 KB Output is correct
29 Correct 59 ms 153236 KB Output is correct
30 Correct 7 ms 16980 KB Output is correct
31 Correct 18 ms 47220 KB Output is correct
32 Correct 22 ms 47188 KB Output is correct
33 Correct 18 ms 47248 KB Output is correct
34 Correct 18 ms 47188 KB Output is correct
35 Correct 18 ms 47200 KB Output is correct
36 Correct 18 ms 47172 KB Output is correct
37 Correct 17 ms 47264 KB Output is correct
38 Correct 18 ms 47200 KB Output is correct
39 Correct 17 ms 47188 KB Output is correct
40 Correct 2 ms 4820 KB Output is correct
41 Correct 2 ms 6356 KB Output is correct
42 Correct 1 ms 3272 KB Output is correct
43 Correct 6 ms 16980 KB Output is correct
44 Correct 18 ms 47264 KB Output is correct
45 Correct 19 ms 47172 KB Output is correct
46 Correct 18 ms 47188 KB Output is correct
47 Correct 18 ms 47240 KB Output is correct
48 Correct 21 ms 47236 KB Output is correct
49 Correct 19 ms 47188 KB Output is correct
50 Correct 22 ms 47220 KB Output is correct
51 Correct 20 ms 47224 KB Output is correct
52 Correct 20 ms 47188 KB Output is correct
53 Correct 21 ms 47152 KB Output is correct
54 Correct 16 ms 47188 KB Output is correct
55 Correct 15 ms 47184 KB Output is correct
56 Correct 17 ms 47180 KB Output is correct
57 Correct 23 ms 47220 KB Output is correct
58 Correct 8 ms 16932 KB Output is correct
59 Correct 18 ms 47252 KB Output is correct
60 Correct 22 ms 47184 KB Output is correct
61 Correct 16 ms 47248 KB Output is correct
62 Correct 15 ms 47188 KB Output is correct
63 Correct 18 ms 47220 KB Output is correct
64 Correct 19 ms 47264 KB Output is correct
65 Correct 22 ms 47272 KB Output is correct
66 Correct 20 ms 47152 KB Output is correct
67 Correct 18 ms 47208 KB Output is correct
68 Correct 29 ms 77488 KB Output is correct
69 Correct 27 ms 77496 KB Output is correct
70 Correct 28 ms 77516 KB Output is correct
71 Correct 38 ms 77472 KB Output is correct
72 Correct 26 ms 77436 KB Output is correct
73 Correct 27 ms 77440 KB Output is correct
74 Correct 36 ms 77564 KB Output is correct
75 Correct 27 ms 77540 KB Output is correct
76 Correct 2 ms 4820 KB Output is correct
77 Correct 2 ms 6356 KB Output is correct
78 Correct 1 ms 3284 KB Output is correct
79 Correct 8 ms 16980 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 30 ms 77496 KB Output is correct
82 Correct 29 ms 77480 KB Output is correct
83 Correct 31 ms 77612 KB Output is correct
84 Correct 32 ms 77532 KB Output is correct
85 Correct 31 ms 77524 KB Output is correct
86 Correct 35 ms 77516 KB Output is correct
87 Correct 18 ms 47184 KB Output is correct
88 Correct 20 ms 47272 KB Output is correct
89 Correct 19 ms 47172 KB Output is correct
90 Correct 19 ms 47180 KB Output is correct
91 Correct 18 ms 47176 KB Output is correct
92 Correct 16 ms 47188 KB Output is correct
93 Correct 16 ms 47208 KB Output is correct
94 Correct 15 ms 47156 KB Output is correct
95 Correct 20 ms 47232 KB Output is correct
96 Correct 15 ms 47260 KB Output is correct
97 Correct 17 ms 47192 KB Output is correct
98 Correct 22 ms 47244 KB Output is correct
99 Correct 24 ms 47192 KB Output is correct
100 Correct 17 ms 47152 KB Output is correct
101 Correct 27 ms 77504 KB Output is correct
102 Correct 26 ms 77448 KB Output is correct
103 Correct 29 ms 77540 KB Output is correct
104 Correct 36 ms 77528 KB Output is correct
105 Correct 33 ms 77492 KB Output is correct
106 Correct 36 ms 77488 KB Output is correct
107 Correct 27 ms 77524 KB Output is correct
108 Correct 28 ms 77464 KB Output is correct
109 Correct 30 ms 77536 KB Output is correct
110 Correct 40 ms 77512 KB Output is correct
111 Correct 9 ms 16904 KB Output is correct
112 Correct 18 ms 47188 KB Output is correct
113 Correct 19 ms 47268 KB Output is correct
114 Correct 21 ms 47160 KB Output is correct
115 Correct 15 ms 47188 KB Output is correct
116 Correct 16 ms 47144 KB Output is correct
117 Correct 20 ms 47156 KB Output is correct
118 Correct 20 ms 47188 KB Output is correct
119 Correct 24 ms 47180 KB Output is correct
120 Correct 16 ms 47244 KB Output is correct
121 Correct 25 ms 77524 KB Output is correct
122 Correct 25 ms 77512 KB Output is correct
123 Correct 33 ms 77436 KB Output is correct
124 Correct 31 ms 77468 KB Output is correct
125 Correct 27 ms 77524 KB Output is correct
126 Correct 27 ms 77512 KB Output is correct
127 Correct 25 ms 77460 KB Output is correct
128 Correct 25 ms 77556 KB Output is correct
129 Correct 62 ms 153196 KB Output is correct
130 Correct 59 ms 153204 KB Output is correct
131 Correct 69 ms 153168 KB Output is correct
132 Correct 70 ms 153128 KB Output is correct
133 Correct 73 ms 153208 KB Output is correct
134 Correct 93 ms 153188 KB Output is correct
135 Correct 78 ms 153164 KB Output is correct
136 Correct 64 ms 153204 KB Output is correct
137 Correct 2 ms 4820 KB Output is correct
138 Correct 3 ms 6356 KB Output is correct
139 Correct 1 ms 3284 KB Output is correct
140 Correct 6 ms 16980 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 27 ms 77468 KB Output is correct
143 Correct 26 ms 77524 KB Output is correct
144 Correct 36 ms 77468 KB Output is correct
145 Correct 44 ms 77444 KB Output is correct
146 Correct 32 ms 77524 KB Output is correct
147 Correct 29 ms 77484 KB Output is correct
148 Correct 1 ms 212 KB Output is correct
149 Correct 81 ms 153232 KB Output is correct
150 Correct 82 ms 153248 KB Output is correct
151 Correct 111 ms 153252 KB Output is correct
152 Correct 102 ms 153224 KB Output is correct
153 Correct 63 ms 153240 KB Output is correct
154 Correct 66 ms 153236 KB Output is correct
155 Correct 17 ms 47232 KB Output is correct
156 Correct 15 ms 47180 KB Output is correct
157 Correct 15 ms 47188 KB Output is correct
158 Correct 15 ms 47188 KB Output is correct
159 Correct 20 ms 47160 KB Output is correct
160 Correct 20 ms 47208 KB Output is correct
161 Correct 19 ms 47188 KB Output is correct
162 Correct 17 ms 47188 KB Output is correct
163 Correct 16 ms 47188 KB Output is correct
164 Correct 26 ms 77476 KB Output is correct
165 Correct 26 ms 77500 KB Output is correct
166 Correct 39 ms 77424 KB Output is correct
167 Correct 34 ms 77456 KB Output is correct
168 Correct 33 ms 77524 KB Output is correct
169 Correct 26 ms 77516 KB Output is correct
170 Correct 16 ms 47176 KB Output is correct
171 Correct 19 ms 47188 KB Output is correct
172 Correct 20 ms 47188 KB Output is correct
173 Correct 19 ms 47184 KB Output is correct
174 Correct 20 ms 47272 KB Output is correct
175 Correct 29 ms 77524 KB Output is correct
176 Correct 28 ms 77524 KB Output is correct
177 Correct 27 ms 77532 KB Output is correct
178 Correct 31 ms 77512 KB Output is correct
179 Correct 78 ms 153220 KB Output is correct
180 Correct 69 ms 153188 KB Output is correct
181 Correct 77 ms 153248 KB Output is correct
182 Correct 85 ms 153124 KB Output is correct
183 Correct 72 ms 153164 KB Output is correct
184 Correct 78 ms 153352 KB Output is correct
185 Correct 107 ms 153248 KB Output is correct
186 Correct 101 ms 153248 KB Output is correct
187 Correct 95 ms 153192 KB Output is correct
188 Correct 87 ms 153176 KB Output is correct
189 Correct 9 ms 16980 KB Output is correct
190 Correct 22 ms 47200 KB Output is correct
191 Correct 17 ms 47152 KB Output is correct
192 Correct 16 ms 47164 KB Output is correct
193 Correct 16 ms 47156 KB Output is correct
194 Correct 16 ms 47184 KB Output is correct
195 Correct 15 ms 47244 KB Output is correct
196 Correct 14 ms 47232 KB Output is correct
197 Correct 21 ms 47188 KB Output is correct
198 Correct 23 ms 47164 KB Output is correct
199 Correct 29 ms 77524 KB Output is correct
200 Correct 27 ms 77452 KB Output is correct
201 Correct 35 ms 77464 KB Output is correct
202 Correct 25 ms 77448 KB Output is correct
203 Correct 26 ms 77524 KB Output is correct
204 Correct 27 ms 77448 KB Output is correct
205 Correct 32 ms 77516 KB Output is correct
206 Correct 35 ms 77448 KB Output is correct
207 Correct 56 ms 153172 KB Output is correct
208 Correct 55 ms 153224 KB Output is correct
209 Correct 76 ms 153200 KB Output is correct
210 Correct 62 ms 153204 KB Output is correct
211 Correct 89 ms 153196 KB Output is correct
212 Correct 97 ms 153192 KB Output is correct
213 Correct 69 ms 153248 KB Output is correct
214 Correct 91 ms 153168 KB Output is correct
215 Correct 1949 ms 456048 KB Output is correct
216 Incorrect 937 ms 456080 KB Output isn't correct
217 Halted 0 ms 0 KB -