Submission #829369

# Submission time Handle Problem Language Result Execution time Memory
829369 2023-08-18T09:54:08 Z QwertyPi Uplifting Excursion (BOI22_vault) C++14
80 / 100
5000 ms 456076 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 * 2;
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 * m + 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 * m + 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 3 ms 9300 KB Output is correct
2 Correct 4 ms 12372 KB Output is correct
3 Correct 3 ms 6320 KB Output is correct
4 Correct 14 ms 33576 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 73 ms 154760 KB Output is correct
7 Correct 61 ms 154660 KB Output is correct
8 Correct 56 ms 154700 KB Output is correct
9 Correct 81 ms 154652 KB Output is correct
10 Correct 65 ms 154740 KB Output is correct
11 Correct 60 ms 154740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9300 KB Output is correct
2 Correct 4 ms 12372 KB Output is correct
3 Correct 3 ms 6320 KB Output is correct
4 Correct 14 ms 33576 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 73 ms 154760 KB Output is correct
7 Correct 61 ms 154660 KB Output is correct
8 Correct 56 ms 154700 KB Output is correct
9 Correct 81 ms 154652 KB Output is correct
10 Correct 65 ms 154740 KB Output is correct
11 Correct 60 ms 154740 KB Output is correct
12 Correct 3 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 2 ms 6332 KB Output is correct
15 Correct 11 ms 33616 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 71 ms 154756 KB Output is correct
18 Correct 65 ms 154728 KB Output is correct
19 Correct 58 ms 154760 KB Output is correct
20 Correct 61 ms 154768 KB Output is correct
21 Correct 59 ms 154704 KB Output is correct
22 Correct 62 ms 154644 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 241 ms 306072 KB Output is correct
25 Correct 181 ms 306116 KB Output is correct
26 Correct 345 ms 306172 KB Output is correct
27 Correct 327 ms 306072 KB Output is correct
28 Correct 120 ms 306144 KB Output is correct
29 Correct 127 ms 306068 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 33584 KB Output is correct
2 Correct 34 ms 94096 KB Output is correct
3 Correct 30 ms 94056 KB Output is correct
4 Correct 29 ms 94104 KB Output is correct
5 Correct 43 ms 94168 KB Output is correct
6 Correct 42 ms 94184 KB Output is correct
7 Correct 36 ms 94144 KB Output is correct
8 Correct 32 ms 94156 KB Output is correct
9 Correct 29 ms 94084 KB Output is correct
10 Correct 40 ms 94068 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 33584 KB Output is correct
2 Correct 34 ms 94096 KB Output is correct
3 Correct 30 ms 94056 KB Output is correct
4 Correct 29 ms 94104 KB Output is correct
5 Correct 43 ms 94168 KB Output is correct
6 Correct 42 ms 94184 KB Output is correct
7 Correct 36 ms 94144 KB Output is correct
8 Correct 32 ms 94156 KB Output is correct
9 Correct 29 ms 94084 KB Output is correct
10 Correct 40 ms 94068 KB Output is correct
11 Correct 4 ms 9300 KB Output is correct
12 Correct 5 ms 12328 KB Output is correct
13 Correct 3 ms 6356 KB Output is correct
14 Correct 12 ms 33620 KB Output is correct
15 Correct 31 ms 94108 KB Output is correct
16 Correct 30 ms 94156 KB Output is correct
17 Correct 30 ms 94092 KB Output is correct
18 Correct 37 ms 94184 KB Output is correct
19 Correct 43 ms 94080 KB Output is correct
20 Correct 34 ms 94156 KB Output is correct
21 Correct 30 ms 94076 KB Output is correct
22 Correct 30 ms 94120 KB Output is correct
23 Correct 29 ms 94104 KB Output is correct
24 Correct 30 ms 94152 KB Output is correct
25 Correct 36 ms 94156 KB Output is correct
26 Correct 45 ms 94184 KB Output is correct
27 Correct 42 ms 94184 KB Output is correct
28 Correct 35 ms 94116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 33584 KB Output is correct
2 Correct 34 ms 94096 KB Output is correct
3 Correct 30 ms 94056 KB Output is correct
4 Correct 29 ms 94104 KB Output is correct
5 Correct 43 ms 94168 KB Output is correct
6 Correct 42 ms 94184 KB Output is correct
7 Correct 36 ms 94144 KB Output is correct
8 Correct 32 ms 94156 KB Output is correct
9 Correct 29 ms 94084 KB Output is correct
10 Correct 40 ms 94068 KB Output is correct
11 Correct 11 ms 33524 KB Output is correct
12 Correct 30 ms 94148 KB Output is correct
13 Correct 29 ms 94100 KB Output is correct
14 Correct 32 ms 94188 KB Output is correct
15 Correct 30 ms 94172 KB Output is correct
16 Correct 31 ms 94168 KB Output is correct
17 Correct 42 ms 94072 KB Output is correct
18 Correct 34 ms 94156 KB Output is correct
19 Correct 38 ms 94072 KB Output is correct
20 Correct 38 ms 94060 KB Output is correct
21 Correct 68 ms 154696 KB Output is correct
22 Correct 59 ms 154680 KB Output is correct
23 Correct 60 ms 154724 KB Output is correct
24 Correct 53 ms 154708 KB Output is correct
25 Correct 54 ms 154724 KB Output is correct
26 Correct 73 ms 154700 KB Output is correct
27 Correct 66 ms 154736 KB Output is correct
28 Correct 59 ms 154684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9300 KB Output is correct
2 Correct 4 ms 12372 KB Output is correct
3 Correct 3 ms 6320 KB Output is correct
4 Correct 14 ms 33576 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 73 ms 154760 KB Output is correct
7 Correct 61 ms 154660 KB Output is correct
8 Correct 56 ms 154700 KB Output is correct
9 Correct 81 ms 154652 KB Output is correct
10 Correct 65 ms 154740 KB Output is correct
11 Correct 60 ms 154740 KB Output is correct
12 Correct 12 ms 33584 KB Output is correct
13 Correct 34 ms 94096 KB Output is correct
14 Correct 30 ms 94056 KB Output is correct
15 Correct 29 ms 94104 KB Output is correct
16 Correct 43 ms 94168 KB Output is correct
17 Correct 42 ms 94184 KB Output is correct
18 Correct 36 ms 94144 KB Output is correct
19 Correct 32 ms 94156 KB Output is correct
20 Correct 29 ms 94084 KB Output is correct
21 Correct 40 ms 94068 KB Output is correct
22 Correct 4 ms 9300 KB Output is correct
23 Correct 5 ms 12328 KB Output is correct
24 Correct 3 ms 6356 KB Output is correct
25 Correct 12 ms 33620 KB Output is correct
26 Correct 31 ms 94108 KB Output is correct
27 Correct 30 ms 94156 KB Output is correct
28 Correct 30 ms 94092 KB Output is correct
29 Correct 37 ms 94184 KB Output is correct
30 Correct 43 ms 94080 KB Output is correct
31 Correct 34 ms 94156 KB Output is correct
32 Correct 30 ms 94076 KB Output is correct
33 Correct 30 ms 94120 KB Output is correct
34 Correct 29 ms 94104 KB Output is correct
35 Correct 30 ms 94152 KB Output is correct
36 Correct 36 ms 94156 KB Output is correct
37 Correct 45 ms 94184 KB Output is correct
38 Correct 42 ms 94184 KB Output is correct
39 Correct 35 ms 94116 KB Output is correct
40 Correct 11 ms 33524 KB Output is correct
41 Correct 30 ms 94148 KB Output is correct
42 Correct 29 ms 94100 KB Output is correct
43 Correct 32 ms 94188 KB Output is correct
44 Correct 30 ms 94172 KB Output is correct
45 Correct 31 ms 94168 KB Output is correct
46 Correct 42 ms 94072 KB Output is correct
47 Correct 34 ms 94156 KB Output is correct
48 Correct 38 ms 94072 KB Output is correct
49 Correct 38 ms 94060 KB Output is correct
50 Correct 68 ms 154696 KB Output is correct
51 Correct 59 ms 154680 KB Output is correct
52 Correct 60 ms 154724 KB Output is correct
53 Correct 53 ms 154708 KB Output is correct
54 Correct 54 ms 154724 KB Output is correct
55 Correct 73 ms 154700 KB Output is correct
56 Correct 66 ms 154736 KB Output is correct
57 Correct 59 ms 154684 KB Output is correct
58 Correct 3 ms 9300 KB Output is correct
59 Correct 5 ms 12372 KB Output is correct
60 Correct 3 ms 6316 KB Output is correct
61 Correct 13 ms 33620 KB Output is correct
62 Correct 1 ms 304 KB Output is correct
63 Correct 76 ms 154736 KB Output is correct
64 Correct 68 ms 154696 KB Output is correct
65 Correct 75 ms 154692 KB Output is correct
66 Correct 77 ms 154692 KB Output is correct
67 Correct 69 ms 154656 KB Output is correct
68 Correct 49 ms 154760 KB Output is correct
69 Correct 29 ms 94144 KB Output is correct
70 Correct 28 ms 94120 KB Output is correct
71 Correct 40 ms 94108 KB Output is correct
72 Correct 37 ms 94080 KB Output is correct
73 Correct 33 ms 94104 KB Output is correct
74 Correct 30 ms 94112 KB Output is correct
75 Correct 38 ms 94148 KB Output is correct
76 Correct 42 ms 94092 KB Output is correct
77 Correct 43 ms 94164 KB Output is correct
78 Correct 46 ms 94148 KB Output is correct
79 Correct 34 ms 94184 KB Output is correct
80 Correct 33 ms 94064 KB Output is correct
81 Correct 44 ms 94164 KB Output is correct
82 Correct 40 ms 94136 KB Output is correct
83 Correct 71 ms 154724 KB Output is correct
84 Correct 59 ms 154700 KB Output is correct
85 Correct 60 ms 154748 KB Output is correct
86 Correct 60 ms 154740 KB Output is correct
87 Correct 65 ms 154752 KB Output is correct
88 Correct 87 ms 154700 KB Output is correct
89 Correct 82 ms 154760 KB Output is correct
90 Correct 72 ms 154744 KB Output is correct
91 Correct 66 ms 154700 KB Output is correct
92 Correct 70 ms 154756 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 33584 KB Output is correct
2 Correct 34 ms 94096 KB Output is correct
3 Correct 30 ms 94056 KB Output is correct
4 Correct 29 ms 94104 KB Output is correct
5 Correct 43 ms 94168 KB Output is correct
6 Correct 42 ms 94184 KB Output is correct
7 Correct 36 ms 94144 KB Output is correct
8 Correct 32 ms 94156 KB Output is correct
9 Correct 29 ms 94084 KB Output is correct
10 Correct 40 ms 94068 KB Output is correct
11 Correct 11 ms 33524 KB Output is correct
12 Correct 30 ms 94148 KB Output is correct
13 Correct 29 ms 94100 KB Output is correct
14 Correct 32 ms 94188 KB Output is correct
15 Correct 30 ms 94172 KB Output is correct
16 Correct 31 ms 94168 KB Output is correct
17 Correct 42 ms 94072 KB Output is correct
18 Correct 34 ms 94156 KB Output is correct
19 Correct 38 ms 94072 KB Output is correct
20 Correct 38 ms 94060 KB Output is correct
21 Correct 68 ms 154696 KB Output is correct
22 Correct 59 ms 154680 KB Output is correct
23 Correct 60 ms 154724 KB Output is correct
24 Correct 53 ms 154708 KB Output is correct
25 Correct 54 ms 154724 KB Output is correct
26 Correct 73 ms 154700 KB Output is correct
27 Correct 66 ms 154736 KB Output is correct
28 Correct 59 ms 154684 KB Output is correct
29 Correct 11 ms 33528 KB Output is correct
30 Correct 30 ms 94140 KB Output is correct
31 Correct 30 ms 94160 KB Output is correct
32 Correct 35 ms 94068 KB Output is correct
33 Correct 53 ms 94120 KB Output is correct
34 Correct 40 ms 94072 KB Output is correct
35 Correct 39 ms 94104 KB Output is correct
36 Correct 31 ms 94180 KB Output is correct
37 Correct 30 ms 94156 KB Output is correct
38 Correct 37 ms 94172 KB Output is correct
39 Correct 56 ms 154676 KB Output is correct
40 Correct 57 ms 154700 KB Output is correct
41 Correct 61 ms 154724 KB Output is correct
42 Correct 59 ms 154648 KB Output is correct
43 Correct 55 ms 154740 KB Output is correct
44 Correct 63 ms 154660 KB Output is correct
45 Correct 60 ms 154720 KB Output is correct
46 Correct 58 ms 154792 KB Output is correct
47 Correct 114 ms 306124 KB Output is correct
48 Correct 107 ms 306072 KB Output is correct
49 Correct 287 ms 306112 KB Output is correct
50 Correct 155 ms 306072 KB Output is correct
51 Correct 316 ms 306064 KB Output is correct
52 Correct 349 ms 306092 KB Output is correct
53 Correct 288 ms 306064 KB Output is correct
54 Correct 262 ms 306108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9300 KB Output is correct
2 Correct 4 ms 12372 KB Output is correct
3 Correct 3 ms 6320 KB Output is correct
4 Correct 14 ms 33576 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 73 ms 154760 KB Output is correct
7 Correct 61 ms 154660 KB Output is correct
8 Correct 56 ms 154700 KB Output is correct
9 Correct 81 ms 154652 KB Output is correct
10 Correct 65 ms 154740 KB Output is correct
11 Correct 60 ms 154740 KB Output is correct
12 Correct 3 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 2 ms 6332 KB Output is correct
15 Correct 11 ms 33616 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 71 ms 154756 KB Output is correct
18 Correct 65 ms 154728 KB Output is correct
19 Correct 58 ms 154760 KB Output is correct
20 Correct 61 ms 154768 KB Output is correct
21 Correct 59 ms 154704 KB Output is correct
22 Correct 62 ms 154644 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 241 ms 306072 KB Output is correct
25 Correct 181 ms 306116 KB Output is correct
26 Correct 345 ms 306172 KB Output is correct
27 Correct 327 ms 306072 KB Output is correct
28 Correct 120 ms 306144 KB Output is correct
29 Correct 127 ms 306068 KB Output is correct
30 Correct 12 ms 33584 KB Output is correct
31 Correct 34 ms 94096 KB Output is correct
32 Correct 30 ms 94056 KB Output is correct
33 Correct 29 ms 94104 KB Output is correct
34 Correct 43 ms 94168 KB Output is correct
35 Correct 42 ms 94184 KB Output is correct
36 Correct 36 ms 94144 KB Output is correct
37 Correct 32 ms 94156 KB Output is correct
38 Correct 29 ms 94084 KB Output is correct
39 Correct 40 ms 94068 KB Output is correct
40 Correct 4 ms 9300 KB Output is correct
41 Correct 5 ms 12328 KB Output is correct
42 Correct 3 ms 6356 KB Output is correct
43 Correct 12 ms 33620 KB Output is correct
44 Correct 31 ms 94108 KB Output is correct
45 Correct 30 ms 94156 KB Output is correct
46 Correct 30 ms 94092 KB Output is correct
47 Correct 37 ms 94184 KB Output is correct
48 Correct 43 ms 94080 KB Output is correct
49 Correct 34 ms 94156 KB Output is correct
50 Correct 30 ms 94076 KB Output is correct
51 Correct 30 ms 94120 KB Output is correct
52 Correct 29 ms 94104 KB Output is correct
53 Correct 30 ms 94152 KB Output is correct
54 Correct 36 ms 94156 KB Output is correct
55 Correct 45 ms 94184 KB Output is correct
56 Correct 42 ms 94184 KB Output is correct
57 Correct 35 ms 94116 KB Output is correct
58 Correct 11 ms 33524 KB Output is correct
59 Correct 30 ms 94148 KB Output is correct
60 Correct 29 ms 94100 KB Output is correct
61 Correct 32 ms 94188 KB Output is correct
62 Correct 30 ms 94172 KB Output is correct
63 Correct 31 ms 94168 KB Output is correct
64 Correct 42 ms 94072 KB Output is correct
65 Correct 34 ms 94156 KB Output is correct
66 Correct 38 ms 94072 KB Output is correct
67 Correct 38 ms 94060 KB Output is correct
68 Correct 68 ms 154696 KB Output is correct
69 Correct 59 ms 154680 KB Output is correct
70 Correct 60 ms 154724 KB Output is correct
71 Correct 53 ms 154708 KB Output is correct
72 Correct 54 ms 154724 KB Output is correct
73 Correct 73 ms 154700 KB Output is correct
74 Correct 66 ms 154736 KB Output is correct
75 Correct 59 ms 154684 KB Output is correct
76 Correct 3 ms 9300 KB Output is correct
77 Correct 5 ms 12372 KB Output is correct
78 Correct 3 ms 6316 KB Output is correct
79 Correct 13 ms 33620 KB Output is correct
80 Correct 1 ms 304 KB Output is correct
81 Correct 76 ms 154736 KB Output is correct
82 Correct 68 ms 154696 KB Output is correct
83 Correct 75 ms 154692 KB Output is correct
84 Correct 77 ms 154692 KB Output is correct
85 Correct 69 ms 154656 KB Output is correct
86 Correct 49 ms 154760 KB Output is correct
87 Correct 29 ms 94144 KB Output is correct
88 Correct 28 ms 94120 KB Output is correct
89 Correct 40 ms 94108 KB Output is correct
90 Correct 37 ms 94080 KB Output is correct
91 Correct 33 ms 94104 KB Output is correct
92 Correct 30 ms 94112 KB Output is correct
93 Correct 38 ms 94148 KB Output is correct
94 Correct 42 ms 94092 KB Output is correct
95 Correct 43 ms 94164 KB Output is correct
96 Correct 46 ms 94148 KB Output is correct
97 Correct 34 ms 94184 KB Output is correct
98 Correct 33 ms 94064 KB Output is correct
99 Correct 44 ms 94164 KB Output is correct
100 Correct 40 ms 94136 KB Output is correct
101 Correct 71 ms 154724 KB Output is correct
102 Correct 59 ms 154700 KB Output is correct
103 Correct 60 ms 154748 KB Output is correct
104 Correct 60 ms 154740 KB Output is correct
105 Correct 65 ms 154752 KB Output is correct
106 Correct 87 ms 154700 KB Output is correct
107 Correct 82 ms 154760 KB Output is correct
108 Correct 72 ms 154744 KB Output is correct
109 Correct 66 ms 154700 KB Output is correct
110 Correct 70 ms 154756 KB Output is correct
111 Correct 11 ms 33528 KB Output is correct
112 Correct 30 ms 94140 KB Output is correct
113 Correct 30 ms 94160 KB Output is correct
114 Correct 35 ms 94068 KB Output is correct
115 Correct 53 ms 94120 KB Output is correct
116 Correct 40 ms 94072 KB Output is correct
117 Correct 39 ms 94104 KB Output is correct
118 Correct 31 ms 94180 KB Output is correct
119 Correct 30 ms 94156 KB Output is correct
120 Correct 37 ms 94172 KB Output is correct
121 Correct 56 ms 154676 KB Output is correct
122 Correct 57 ms 154700 KB Output is correct
123 Correct 61 ms 154724 KB Output is correct
124 Correct 59 ms 154648 KB Output is correct
125 Correct 55 ms 154740 KB Output is correct
126 Correct 63 ms 154660 KB Output is correct
127 Correct 60 ms 154720 KB Output is correct
128 Correct 58 ms 154792 KB Output is correct
129 Correct 114 ms 306124 KB Output is correct
130 Correct 107 ms 306072 KB Output is correct
131 Correct 287 ms 306112 KB Output is correct
132 Correct 155 ms 306072 KB Output is correct
133 Correct 316 ms 306064 KB Output is correct
134 Correct 349 ms 306092 KB Output is correct
135 Correct 288 ms 306064 KB Output is correct
136 Correct 262 ms 306108 KB Output is correct
137 Correct 4 ms 9300 KB Output is correct
138 Correct 5 ms 12372 KB Output is correct
139 Correct 2 ms 6356 KB Output is correct
140 Correct 13 ms 33568 KB Output is correct
141 Correct 1 ms 308 KB Output is correct
142 Correct 66 ms 154760 KB Output is correct
143 Correct 61 ms 154700 KB Output is correct
144 Correct 63 ms 154652 KB Output is correct
145 Correct 70 ms 154728 KB Output is correct
146 Correct 58 ms 154632 KB Output is correct
147 Correct 59 ms 154684 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 232 ms 306176 KB Output is correct
150 Correct 157 ms 306088 KB Output is correct
151 Correct 330 ms 306108 KB Output is correct
152 Correct 326 ms 306204 KB Output is correct
153 Correct 118 ms 306112 KB Output is correct
154 Correct 119 ms 306072 KB Output is correct
155 Correct 39 ms 94188 KB Output is correct
156 Correct 40 ms 94336 KB Output is correct
157 Correct 37 ms 94128 KB Output is correct
158 Correct 38 ms 94148 KB Output is correct
159 Correct 38 ms 94092 KB Output is correct
160 Correct 36 ms 94112 KB Output is correct
161 Correct 37 ms 94156 KB Output is correct
162 Correct 37 ms 94108 KB Output is correct
163 Correct 38 ms 94164 KB Output is correct
164 Correct 64 ms 154708 KB Output is correct
165 Correct 60 ms 154676 KB Output is correct
166 Correct 65 ms 154712 KB Output is correct
167 Correct 68 ms 154684 KB Output is correct
168 Correct 69 ms 154716 KB Output is correct
169 Correct 65 ms 154680 KB Output is correct
170 Correct 39 ms 94096 KB Output is correct
171 Correct 37 ms 94284 KB Output is correct
172 Correct 39 ms 94108 KB Output is correct
173 Correct 38 ms 94176 KB Output is correct
174 Correct 39 ms 94140 KB Output is correct
175 Correct 72 ms 154688 KB Output is correct
176 Correct 78 ms 154680 KB Output is correct
177 Correct 74 ms 154696 KB Output is correct
178 Correct 77 ms 154700 KB Output is correct
179 Correct 276 ms 306148 KB Output is correct
180 Correct 160 ms 306172 KB Output is correct
181 Correct 293 ms 306076 KB Output is correct
182 Correct 301 ms 306172 KB Output is correct
183 Correct 282 ms 306080 KB Output is correct
184 Correct 262 ms 306076 KB Output is correct
185 Correct 383 ms 306176 KB Output is correct
186 Correct 480 ms 306172 KB Output is correct
187 Correct 391 ms 306180 KB Output is correct
188 Correct 388 ms 306060 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 33584 KB Output is correct
2 Correct 34 ms 94096 KB Output is correct
3 Correct 30 ms 94056 KB Output is correct
4 Correct 29 ms 94104 KB Output is correct
5 Correct 43 ms 94168 KB Output is correct
6 Correct 42 ms 94184 KB Output is correct
7 Correct 36 ms 94144 KB Output is correct
8 Correct 32 ms 94156 KB Output is correct
9 Correct 29 ms 94084 KB Output is correct
10 Correct 40 ms 94068 KB Output is correct
11 Correct 11 ms 33524 KB Output is correct
12 Correct 30 ms 94148 KB Output is correct
13 Correct 29 ms 94100 KB Output is correct
14 Correct 32 ms 94188 KB Output is correct
15 Correct 30 ms 94172 KB Output is correct
16 Correct 31 ms 94168 KB Output is correct
17 Correct 42 ms 94072 KB Output is correct
18 Correct 34 ms 94156 KB Output is correct
19 Correct 38 ms 94072 KB Output is correct
20 Correct 38 ms 94060 KB Output is correct
21 Correct 68 ms 154696 KB Output is correct
22 Correct 59 ms 154680 KB Output is correct
23 Correct 60 ms 154724 KB Output is correct
24 Correct 53 ms 154708 KB Output is correct
25 Correct 54 ms 154724 KB Output is correct
26 Correct 73 ms 154700 KB Output is correct
27 Correct 66 ms 154736 KB Output is correct
28 Correct 59 ms 154684 KB Output is correct
29 Correct 11 ms 33528 KB Output is correct
30 Correct 30 ms 94140 KB Output is correct
31 Correct 30 ms 94160 KB Output is correct
32 Correct 35 ms 94068 KB Output is correct
33 Correct 53 ms 94120 KB Output is correct
34 Correct 40 ms 94072 KB Output is correct
35 Correct 39 ms 94104 KB Output is correct
36 Correct 31 ms 94180 KB Output is correct
37 Correct 30 ms 94156 KB Output is correct
38 Correct 37 ms 94172 KB Output is correct
39 Correct 56 ms 154676 KB Output is correct
40 Correct 57 ms 154700 KB Output is correct
41 Correct 61 ms 154724 KB Output is correct
42 Correct 59 ms 154648 KB Output is correct
43 Correct 55 ms 154740 KB Output is correct
44 Correct 63 ms 154660 KB Output is correct
45 Correct 60 ms 154720 KB Output is correct
46 Correct 58 ms 154792 KB Output is correct
47 Correct 114 ms 306124 KB Output is correct
48 Correct 107 ms 306072 KB Output is correct
49 Correct 287 ms 306112 KB Output is correct
50 Correct 155 ms 306072 KB Output is correct
51 Correct 316 ms 306064 KB Output is correct
52 Correct 349 ms 306092 KB Output is correct
53 Correct 288 ms 306064 KB Output is correct
54 Correct 262 ms 306108 KB Output is correct
55 Correct 20 ms 33624 KB Output is correct
56 Correct 37 ms 94116 KB Output is correct
57 Correct 36 ms 94172 KB Output is correct
58 Correct 38 ms 94160 KB Output is correct
59 Correct 37 ms 94084 KB Output is correct
60 Correct 36 ms 94132 KB Output is correct
61 Correct 35 ms 94160 KB Output is correct
62 Correct 34 ms 94056 KB Output is correct
63 Correct 35 ms 94160 KB Output is correct
64 Correct 35 ms 94140 KB Output is correct
65 Correct 56 ms 154720 KB Output is correct
66 Correct 56 ms 154716 KB Output is correct
67 Correct 65 ms 154700 KB Output is correct
68 Correct 63 ms 154664 KB Output is correct
69 Correct 69 ms 154724 KB Output is correct
70 Correct 74 ms 154872 KB Output is correct
71 Correct 68 ms 154720 KB Output is correct
72 Correct 64 ms 154708 KB Output is correct
73 Correct 118 ms 306068 KB Output is correct
74 Correct 125 ms 306100 KB Output is correct
75 Correct 272 ms 306116 KB Output is correct
76 Correct 154 ms 306076 KB Output is correct
77 Correct 288 ms 306180 KB Output is correct
78 Correct 304 ms 306108 KB Output is correct
79 Correct 278 ms 306108 KB Output is correct
80 Correct 250 ms 306068 KB Output is correct
81 Execution timed out 5087 ms 456076 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 9300 KB Output is correct
2 Correct 4 ms 12372 KB Output is correct
3 Correct 3 ms 6320 KB Output is correct
4 Correct 14 ms 33576 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 73 ms 154760 KB Output is correct
7 Correct 61 ms 154660 KB Output is correct
8 Correct 56 ms 154700 KB Output is correct
9 Correct 81 ms 154652 KB Output is correct
10 Correct 65 ms 154740 KB Output is correct
11 Correct 60 ms 154740 KB Output is correct
12 Correct 3 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 2 ms 6332 KB Output is correct
15 Correct 11 ms 33616 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 71 ms 154756 KB Output is correct
18 Correct 65 ms 154728 KB Output is correct
19 Correct 58 ms 154760 KB Output is correct
20 Correct 61 ms 154768 KB Output is correct
21 Correct 59 ms 154704 KB Output is correct
22 Correct 62 ms 154644 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 241 ms 306072 KB Output is correct
25 Correct 181 ms 306116 KB Output is correct
26 Correct 345 ms 306172 KB Output is correct
27 Correct 327 ms 306072 KB Output is correct
28 Correct 120 ms 306144 KB Output is correct
29 Correct 127 ms 306068 KB Output is correct
30 Correct 12 ms 33584 KB Output is correct
31 Correct 34 ms 94096 KB Output is correct
32 Correct 30 ms 94056 KB Output is correct
33 Correct 29 ms 94104 KB Output is correct
34 Correct 43 ms 94168 KB Output is correct
35 Correct 42 ms 94184 KB Output is correct
36 Correct 36 ms 94144 KB Output is correct
37 Correct 32 ms 94156 KB Output is correct
38 Correct 29 ms 94084 KB Output is correct
39 Correct 40 ms 94068 KB Output is correct
40 Correct 4 ms 9300 KB Output is correct
41 Correct 5 ms 12328 KB Output is correct
42 Correct 3 ms 6356 KB Output is correct
43 Correct 12 ms 33620 KB Output is correct
44 Correct 31 ms 94108 KB Output is correct
45 Correct 30 ms 94156 KB Output is correct
46 Correct 30 ms 94092 KB Output is correct
47 Correct 37 ms 94184 KB Output is correct
48 Correct 43 ms 94080 KB Output is correct
49 Correct 34 ms 94156 KB Output is correct
50 Correct 30 ms 94076 KB Output is correct
51 Correct 30 ms 94120 KB Output is correct
52 Correct 29 ms 94104 KB Output is correct
53 Correct 30 ms 94152 KB Output is correct
54 Correct 36 ms 94156 KB Output is correct
55 Correct 45 ms 94184 KB Output is correct
56 Correct 42 ms 94184 KB Output is correct
57 Correct 35 ms 94116 KB Output is correct
58 Correct 11 ms 33524 KB Output is correct
59 Correct 30 ms 94148 KB Output is correct
60 Correct 29 ms 94100 KB Output is correct
61 Correct 32 ms 94188 KB Output is correct
62 Correct 30 ms 94172 KB Output is correct
63 Correct 31 ms 94168 KB Output is correct
64 Correct 42 ms 94072 KB Output is correct
65 Correct 34 ms 94156 KB Output is correct
66 Correct 38 ms 94072 KB Output is correct
67 Correct 38 ms 94060 KB Output is correct
68 Correct 68 ms 154696 KB Output is correct
69 Correct 59 ms 154680 KB Output is correct
70 Correct 60 ms 154724 KB Output is correct
71 Correct 53 ms 154708 KB Output is correct
72 Correct 54 ms 154724 KB Output is correct
73 Correct 73 ms 154700 KB Output is correct
74 Correct 66 ms 154736 KB Output is correct
75 Correct 59 ms 154684 KB Output is correct
76 Correct 3 ms 9300 KB Output is correct
77 Correct 5 ms 12372 KB Output is correct
78 Correct 3 ms 6316 KB Output is correct
79 Correct 13 ms 33620 KB Output is correct
80 Correct 1 ms 304 KB Output is correct
81 Correct 76 ms 154736 KB Output is correct
82 Correct 68 ms 154696 KB Output is correct
83 Correct 75 ms 154692 KB Output is correct
84 Correct 77 ms 154692 KB Output is correct
85 Correct 69 ms 154656 KB Output is correct
86 Correct 49 ms 154760 KB Output is correct
87 Correct 29 ms 94144 KB Output is correct
88 Correct 28 ms 94120 KB Output is correct
89 Correct 40 ms 94108 KB Output is correct
90 Correct 37 ms 94080 KB Output is correct
91 Correct 33 ms 94104 KB Output is correct
92 Correct 30 ms 94112 KB Output is correct
93 Correct 38 ms 94148 KB Output is correct
94 Correct 42 ms 94092 KB Output is correct
95 Correct 43 ms 94164 KB Output is correct
96 Correct 46 ms 94148 KB Output is correct
97 Correct 34 ms 94184 KB Output is correct
98 Correct 33 ms 94064 KB Output is correct
99 Correct 44 ms 94164 KB Output is correct
100 Correct 40 ms 94136 KB Output is correct
101 Correct 71 ms 154724 KB Output is correct
102 Correct 59 ms 154700 KB Output is correct
103 Correct 60 ms 154748 KB Output is correct
104 Correct 60 ms 154740 KB Output is correct
105 Correct 65 ms 154752 KB Output is correct
106 Correct 87 ms 154700 KB Output is correct
107 Correct 82 ms 154760 KB Output is correct
108 Correct 72 ms 154744 KB Output is correct
109 Correct 66 ms 154700 KB Output is correct
110 Correct 70 ms 154756 KB Output is correct
111 Correct 11 ms 33528 KB Output is correct
112 Correct 30 ms 94140 KB Output is correct
113 Correct 30 ms 94160 KB Output is correct
114 Correct 35 ms 94068 KB Output is correct
115 Correct 53 ms 94120 KB Output is correct
116 Correct 40 ms 94072 KB Output is correct
117 Correct 39 ms 94104 KB Output is correct
118 Correct 31 ms 94180 KB Output is correct
119 Correct 30 ms 94156 KB Output is correct
120 Correct 37 ms 94172 KB Output is correct
121 Correct 56 ms 154676 KB Output is correct
122 Correct 57 ms 154700 KB Output is correct
123 Correct 61 ms 154724 KB Output is correct
124 Correct 59 ms 154648 KB Output is correct
125 Correct 55 ms 154740 KB Output is correct
126 Correct 63 ms 154660 KB Output is correct
127 Correct 60 ms 154720 KB Output is correct
128 Correct 58 ms 154792 KB Output is correct
129 Correct 114 ms 306124 KB Output is correct
130 Correct 107 ms 306072 KB Output is correct
131 Correct 287 ms 306112 KB Output is correct
132 Correct 155 ms 306072 KB Output is correct
133 Correct 316 ms 306064 KB Output is correct
134 Correct 349 ms 306092 KB Output is correct
135 Correct 288 ms 306064 KB Output is correct
136 Correct 262 ms 306108 KB Output is correct
137 Correct 4 ms 9300 KB Output is correct
138 Correct 5 ms 12372 KB Output is correct
139 Correct 2 ms 6356 KB Output is correct
140 Correct 13 ms 33568 KB Output is correct
141 Correct 1 ms 308 KB Output is correct
142 Correct 66 ms 154760 KB Output is correct
143 Correct 61 ms 154700 KB Output is correct
144 Correct 63 ms 154652 KB Output is correct
145 Correct 70 ms 154728 KB Output is correct
146 Correct 58 ms 154632 KB Output is correct
147 Correct 59 ms 154684 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 232 ms 306176 KB Output is correct
150 Correct 157 ms 306088 KB Output is correct
151 Correct 330 ms 306108 KB Output is correct
152 Correct 326 ms 306204 KB Output is correct
153 Correct 118 ms 306112 KB Output is correct
154 Correct 119 ms 306072 KB Output is correct
155 Correct 39 ms 94188 KB Output is correct
156 Correct 40 ms 94336 KB Output is correct
157 Correct 37 ms 94128 KB Output is correct
158 Correct 38 ms 94148 KB Output is correct
159 Correct 38 ms 94092 KB Output is correct
160 Correct 36 ms 94112 KB Output is correct
161 Correct 37 ms 94156 KB Output is correct
162 Correct 37 ms 94108 KB Output is correct
163 Correct 38 ms 94164 KB Output is correct
164 Correct 64 ms 154708 KB Output is correct
165 Correct 60 ms 154676 KB Output is correct
166 Correct 65 ms 154712 KB Output is correct
167 Correct 68 ms 154684 KB Output is correct
168 Correct 69 ms 154716 KB Output is correct
169 Correct 65 ms 154680 KB Output is correct
170 Correct 39 ms 94096 KB Output is correct
171 Correct 37 ms 94284 KB Output is correct
172 Correct 39 ms 94108 KB Output is correct
173 Correct 38 ms 94176 KB Output is correct
174 Correct 39 ms 94140 KB Output is correct
175 Correct 72 ms 154688 KB Output is correct
176 Correct 78 ms 154680 KB Output is correct
177 Correct 74 ms 154696 KB Output is correct
178 Correct 77 ms 154700 KB Output is correct
179 Correct 276 ms 306148 KB Output is correct
180 Correct 160 ms 306172 KB Output is correct
181 Correct 293 ms 306076 KB Output is correct
182 Correct 301 ms 306172 KB Output is correct
183 Correct 282 ms 306080 KB Output is correct
184 Correct 262 ms 306076 KB Output is correct
185 Correct 383 ms 306176 KB Output is correct
186 Correct 480 ms 306172 KB Output is correct
187 Correct 391 ms 306180 KB Output is correct
188 Correct 388 ms 306060 KB Output is correct
189 Correct 20 ms 33624 KB Output is correct
190 Correct 37 ms 94116 KB Output is correct
191 Correct 36 ms 94172 KB Output is correct
192 Correct 38 ms 94160 KB Output is correct
193 Correct 37 ms 94084 KB Output is correct
194 Correct 36 ms 94132 KB Output is correct
195 Correct 35 ms 94160 KB Output is correct
196 Correct 34 ms 94056 KB Output is correct
197 Correct 35 ms 94160 KB Output is correct
198 Correct 35 ms 94140 KB Output is correct
199 Correct 56 ms 154720 KB Output is correct
200 Correct 56 ms 154716 KB Output is correct
201 Correct 65 ms 154700 KB Output is correct
202 Correct 63 ms 154664 KB Output is correct
203 Correct 69 ms 154724 KB Output is correct
204 Correct 74 ms 154872 KB Output is correct
205 Correct 68 ms 154720 KB Output is correct
206 Correct 64 ms 154708 KB Output is correct
207 Correct 118 ms 306068 KB Output is correct
208 Correct 125 ms 306100 KB Output is correct
209 Correct 272 ms 306116 KB Output is correct
210 Correct 154 ms 306076 KB Output is correct
211 Correct 288 ms 306180 KB Output is correct
212 Correct 304 ms 306108 KB Output is correct
213 Correct 278 ms 306108 KB Output is correct
214 Correct 250 ms 306068 KB Output is correct
215 Execution timed out 5087 ms 456076 KB Time limit exceeded
216 Halted 0 ms 0 KB -