#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if (b == 0) return a;
return gcd(b, a % b);
}
vector<long long> SolveDP(long long N, long long LIM, vector<long long> List, vector<long long> Init) {
vector<long long> dp(LIM + 1, -(1LL << 60));
if (Init.size() == 0) dp[0] = 0;
else {
for (int i = 0; i < (int)Init.size(); i++) dp[i] = Init[i];
}
// DP Start
for (int i = 0; i < N; i++) {
vector<long long> ndp(LIM + 1, -(1LL << 60));
long long kazu = i + 1;
for (int j = 0; j < kazu; j++) {
vector<pair<long long, long long>> maxi;
int cur = 0;
for (int k = j; k <= LIM; k += kazu) {
long long val = dp[k] - (k / kazu);
while (maxi.size() >= cur + 1) {
if (maxi[maxi.size() - 1].second <= val) maxi.pop_back();
else break;
}
maxi.push_back(make_pair(1LL * k, val));
if (maxi[cur].second >= -(1LL << 59)) ndp[k] = maxi[cur].second + (k / kazu);
while (cur < (int)maxi.size() && maxi[cur].first <= k - 1LL * kazu * List[i]) cur += 1;
}
}
dp = ndp;
}
// Return
return dp;
}
void Solve_Subtask2(long long M, long long L, vector<long long> A) {
// Step 1. Calculate
vector<long long> A1;
vector<long long> A2;
for (int i = M - 1; i >= 0; i--) A1.push_back(A[i]);
for (int i = M + 1; i <= 2 * M; i++) A2.push_back(A[i]);
vector<long long> DP1 = SolveDP(M, 700000, A1, vector<long long>{});
vector<long long> DP2 = SolveDP(M, 700000, A2, vector<long long>{});
// Step 2. Output
long long Answer = -(1LL << 60);
for (long long i = 0; i <= 700000LL - abs(L); i++) {
long long idx1 = i;
long long idx2 = i + abs(L); if (L < 0) swap(idx1, idx2);
Answer = max(Answer, DP1[idx1] + DP2[idx2]);
}
if (Answer < 0LL) cout << "impossible" << endl;
else cout << Answer + A[M] << endl;
}
void Solve_Subtask3(long long M, long long L, vector<long long> A) {
long long Baseln = M * M * M;
long long Border = M * M;
vector<long long> L1(M + 1, 0);
vector<long long> L2(M + 1, 0);
vector<long long> L3(M, 0);
vector<long long> L4(M, 0);
vector<long long> M1(M + 1, 0);
vector<long long> M2(M + 1, 0);
vector<pair<long long, long long>> Cand1; Cand1.push_back(make_pair(0, 0));
vector<pair<long long, long long>> Cand2; Cand2.push_back(make_pair(0, 0));
// Step 1. Set Up
for (int i = 0; i <= M - 1; i++) {
int idx = M - i;
long long Threshold = Border / idx;
L1[idx - 0] = A[i] - min(A[i], Threshold);
L3[idx - 1] = min(A[i], Threshold);
}
for (int i = M + 1; i <= 2 * M; i++) {
int idx = i - M;
long long Threshold = Border / idx;
L2[idx - 0] = A[i] - min(A[i], Threshold);
L4[idx - 1] = min(A[i], Threshold);
}
// Step 2. Base DP
vector<long long> dp1 = SolveDP(M, Baseln, L3, vector<long long>{});
vector<long long> dp2 = vector<long long>(Baseln + 1, -(1LL << 60));
for (int i = 0; i <= Baseln; i++) dp2[Baseln - i] = dp1[i];
vector<long long> dp3 = SolveDP(M, Baseln * 2, L4, dp2);
// Step 3. Get Theoritical Value
long long a1 = 0;
long long a2 = 0;
for (int i = 1; i <= M; i++) a1 += 1LL * i * L1[i];
for (int i = 1; i <= M; i++) a2 += 1LL * i * L2[i];
if (a2 - a1 > L) a2 = a1 + L;
else a1 = a2 - L;
if (a1 + Baseln < 0 || a2 + Baseln < 0) {
cout << "impossible" << endl;
return;
}
// Step 5. Get Candidates for L2
long long rem2 = a2 + Baseln;
long long cnt2 = 0;
for (int i = 1; i <= M; i++) {
M2[i] = min(L2[i], rem2 / i);
rem2 -= 1LL * i * M2[i];
cnt2 += M2[i];
}
for (int i = M; i >= 1; i--) {
for (long long j = 0; j < M2[i]; j++) {
rem2 += 1LL * i;
cnt2 -= 1LL;
if (rem2 > 2LL * Baseln) break;
Cand2.push_back(make_pair((a2 + Baseln) - rem2, cnt2));
}
if (rem2 > 2LL * Baseln) break;
}
// cout << "L1 = "; for (int i = 1; i <= M; i++) cout << L1[i] << " "; cout << endl;
// cout << "L2 = "; for (int i = 1; i <= M; i++) cout << L2[i] << " "; cout << endl;
// cout << "Cand1 = "; for (int i = 0; i < Cand1.size(); i++) cout << "(" << Cand1[i].first << "," << Cand1[i].second << ") "; cout << endl;
// cout << "Cand2 = "; for (int i = 0; i < Cand2.size(); i++) cout << "(" << Cand2[i].first << "," << Cand2[i].second << ") "; cout << endl;
// Step 6. Brute Force
long long Answer = -(1LL << 60);
for (pair<long long, long long> v1 : Cand1) {
for (pair<long long, long long> v2 : Cand2) {
long long diff = L - (v2.first - v1.first);
if (diff < -Baseln || diff > Baseln) continue;
if (dp3[diff + Baseln] == -(1LL << 60)) continue;
Answer = max(Answer, v1.second + v2.second + dp3[diff + Baseln]);
}
}
// Step 7. Output
if (Answer == -(1LL << 60)) cout << "impossible" << endl;
else cout << Answer + A[M] << endl;
}
int main() {
// Input
long long M, L;
cin >> M >> L;
vector<long long> A(2 * M + 1, 0);
for (int i = 0; i <= 2 * M; i++) cin >> A[i];
// Judge if Subtask 2
bool Subtask2 = true;
if (M > 100) Subtask2 = false;
for (int i = 0; i <= 2 * M; i++) {
if (A[i] > 100) Subtask2 = false;
}
// Execution
if (Subtask2 == true) Solve_Subtask2(M, L, A);
else Solve_Subtask3(M, L, A);
return 0;
}
Compilation message
vault.cpp: In function 'std::vector<long long int> SolveDP(long long int, long long int, std::vector<long long int>, std::vector<long long int>)':
vault.cpp:25:36: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
25 | while (maxi.size() >= cur + 1) {
| ~~~~~~~~~~~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
45344 KB |
Output is correct |
2 |
Correct |
71 ms |
45252 KB |
Output is correct |
3 |
Correct |
30 ms |
47508 KB |
Output is correct |
4 |
Correct |
189 ms |
45812 KB |
Output is correct |
5 |
Correct |
818 ms |
45512 KB |
Output is correct |
6 |
Correct |
824 ms |
45364 KB |
Output is correct |
7 |
Correct |
859 ms |
45904 KB |
Output is correct |
8 |
Correct |
830 ms |
45744 KB |
Output is correct |
9 |
Correct |
835 ms |
44948 KB |
Output is correct |
10 |
Correct |
889 ms |
45616 KB |
Output is correct |
11 |
Correct |
931 ms |
44400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
45344 KB |
Output is correct |
2 |
Correct |
71 ms |
45252 KB |
Output is correct |
3 |
Correct |
30 ms |
47508 KB |
Output is correct |
4 |
Correct |
189 ms |
45812 KB |
Output is correct |
5 |
Correct |
818 ms |
45512 KB |
Output is correct |
6 |
Correct |
824 ms |
45364 KB |
Output is correct |
7 |
Correct |
859 ms |
45904 KB |
Output is correct |
8 |
Correct |
830 ms |
45744 KB |
Output is correct |
9 |
Correct |
835 ms |
44948 KB |
Output is correct |
10 |
Correct |
889 ms |
45616 KB |
Output is correct |
11 |
Correct |
931 ms |
44400 KB |
Output is correct |
12 |
Correct |
53 ms |
45672 KB |
Output is correct |
13 |
Correct |
70 ms |
45724 KB |
Output is correct |
14 |
Correct |
32 ms |
45076 KB |
Output is correct |
15 |
Correct |
188 ms |
45232 KB |
Output is correct |
16 |
Correct |
811 ms |
45384 KB |
Output is correct |
17 |
Correct |
798 ms |
44592 KB |
Output is correct |
18 |
Correct |
863 ms |
44396 KB |
Output is correct |
19 |
Correct |
829 ms |
45984 KB |
Output is correct |
20 |
Correct |
803 ms |
44224 KB |
Output is correct |
21 |
Correct |
923 ms |
45196 KB |
Output is correct |
22 |
Correct |
881 ms |
45480 KB |
Output is correct |
23 |
Correct |
1610 ms |
45228 KB |
Output is correct |
24 |
Correct |
1649 ms |
44448 KB |
Output is correct |
25 |
Correct |
1686 ms |
45184 KB |
Output is correct |
26 |
Correct |
1615 ms |
45064 KB |
Output is correct |
27 |
Correct |
1617 ms |
44452 KB |
Output is correct |
28 |
Correct |
1771 ms |
45428 KB |
Output is correct |
29 |
Correct |
1800 ms |
45488 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
46100 KB |
Output is correct |
2 |
Correct |
29 ms |
3416 KB |
Output is correct |
3 |
Correct |
31 ms |
3416 KB |
Output is correct |
4 |
Correct |
29 ms |
3384 KB |
Output is correct |
5 |
Correct |
29 ms |
3416 KB |
Output is correct |
6 |
Correct |
30 ms |
3412 KB |
Output is correct |
7 |
Correct |
31 ms |
3416 KB |
Output is correct |
8 |
Correct |
31 ms |
3388 KB |
Output is correct |
9 |
Correct |
30 ms |
3416 KB |
Output is correct |
10 |
Correct |
30 ms |
3388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
46100 KB |
Output is correct |
2 |
Correct |
29 ms |
3416 KB |
Output is correct |
3 |
Correct |
31 ms |
3416 KB |
Output is correct |
4 |
Correct |
29 ms |
3384 KB |
Output is correct |
5 |
Correct |
29 ms |
3416 KB |
Output is correct |
6 |
Correct |
30 ms |
3412 KB |
Output is correct |
7 |
Correct |
31 ms |
3416 KB |
Output is correct |
8 |
Correct |
31 ms |
3388 KB |
Output is correct |
9 |
Correct |
30 ms |
3416 KB |
Output is correct |
10 |
Correct |
30 ms |
3388 KB |
Output is correct |
11 |
Correct |
53 ms |
45472 KB |
Output is correct |
12 |
Correct |
72 ms |
44712 KB |
Output is correct |
13 |
Correct |
32 ms |
46412 KB |
Output is correct |
14 |
Correct |
193 ms |
46176 KB |
Output is correct |
15 |
Correct |
29 ms |
3412 KB |
Output is correct |
16 |
Correct |
31 ms |
3416 KB |
Output is correct |
17 |
Correct |
30 ms |
3412 KB |
Output is correct |
18 |
Correct |
29 ms |
3416 KB |
Output is correct |
19 |
Correct |
29 ms |
3416 KB |
Output is correct |
20 |
Correct |
31 ms |
3412 KB |
Output is correct |
21 |
Correct |
31 ms |
3416 KB |
Output is correct |
22 |
Correct |
33 ms |
3412 KB |
Output is correct |
23 |
Correct |
30 ms |
3416 KB |
Output is correct |
24 |
Incorrect |
30 ms |
3416 KB |
Output isn't correct |
25 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
46100 KB |
Output is correct |
2 |
Correct |
29 ms |
3416 KB |
Output is correct |
3 |
Correct |
31 ms |
3416 KB |
Output is correct |
4 |
Correct |
29 ms |
3384 KB |
Output is correct |
5 |
Correct |
29 ms |
3416 KB |
Output is correct |
6 |
Correct |
30 ms |
3412 KB |
Output is correct |
7 |
Correct |
31 ms |
3416 KB |
Output is correct |
8 |
Correct |
31 ms |
3388 KB |
Output is correct |
9 |
Correct |
30 ms |
3416 KB |
Output is correct |
10 |
Correct |
30 ms |
3388 KB |
Output is correct |
11 |
Correct |
191 ms |
45396 KB |
Output is correct |
12 |
Correct |
29 ms |
3416 KB |
Output is correct |
13 |
Correct |
30 ms |
3416 KB |
Output is correct |
14 |
Correct |
29 ms |
3412 KB |
Output is correct |
15 |
Correct |
30 ms |
3412 KB |
Output is correct |
16 |
Correct |
30 ms |
3416 KB |
Output is correct |
17 |
Correct |
31 ms |
3412 KB |
Output is correct |
18 |
Correct |
31 ms |
3412 KB |
Output is correct |
19 |
Correct |
30 ms |
3416 KB |
Output is correct |
20 |
Correct |
30 ms |
3588 KB |
Output is correct |
21 |
Correct |
894 ms |
45480 KB |
Output is correct |
22 |
Correct |
883 ms |
46228 KB |
Output is correct |
23 |
Correct |
224 ms |
14120 KB |
Output is correct |
24 |
Correct |
227 ms |
13696 KB |
Output is correct |
25 |
Correct |
221 ms |
13636 KB |
Output is correct |
26 |
Correct |
220 ms |
13380 KB |
Output is correct |
27 |
Correct |
221 ms |
13864 KB |
Output is correct |
28 |
Correct |
225 ms |
13888 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
45344 KB |
Output is correct |
2 |
Correct |
71 ms |
45252 KB |
Output is correct |
3 |
Correct |
30 ms |
47508 KB |
Output is correct |
4 |
Correct |
189 ms |
45812 KB |
Output is correct |
5 |
Correct |
818 ms |
45512 KB |
Output is correct |
6 |
Correct |
824 ms |
45364 KB |
Output is correct |
7 |
Correct |
859 ms |
45904 KB |
Output is correct |
8 |
Correct |
830 ms |
45744 KB |
Output is correct |
9 |
Correct |
835 ms |
44948 KB |
Output is correct |
10 |
Correct |
889 ms |
45616 KB |
Output is correct |
11 |
Correct |
931 ms |
44400 KB |
Output is correct |
12 |
Correct |
191 ms |
46100 KB |
Output is correct |
13 |
Correct |
29 ms |
3416 KB |
Output is correct |
14 |
Correct |
31 ms |
3416 KB |
Output is correct |
15 |
Correct |
29 ms |
3384 KB |
Output is correct |
16 |
Correct |
29 ms |
3416 KB |
Output is correct |
17 |
Correct |
30 ms |
3412 KB |
Output is correct |
18 |
Correct |
31 ms |
3416 KB |
Output is correct |
19 |
Correct |
31 ms |
3388 KB |
Output is correct |
20 |
Correct |
30 ms |
3416 KB |
Output is correct |
21 |
Correct |
30 ms |
3388 KB |
Output is correct |
22 |
Correct |
53 ms |
45472 KB |
Output is correct |
23 |
Correct |
72 ms |
44712 KB |
Output is correct |
24 |
Correct |
32 ms |
46412 KB |
Output is correct |
25 |
Correct |
193 ms |
46176 KB |
Output is correct |
26 |
Correct |
29 ms |
3412 KB |
Output is correct |
27 |
Correct |
31 ms |
3416 KB |
Output is correct |
28 |
Correct |
30 ms |
3412 KB |
Output is correct |
29 |
Correct |
29 ms |
3416 KB |
Output is correct |
30 |
Correct |
29 ms |
3416 KB |
Output is correct |
31 |
Correct |
31 ms |
3412 KB |
Output is correct |
32 |
Correct |
31 ms |
3416 KB |
Output is correct |
33 |
Correct |
33 ms |
3412 KB |
Output is correct |
34 |
Correct |
30 ms |
3416 KB |
Output is correct |
35 |
Incorrect |
30 ms |
3416 KB |
Output isn't correct |
36 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
46100 KB |
Output is correct |
2 |
Correct |
29 ms |
3416 KB |
Output is correct |
3 |
Correct |
31 ms |
3416 KB |
Output is correct |
4 |
Correct |
29 ms |
3384 KB |
Output is correct |
5 |
Correct |
29 ms |
3416 KB |
Output is correct |
6 |
Correct |
30 ms |
3412 KB |
Output is correct |
7 |
Correct |
31 ms |
3416 KB |
Output is correct |
8 |
Correct |
31 ms |
3388 KB |
Output is correct |
9 |
Correct |
30 ms |
3416 KB |
Output is correct |
10 |
Correct |
30 ms |
3388 KB |
Output is correct |
11 |
Correct |
191 ms |
45396 KB |
Output is correct |
12 |
Correct |
29 ms |
3416 KB |
Output is correct |
13 |
Correct |
30 ms |
3416 KB |
Output is correct |
14 |
Correct |
29 ms |
3412 KB |
Output is correct |
15 |
Correct |
30 ms |
3412 KB |
Output is correct |
16 |
Correct |
30 ms |
3416 KB |
Output is correct |
17 |
Correct |
31 ms |
3412 KB |
Output is correct |
18 |
Correct |
31 ms |
3412 KB |
Output is correct |
19 |
Correct |
30 ms |
3416 KB |
Output is correct |
20 |
Correct |
30 ms |
3588 KB |
Output is correct |
21 |
Correct |
894 ms |
45480 KB |
Output is correct |
22 |
Correct |
883 ms |
46228 KB |
Output is correct |
23 |
Correct |
224 ms |
14120 KB |
Output is correct |
24 |
Correct |
227 ms |
13696 KB |
Output is correct |
25 |
Correct |
221 ms |
13636 KB |
Output is correct |
26 |
Correct |
220 ms |
13380 KB |
Output is correct |
27 |
Correct |
221 ms |
13864 KB |
Output is correct |
28 |
Correct |
225 ms |
13888 KB |
Output is correct |
29 |
Correct |
191 ms |
45664 KB |
Output is correct |
30 |
Correct |
29 ms |
3412 KB |
Output is correct |
31 |
Correct |
30 ms |
3612 KB |
Output is correct |
32 |
Correct |
29 ms |
3416 KB |
Output is correct |
33 |
Correct |
30 ms |
3416 KB |
Output is correct |
34 |
Correct |
30 ms |
3416 KB |
Output is correct |
35 |
Correct |
31 ms |
3396 KB |
Output is correct |
36 |
Correct |
31 ms |
3416 KB |
Output is correct |
37 |
Correct |
30 ms |
3412 KB |
Output is correct |
38 |
Correct |
30 ms |
3416 KB |
Output is correct |
39 |
Correct |
918 ms |
45316 KB |
Output is correct |
40 |
Correct |
894 ms |
45048 KB |
Output is correct |
41 |
Correct |
224 ms |
15144 KB |
Output is correct |
42 |
Correct |
229 ms |
13872 KB |
Output is correct |
43 |
Correct |
219 ms |
14144 KB |
Output is correct |
44 |
Correct |
223 ms |
13360 KB |
Output is correct |
45 |
Correct |
225 ms |
14132 KB |
Output is correct |
46 |
Correct |
231 ms |
14144 KB |
Output is correct |
47 |
Correct |
1780 ms |
44208 KB |
Output is correct |
48 |
Correct |
1753 ms |
45888 KB |
Output is correct |
49 |
Correct |
3856 ms |
104388 KB |
Output is correct |
50 |
Correct |
3895 ms |
105220 KB |
Output is correct |
51 |
Correct |
3814 ms |
104584 KB |
Output is correct |
52 |
Correct |
3843 ms |
105480 KB |
Output is correct |
53 |
Correct |
3829 ms |
105984 KB |
Output is correct |
54 |
Correct |
3858 ms |
104844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
45344 KB |
Output is correct |
2 |
Correct |
71 ms |
45252 KB |
Output is correct |
3 |
Correct |
30 ms |
47508 KB |
Output is correct |
4 |
Correct |
189 ms |
45812 KB |
Output is correct |
5 |
Correct |
818 ms |
45512 KB |
Output is correct |
6 |
Correct |
824 ms |
45364 KB |
Output is correct |
7 |
Correct |
859 ms |
45904 KB |
Output is correct |
8 |
Correct |
830 ms |
45744 KB |
Output is correct |
9 |
Correct |
835 ms |
44948 KB |
Output is correct |
10 |
Correct |
889 ms |
45616 KB |
Output is correct |
11 |
Correct |
931 ms |
44400 KB |
Output is correct |
12 |
Correct |
53 ms |
45672 KB |
Output is correct |
13 |
Correct |
70 ms |
45724 KB |
Output is correct |
14 |
Correct |
32 ms |
45076 KB |
Output is correct |
15 |
Correct |
188 ms |
45232 KB |
Output is correct |
16 |
Correct |
811 ms |
45384 KB |
Output is correct |
17 |
Correct |
798 ms |
44592 KB |
Output is correct |
18 |
Correct |
863 ms |
44396 KB |
Output is correct |
19 |
Correct |
829 ms |
45984 KB |
Output is correct |
20 |
Correct |
803 ms |
44224 KB |
Output is correct |
21 |
Correct |
923 ms |
45196 KB |
Output is correct |
22 |
Correct |
881 ms |
45480 KB |
Output is correct |
23 |
Correct |
1610 ms |
45228 KB |
Output is correct |
24 |
Correct |
1649 ms |
44448 KB |
Output is correct |
25 |
Correct |
1686 ms |
45184 KB |
Output is correct |
26 |
Correct |
1615 ms |
45064 KB |
Output is correct |
27 |
Correct |
1617 ms |
44452 KB |
Output is correct |
28 |
Correct |
1771 ms |
45428 KB |
Output is correct |
29 |
Correct |
1800 ms |
45488 KB |
Output is correct |
30 |
Correct |
191 ms |
46100 KB |
Output is correct |
31 |
Correct |
29 ms |
3416 KB |
Output is correct |
32 |
Correct |
31 ms |
3416 KB |
Output is correct |
33 |
Correct |
29 ms |
3384 KB |
Output is correct |
34 |
Correct |
29 ms |
3416 KB |
Output is correct |
35 |
Correct |
30 ms |
3412 KB |
Output is correct |
36 |
Correct |
31 ms |
3416 KB |
Output is correct |
37 |
Correct |
31 ms |
3388 KB |
Output is correct |
38 |
Correct |
30 ms |
3416 KB |
Output is correct |
39 |
Correct |
30 ms |
3388 KB |
Output is correct |
40 |
Correct |
53 ms |
45472 KB |
Output is correct |
41 |
Correct |
72 ms |
44712 KB |
Output is correct |
42 |
Correct |
32 ms |
46412 KB |
Output is correct |
43 |
Correct |
193 ms |
46176 KB |
Output is correct |
44 |
Correct |
29 ms |
3412 KB |
Output is correct |
45 |
Correct |
31 ms |
3416 KB |
Output is correct |
46 |
Correct |
30 ms |
3412 KB |
Output is correct |
47 |
Correct |
29 ms |
3416 KB |
Output is correct |
48 |
Correct |
29 ms |
3416 KB |
Output is correct |
49 |
Correct |
31 ms |
3412 KB |
Output is correct |
50 |
Correct |
31 ms |
3416 KB |
Output is correct |
51 |
Correct |
33 ms |
3412 KB |
Output is correct |
52 |
Correct |
30 ms |
3416 KB |
Output is correct |
53 |
Incorrect |
30 ms |
3416 KB |
Output isn't correct |
54 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
46100 KB |
Output is correct |
2 |
Correct |
29 ms |
3416 KB |
Output is correct |
3 |
Correct |
31 ms |
3416 KB |
Output is correct |
4 |
Correct |
29 ms |
3384 KB |
Output is correct |
5 |
Correct |
29 ms |
3416 KB |
Output is correct |
6 |
Correct |
30 ms |
3412 KB |
Output is correct |
7 |
Correct |
31 ms |
3416 KB |
Output is correct |
8 |
Correct |
31 ms |
3388 KB |
Output is correct |
9 |
Correct |
30 ms |
3416 KB |
Output is correct |
10 |
Correct |
30 ms |
3388 KB |
Output is correct |
11 |
Correct |
191 ms |
45396 KB |
Output is correct |
12 |
Correct |
29 ms |
3416 KB |
Output is correct |
13 |
Correct |
30 ms |
3416 KB |
Output is correct |
14 |
Correct |
29 ms |
3412 KB |
Output is correct |
15 |
Correct |
30 ms |
3412 KB |
Output is correct |
16 |
Correct |
30 ms |
3416 KB |
Output is correct |
17 |
Correct |
31 ms |
3412 KB |
Output is correct |
18 |
Correct |
31 ms |
3412 KB |
Output is correct |
19 |
Correct |
30 ms |
3416 KB |
Output is correct |
20 |
Correct |
30 ms |
3588 KB |
Output is correct |
21 |
Correct |
894 ms |
45480 KB |
Output is correct |
22 |
Correct |
883 ms |
46228 KB |
Output is correct |
23 |
Correct |
224 ms |
14120 KB |
Output is correct |
24 |
Correct |
227 ms |
13696 KB |
Output is correct |
25 |
Correct |
221 ms |
13636 KB |
Output is correct |
26 |
Correct |
220 ms |
13380 KB |
Output is correct |
27 |
Correct |
221 ms |
13864 KB |
Output is correct |
28 |
Correct |
225 ms |
13888 KB |
Output is correct |
29 |
Correct |
191 ms |
45664 KB |
Output is correct |
30 |
Correct |
29 ms |
3412 KB |
Output is correct |
31 |
Correct |
30 ms |
3612 KB |
Output is correct |
32 |
Correct |
29 ms |
3416 KB |
Output is correct |
33 |
Correct |
30 ms |
3416 KB |
Output is correct |
34 |
Correct |
30 ms |
3416 KB |
Output is correct |
35 |
Correct |
31 ms |
3396 KB |
Output is correct |
36 |
Correct |
31 ms |
3416 KB |
Output is correct |
37 |
Correct |
30 ms |
3412 KB |
Output is correct |
38 |
Correct |
30 ms |
3416 KB |
Output is correct |
39 |
Correct |
918 ms |
45316 KB |
Output is correct |
40 |
Correct |
894 ms |
45048 KB |
Output is correct |
41 |
Correct |
224 ms |
15144 KB |
Output is correct |
42 |
Correct |
229 ms |
13872 KB |
Output is correct |
43 |
Correct |
219 ms |
14144 KB |
Output is correct |
44 |
Correct |
223 ms |
13360 KB |
Output is correct |
45 |
Correct |
225 ms |
14132 KB |
Output is correct |
46 |
Correct |
231 ms |
14144 KB |
Output is correct |
47 |
Correct |
1780 ms |
44208 KB |
Output is correct |
48 |
Correct |
1753 ms |
45888 KB |
Output is correct |
49 |
Correct |
3856 ms |
104388 KB |
Output is correct |
50 |
Correct |
3895 ms |
105220 KB |
Output is correct |
51 |
Correct |
3814 ms |
104584 KB |
Output is correct |
52 |
Correct |
3843 ms |
105480 KB |
Output is correct |
53 |
Correct |
3829 ms |
105984 KB |
Output is correct |
54 |
Correct |
3858 ms |
104844 KB |
Output is correct |
55 |
Correct |
196 ms |
44148 KB |
Output is correct |
56 |
Correct |
29 ms |
3412 KB |
Output is correct |
57 |
Correct |
31 ms |
3412 KB |
Output is correct |
58 |
Correct |
29 ms |
3412 KB |
Output is correct |
59 |
Correct |
30 ms |
3416 KB |
Output is correct |
60 |
Correct |
30 ms |
3416 KB |
Output is correct |
61 |
Correct |
31 ms |
3416 KB |
Output is correct |
62 |
Correct |
30 ms |
3416 KB |
Output is correct |
63 |
Correct |
30 ms |
3416 KB |
Output is correct |
64 |
Correct |
33 ms |
3412 KB |
Output is correct |
65 |
Correct |
884 ms |
45068 KB |
Output is correct |
66 |
Correct |
925 ms |
45388 KB |
Output is correct |
67 |
Correct |
226 ms |
13632 KB |
Output is correct |
68 |
Correct |
229 ms |
13616 KB |
Output is correct |
69 |
Correct |
221 ms |
13376 KB |
Output is correct |
70 |
Correct |
222 ms |
14144 KB |
Output is correct |
71 |
Correct |
231 ms |
14384 KB |
Output is correct |
72 |
Correct |
229 ms |
15164 KB |
Output is correct |
73 |
Correct |
1771 ms |
44852 KB |
Output is correct |
74 |
Correct |
1796 ms |
47532 KB |
Output is correct |
75 |
Correct |
3911 ms |
105352 KB |
Output is correct |
76 |
Correct |
3978 ms |
105200 KB |
Output is correct |
77 |
Correct |
3953 ms |
106372 KB |
Output is correct |
78 |
Correct |
3877 ms |
105352 KB |
Output is correct |
79 |
Correct |
3919 ms |
104328 KB |
Output is correct |
80 |
Correct |
3885 ms |
104840 KB |
Output is correct |
81 |
Runtime error |
157 ms |
524288 KB |
Execution killed with signal 9 |
82 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
45344 KB |
Output is correct |
2 |
Correct |
71 ms |
45252 KB |
Output is correct |
3 |
Correct |
30 ms |
47508 KB |
Output is correct |
4 |
Correct |
189 ms |
45812 KB |
Output is correct |
5 |
Correct |
818 ms |
45512 KB |
Output is correct |
6 |
Correct |
824 ms |
45364 KB |
Output is correct |
7 |
Correct |
859 ms |
45904 KB |
Output is correct |
8 |
Correct |
830 ms |
45744 KB |
Output is correct |
9 |
Correct |
835 ms |
44948 KB |
Output is correct |
10 |
Correct |
889 ms |
45616 KB |
Output is correct |
11 |
Correct |
931 ms |
44400 KB |
Output is correct |
12 |
Correct |
53 ms |
45672 KB |
Output is correct |
13 |
Correct |
70 ms |
45724 KB |
Output is correct |
14 |
Correct |
32 ms |
45076 KB |
Output is correct |
15 |
Correct |
188 ms |
45232 KB |
Output is correct |
16 |
Correct |
811 ms |
45384 KB |
Output is correct |
17 |
Correct |
798 ms |
44592 KB |
Output is correct |
18 |
Correct |
863 ms |
44396 KB |
Output is correct |
19 |
Correct |
829 ms |
45984 KB |
Output is correct |
20 |
Correct |
803 ms |
44224 KB |
Output is correct |
21 |
Correct |
923 ms |
45196 KB |
Output is correct |
22 |
Correct |
881 ms |
45480 KB |
Output is correct |
23 |
Correct |
1610 ms |
45228 KB |
Output is correct |
24 |
Correct |
1649 ms |
44448 KB |
Output is correct |
25 |
Correct |
1686 ms |
45184 KB |
Output is correct |
26 |
Correct |
1615 ms |
45064 KB |
Output is correct |
27 |
Correct |
1617 ms |
44452 KB |
Output is correct |
28 |
Correct |
1771 ms |
45428 KB |
Output is correct |
29 |
Correct |
1800 ms |
45488 KB |
Output is correct |
30 |
Correct |
191 ms |
46100 KB |
Output is correct |
31 |
Correct |
29 ms |
3416 KB |
Output is correct |
32 |
Correct |
31 ms |
3416 KB |
Output is correct |
33 |
Correct |
29 ms |
3384 KB |
Output is correct |
34 |
Correct |
29 ms |
3416 KB |
Output is correct |
35 |
Correct |
30 ms |
3412 KB |
Output is correct |
36 |
Correct |
31 ms |
3416 KB |
Output is correct |
37 |
Correct |
31 ms |
3388 KB |
Output is correct |
38 |
Correct |
30 ms |
3416 KB |
Output is correct |
39 |
Correct |
30 ms |
3388 KB |
Output is correct |
40 |
Correct |
53 ms |
45472 KB |
Output is correct |
41 |
Correct |
72 ms |
44712 KB |
Output is correct |
42 |
Correct |
32 ms |
46412 KB |
Output is correct |
43 |
Correct |
193 ms |
46176 KB |
Output is correct |
44 |
Correct |
29 ms |
3412 KB |
Output is correct |
45 |
Correct |
31 ms |
3416 KB |
Output is correct |
46 |
Correct |
30 ms |
3412 KB |
Output is correct |
47 |
Correct |
29 ms |
3416 KB |
Output is correct |
48 |
Correct |
29 ms |
3416 KB |
Output is correct |
49 |
Correct |
31 ms |
3412 KB |
Output is correct |
50 |
Correct |
31 ms |
3416 KB |
Output is correct |
51 |
Correct |
33 ms |
3412 KB |
Output is correct |
52 |
Correct |
30 ms |
3416 KB |
Output is correct |
53 |
Incorrect |
30 ms |
3416 KB |
Output isn't correct |
54 |
Halted |
0 ms |
0 KB |
- |