#include <bits/stdc++.h>
using namespace std;
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 < min(LIM + 1, (long long)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;
}
vector<long long> SolveDP2(long long N, long long LIM, vector<long long> List) {
vector<long long> dp(LIM + 1, -(1LL << 60));
vector<long long> ret(N, 0);
dp[0] = 0;
// DP Start
for (int i = N - 1; i >= 0; i--) {
for (int j = 1; j <= min(N, List[i]); j++) {
if (dp[(i + 1) * j] == -(1LL << 60)) ret[i] += 1;
else break;
}
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 ret;
}
long long Solve_Subtask6(long long M, long long L, vector<long long> A) {
vector<long long> M0(M, 0), M1(M, 0), M2(M, 0), M3(M, 0); // Minus
vector<long long> P0(M, 0), P1(M, 0), P2(M, 0), P3(M, 0); // Minus
// Step 1. First DP
for (int i = 0; i < M; i++) M0[i] = A[M - 1 - i];
for (int i = 0; i < M; i++) P0[i] = A[M + 1 + i];
M1 = SolveDP2(M, M * M + 1, M0);
P1 = SolveDP2(M, M * M + 1, P0);
// Step 2. Calculate Sum
long long sumM = 0; for (int i = 0; i < M; i++) sumM += 1LL * (i + 1) * (M0[i] - M1[i]);
long long sumP = 0; for (int i = 0; i < M; i++) sumP += 1LL * (i + 1) * (P0[i] - P1[i]);
long long Offset = M * M + 10LL * M;
long long Answer = 0;
long long Actual = 0;
if (sumP - sumM > L) sumP = sumM + L;
else sumM = sumP - L;
// Step 3. Greedy
for (int i = 0; i < M; i++) {
M2[i] = min(M0[i] - M1[i], max(0LL, sumM - Offset) / (i + 1));
Answer += M2[i];
sumM -= 1LL * (i + 1) * M2[i];
Actual -= 1LL * (i + 1) * M2[i];
M3[i] = M0[i] - M2[i];
}
for (int i = 0; i < M; i++) {
P2[i] = min(P0[i] - P1[i], max(0LL, sumP - Offset) / (i + 1));
Answer += P2[i];
sumP -= 1LL * (i + 1) * P2[i];
Actual += 1LL * (i + 1) * P2[i];
P3[i] = P0[i] - P2[i];
}
// Step 4. Get Maximum
long long Maximum1 = Offset + 10LL * M;
long long Maximum2 = Offset + 10LL * M;
for (int i = 0; i < M; i++) Maximum1 += 1LL * (i + 1) * M1[i];
for (int i = 0; i < M; i++) Maximum2 += 1LL * (i + 1) * P1[i];
if (L - Actual < -Maximum1) return -1;
if (L - Actual > +Maximum2) return -1;
// Step 5. Get Answer
vector<long long> dp1 = SolveDP(M, Maximum1, M3, vector<long long>{});
vector<long long> dp2 = vector<long long>(Maximum1 + 1, -(1LL << 60));
for (int i = 0; i <= Maximum1; i++) dp2[Maximum1 - i] = dp1[i];
vector<long long> dp3 = SolveDP(M, Maximum1 + L - Actual, P3, dp2);
if (dp3[Maximum1 + L - Actual] == -(1LL << 60)) return -1;
return dp3[Maximum1 + L - Actual] + A[M] + Answer;
}
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];
// Output
long long Answer = Solve_Subtask6(M, L, A);
if (Answer == -1) cout << "impossible" << endl;
else cout << Answer << endl;
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:20: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]
20 | while (maxi.size() >= cur + 1) {
| ~~~~~~~~~~~~^~~~~~~~~~
vault.cpp: In function 'std::vector<long long int> SolveDP2(long long int, long long int, std::vector<long long int>)':
vault.cpp:54: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]
54 | while (maxi.size() >= cur + 1) {
| ~~~~~~~~~~~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
6 |
Correct |
17 ms |
1312 KB |
Output is correct |
7 |
Correct |
8 ms |
604 KB |
Output is correct |
8 |
Correct |
15 ms |
1084 KB |
Output is correct |
9 |
Correct |
16 ms |
1280 KB |
Output is correct |
10 |
Correct |
9 ms |
600 KB |
Output is correct |
11 |
Correct |
11 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
6 |
Correct |
17 ms |
1312 KB |
Output is correct |
7 |
Correct |
8 ms |
604 KB |
Output is correct |
8 |
Correct |
15 ms |
1084 KB |
Output is correct |
9 |
Correct |
16 ms |
1280 KB |
Output is correct |
10 |
Correct |
9 ms |
600 KB |
Output is correct |
11 |
Correct |
11 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
3 ms |
348 KB |
Output is correct |
17 |
Correct |
17 ms |
1140 KB |
Output is correct |
18 |
Correct |
8 ms |
600 KB |
Output is correct |
19 |
Correct |
15 ms |
1084 KB |
Output is correct |
20 |
Correct |
16 ms |
1176 KB |
Output is correct |
21 |
Correct |
11 ms |
600 KB |
Output is correct |
22 |
Correct |
9 ms |
604 KB |
Output is correct |
23 |
Correct |
23 ms |
888 KB |
Output is correct |
24 |
Correct |
148 ms |
4460 KB |
Output is correct |
25 |
Correct |
153 ms |
5452 KB |
Output is correct |
26 |
Correct |
159 ms |
4752 KB |
Output is correct |
27 |
Correct |
159 ms |
4724 KB |
Output is correct |
28 |
Correct |
71 ms |
1856 KB |
Output is correct |
29 |
Correct |
66 ms |
1688 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
3 ms |
600 KB |
Output is correct |
10 |
Correct |
3 ms |
856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
3 ms |
600 KB |
Output is correct |
10 |
Correct |
3 ms |
856 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
604 KB |
Output is correct |
19 |
Correct |
3 ms |
600 KB |
Output is correct |
20 |
Correct |
3 ms |
604 KB |
Output is correct |
21 |
Correct |
3 ms |
604 KB |
Output is correct |
22 |
Correct |
3 ms |
604 KB |
Output is correct |
23 |
Correct |
3 ms |
604 KB |
Output is correct |
24 |
Correct |
4 ms |
784 KB |
Output is correct |
25 |
Correct |
4 ms |
600 KB |
Output is correct |
26 |
Correct |
4 ms |
656 KB |
Output is correct |
27 |
Correct |
4 ms |
604 KB |
Output is correct |
28 |
Correct |
4 ms |
788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
3 ms |
600 KB |
Output is correct |
10 |
Correct |
3 ms |
856 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
604 KB |
Output is correct |
13 |
Correct |
4 ms |
752 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
600 KB |
Output is correct |
19 |
Correct |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
600 KB |
Output is correct |
21 |
Correct |
9 ms |
604 KB |
Output is correct |
22 |
Correct |
9 ms |
600 KB |
Output is correct |
23 |
Correct |
13 ms |
1368 KB |
Output is correct |
24 |
Correct |
15 ms |
1116 KB |
Output is correct |
25 |
Correct |
9 ms |
860 KB |
Output is correct |
26 |
Correct |
9 ms |
860 KB |
Output is correct |
27 |
Correct |
9 ms |
624 KB |
Output is correct |
28 |
Correct |
9 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
6 |
Correct |
17 ms |
1312 KB |
Output is correct |
7 |
Correct |
8 ms |
604 KB |
Output is correct |
8 |
Correct |
15 ms |
1084 KB |
Output is correct |
9 |
Correct |
16 ms |
1280 KB |
Output is correct |
10 |
Correct |
9 ms |
600 KB |
Output is correct |
11 |
Correct |
11 ms |
600 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
3 ms |
604 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
2 ms |
604 KB |
Output is correct |
18 |
Correct |
2 ms |
604 KB |
Output is correct |
19 |
Correct |
2 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
600 KB |
Output is correct |
21 |
Correct |
3 ms |
856 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
3 ms |
604 KB |
Output is correct |
27 |
Correct |
3 ms |
604 KB |
Output is correct |
28 |
Correct |
3 ms |
604 KB |
Output is correct |
29 |
Correct |
3 ms |
604 KB |
Output is correct |
30 |
Correct |
3 ms |
600 KB |
Output is correct |
31 |
Correct |
3 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Correct |
3 ms |
604 KB |
Output is correct |
35 |
Correct |
4 ms |
784 KB |
Output is correct |
36 |
Correct |
4 ms |
600 KB |
Output is correct |
37 |
Correct |
4 ms |
656 KB |
Output is correct |
38 |
Correct |
4 ms |
604 KB |
Output is correct |
39 |
Correct |
4 ms |
788 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
3 ms |
604 KB |
Output is correct |
42 |
Correct |
4 ms |
752 KB |
Output is correct |
43 |
Correct |
3 ms |
604 KB |
Output is correct |
44 |
Correct |
3 ms |
604 KB |
Output is correct |
45 |
Correct |
3 ms |
604 KB |
Output is correct |
46 |
Correct |
3 ms |
604 KB |
Output is correct |
47 |
Correct |
3 ms |
600 KB |
Output is correct |
48 |
Correct |
3 ms |
604 KB |
Output is correct |
49 |
Correct |
3 ms |
600 KB |
Output is correct |
50 |
Correct |
9 ms |
604 KB |
Output is correct |
51 |
Correct |
9 ms |
600 KB |
Output is correct |
52 |
Correct |
13 ms |
1368 KB |
Output is correct |
53 |
Correct |
15 ms |
1116 KB |
Output is correct |
54 |
Correct |
9 ms |
860 KB |
Output is correct |
55 |
Correct |
9 ms |
860 KB |
Output is correct |
56 |
Correct |
9 ms |
624 KB |
Output is correct |
57 |
Correct |
9 ms |
860 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
3 ms |
348 KB |
Output is correct |
63 |
Correct |
17 ms |
1184 KB |
Output is correct |
64 |
Correct |
9 ms |
600 KB |
Output is correct |
65 |
Correct |
16 ms |
1336 KB |
Output is correct |
66 |
Correct |
18 ms |
1248 KB |
Output is correct |
67 |
Correct |
9 ms |
760 KB |
Output is correct |
68 |
Correct |
9 ms |
604 KB |
Output is correct |
69 |
Correct |
3 ms |
528 KB |
Output is correct |
70 |
Correct |
3 ms |
604 KB |
Output is correct |
71 |
Correct |
2 ms |
604 KB |
Output is correct |
72 |
Correct |
2 ms |
604 KB |
Output is correct |
73 |
Correct |
2 ms |
604 KB |
Output is correct |
74 |
Correct |
3 ms |
604 KB |
Output is correct |
75 |
Correct |
3 ms |
604 KB |
Output is correct |
76 |
Correct |
3 ms |
604 KB |
Output is correct |
77 |
Correct |
3 ms |
604 KB |
Output is correct |
78 |
Correct |
4 ms |
784 KB |
Output is correct |
79 |
Correct |
4 ms |
600 KB |
Output is correct |
80 |
Correct |
5 ms |
768 KB |
Output is correct |
81 |
Correct |
4 ms |
604 KB |
Output is correct |
82 |
Correct |
4 ms |
788 KB |
Output is correct |
83 |
Correct |
13 ms |
1000 KB |
Output is correct |
84 |
Correct |
14 ms |
1112 KB |
Output is correct |
85 |
Correct |
9 ms |
860 KB |
Output is correct |
86 |
Correct |
9 ms |
860 KB |
Output is correct |
87 |
Correct |
9 ms |
860 KB |
Output is correct |
88 |
Correct |
9 ms |
860 KB |
Output is correct |
89 |
Incorrect |
18 ms |
1296 KB |
Output isn't correct |
90 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
3 ms |
600 KB |
Output is correct |
10 |
Correct |
3 ms |
856 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
604 KB |
Output is correct |
13 |
Correct |
4 ms |
752 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
600 KB |
Output is correct |
19 |
Correct |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
600 KB |
Output is correct |
21 |
Correct |
9 ms |
604 KB |
Output is correct |
22 |
Correct |
9 ms |
600 KB |
Output is correct |
23 |
Correct |
13 ms |
1368 KB |
Output is correct |
24 |
Correct |
15 ms |
1116 KB |
Output is correct |
25 |
Correct |
9 ms |
860 KB |
Output is correct |
26 |
Correct |
9 ms |
860 KB |
Output is correct |
27 |
Correct |
9 ms |
624 KB |
Output is correct |
28 |
Correct |
9 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
344 KB |
Output is correct |
30 |
Correct |
3 ms |
600 KB |
Output is correct |
31 |
Correct |
3 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Correct |
3 ms |
604 KB |
Output is correct |
35 |
Correct |
2 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
600 KB |
Output is correct |
37 |
Correct |
3 ms |
604 KB |
Output is correct |
38 |
Correct |
3 ms |
528 KB |
Output is correct |
39 |
Correct |
9 ms |
604 KB |
Output is correct |
40 |
Correct |
9 ms |
856 KB |
Output is correct |
41 |
Correct |
13 ms |
1116 KB |
Output is correct |
42 |
Correct |
14 ms |
1112 KB |
Output is correct |
43 |
Correct |
9 ms |
860 KB |
Output is correct |
44 |
Correct |
9 ms |
628 KB |
Output is correct |
45 |
Correct |
9 ms |
860 KB |
Output is correct |
46 |
Correct |
9 ms |
856 KB |
Output is correct |
47 |
Correct |
66 ms |
1888 KB |
Output is correct |
48 |
Correct |
66 ms |
1856 KB |
Output is correct |
49 |
Correct |
89 ms |
2916 KB |
Output is correct |
50 |
Correct |
89 ms |
2876 KB |
Output is correct |
51 |
Correct |
72 ms |
1908 KB |
Output is correct |
52 |
Correct |
64 ms |
1884 KB |
Output is correct |
53 |
Correct |
65 ms |
1908 KB |
Output is correct |
54 |
Correct |
64 ms |
1888 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
6 |
Correct |
17 ms |
1312 KB |
Output is correct |
7 |
Correct |
8 ms |
604 KB |
Output is correct |
8 |
Correct |
15 ms |
1084 KB |
Output is correct |
9 |
Correct |
16 ms |
1280 KB |
Output is correct |
10 |
Correct |
9 ms |
600 KB |
Output is correct |
11 |
Correct |
11 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
3 ms |
348 KB |
Output is correct |
17 |
Correct |
17 ms |
1140 KB |
Output is correct |
18 |
Correct |
8 ms |
600 KB |
Output is correct |
19 |
Correct |
15 ms |
1084 KB |
Output is correct |
20 |
Correct |
16 ms |
1176 KB |
Output is correct |
21 |
Correct |
11 ms |
600 KB |
Output is correct |
22 |
Correct |
9 ms |
604 KB |
Output is correct |
23 |
Correct |
23 ms |
888 KB |
Output is correct |
24 |
Correct |
148 ms |
4460 KB |
Output is correct |
25 |
Correct |
153 ms |
5452 KB |
Output is correct |
26 |
Correct |
159 ms |
4752 KB |
Output is correct |
27 |
Correct |
159 ms |
4724 KB |
Output is correct |
28 |
Correct |
71 ms |
1856 KB |
Output is correct |
29 |
Correct |
66 ms |
1688 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
3 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Correct |
3 ms |
604 KB |
Output is correct |
35 |
Correct |
2 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
604 KB |
Output is correct |
37 |
Correct |
2 ms |
604 KB |
Output is correct |
38 |
Correct |
3 ms |
600 KB |
Output is correct |
39 |
Correct |
3 ms |
856 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
344 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
3 ms |
604 KB |
Output is correct |
45 |
Correct |
3 ms |
604 KB |
Output is correct |
46 |
Correct |
3 ms |
604 KB |
Output is correct |
47 |
Correct |
3 ms |
604 KB |
Output is correct |
48 |
Correct |
3 ms |
600 KB |
Output is correct |
49 |
Correct |
3 ms |
604 KB |
Output is correct |
50 |
Correct |
3 ms |
604 KB |
Output is correct |
51 |
Correct |
3 ms |
604 KB |
Output is correct |
52 |
Correct |
3 ms |
604 KB |
Output is correct |
53 |
Correct |
4 ms |
784 KB |
Output is correct |
54 |
Correct |
4 ms |
600 KB |
Output is correct |
55 |
Correct |
4 ms |
656 KB |
Output is correct |
56 |
Correct |
4 ms |
604 KB |
Output is correct |
57 |
Correct |
4 ms |
788 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
3 ms |
604 KB |
Output is correct |
60 |
Correct |
4 ms |
752 KB |
Output is correct |
61 |
Correct |
3 ms |
604 KB |
Output is correct |
62 |
Correct |
3 ms |
604 KB |
Output is correct |
63 |
Correct |
3 ms |
604 KB |
Output is correct |
64 |
Correct |
3 ms |
604 KB |
Output is correct |
65 |
Correct |
3 ms |
600 KB |
Output is correct |
66 |
Correct |
3 ms |
604 KB |
Output is correct |
67 |
Correct |
3 ms |
600 KB |
Output is correct |
68 |
Correct |
9 ms |
604 KB |
Output is correct |
69 |
Correct |
9 ms |
600 KB |
Output is correct |
70 |
Correct |
13 ms |
1368 KB |
Output is correct |
71 |
Correct |
15 ms |
1116 KB |
Output is correct |
72 |
Correct |
9 ms |
860 KB |
Output is correct |
73 |
Correct |
9 ms |
860 KB |
Output is correct |
74 |
Correct |
9 ms |
624 KB |
Output is correct |
75 |
Correct |
9 ms |
860 KB |
Output is correct |
76 |
Correct |
1 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
3 ms |
348 KB |
Output is correct |
81 |
Correct |
17 ms |
1184 KB |
Output is correct |
82 |
Correct |
9 ms |
600 KB |
Output is correct |
83 |
Correct |
16 ms |
1336 KB |
Output is correct |
84 |
Correct |
18 ms |
1248 KB |
Output is correct |
85 |
Correct |
9 ms |
760 KB |
Output is correct |
86 |
Correct |
9 ms |
604 KB |
Output is correct |
87 |
Correct |
3 ms |
528 KB |
Output is correct |
88 |
Correct |
3 ms |
604 KB |
Output is correct |
89 |
Correct |
2 ms |
604 KB |
Output is correct |
90 |
Correct |
2 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
604 KB |
Output is correct |
92 |
Correct |
3 ms |
604 KB |
Output is correct |
93 |
Correct |
3 ms |
604 KB |
Output is correct |
94 |
Correct |
3 ms |
604 KB |
Output is correct |
95 |
Correct |
3 ms |
604 KB |
Output is correct |
96 |
Correct |
4 ms |
784 KB |
Output is correct |
97 |
Correct |
4 ms |
600 KB |
Output is correct |
98 |
Correct |
5 ms |
768 KB |
Output is correct |
99 |
Correct |
4 ms |
604 KB |
Output is correct |
100 |
Correct |
4 ms |
788 KB |
Output is correct |
101 |
Correct |
13 ms |
1000 KB |
Output is correct |
102 |
Correct |
14 ms |
1112 KB |
Output is correct |
103 |
Correct |
9 ms |
860 KB |
Output is correct |
104 |
Correct |
9 ms |
860 KB |
Output is correct |
105 |
Correct |
9 ms |
860 KB |
Output is correct |
106 |
Correct |
9 ms |
860 KB |
Output is correct |
107 |
Incorrect |
18 ms |
1296 KB |
Output isn't correct |
108 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
2 ms |
604 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
3 ms |
600 KB |
Output is correct |
10 |
Correct |
3 ms |
856 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
604 KB |
Output is correct |
13 |
Correct |
4 ms |
752 KB |
Output is correct |
14 |
Correct |
3 ms |
604 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
3 ms |
600 KB |
Output is correct |
19 |
Correct |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
3 ms |
600 KB |
Output is correct |
21 |
Correct |
9 ms |
604 KB |
Output is correct |
22 |
Correct |
9 ms |
600 KB |
Output is correct |
23 |
Correct |
13 ms |
1368 KB |
Output is correct |
24 |
Correct |
15 ms |
1116 KB |
Output is correct |
25 |
Correct |
9 ms |
860 KB |
Output is correct |
26 |
Correct |
9 ms |
860 KB |
Output is correct |
27 |
Correct |
9 ms |
624 KB |
Output is correct |
28 |
Correct |
9 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
344 KB |
Output is correct |
30 |
Correct |
3 ms |
600 KB |
Output is correct |
31 |
Correct |
3 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Correct |
3 ms |
604 KB |
Output is correct |
35 |
Correct |
2 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
600 KB |
Output is correct |
37 |
Correct |
3 ms |
604 KB |
Output is correct |
38 |
Correct |
3 ms |
528 KB |
Output is correct |
39 |
Correct |
9 ms |
604 KB |
Output is correct |
40 |
Correct |
9 ms |
856 KB |
Output is correct |
41 |
Correct |
13 ms |
1116 KB |
Output is correct |
42 |
Correct |
14 ms |
1112 KB |
Output is correct |
43 |
Correct |
9 ms |
860 KB |
Output is correct |
44 |
Correct |
9 ms |
628 KB |
Output is correct |
45 |
Correct |
9 ms |
860 KB |
Output is correct |
46 |
Correct |
9 ms |
856 KB |
Output is correct |
47 |
Correct |
66 ms |
1888 KB |
Output is correct |
48 |
Correct |
66 ms |
1856 KB |
Output is correct |
49 |
Correct |
89 ms |
2916 KB |
Output is correct |
50 |
Correct |
89 ms |
2876 KB |
Output is correct |
51 |
Correct |
72 ms |
1908 KB |
Output is correct |
52 |
Correct |
64 ms |
1884 KB |
Output is correct |
53 |
Correct |
65 ms |
1908 KB |
Output is correct |
54 |
Correct |
64 ms |
1888 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
3 ms |
604 KB |
Output is correct |
57 |
Correct |
3 ms |
604 KB |
Output is correct |
58 |
Correct |
4 ms |
708 KB |
Output is correct |
59 |
Correct |
3 ms |
604 KB |
Output is correct |
60 |
Correct |
3 ms |
604 KB |
Output is correct |
61 |
Correct |
2 ms |
604 KB |
Output is correct |
62 |
Correct |
3 ms |
604 KB |
Output is correct |
63 |
Correct |
3 ms |
604 KB |
Output is correct |
64 |
Correct |
3 ms |
604 KB |
Output is correct |
65 |
Correct |
9 ms |
604 KB |
Output is correct |
66 |
Correct |
10 ms |
844 KB |
Output is correct |
67 |
Correct |
13 ms |
1116 KB |
Output is correct |
68 |
Correct |
14 ms |
1116 KB |
Output is correct |
69 |
Correct |
9 ms |
860 KB |
Output is correct |
70 |
Correct |
9 ms |
860 KB |
Output is correct |
71 |
Correct |
9 ms |
860 KB |
Output is correct |
72 |
Correct |
9 ms |
860 KB |
Output is correct |
73 |
Correct |
67 ms |
1924 KB |
Output is correct |
74 |
Correct |
66 ms |
1708 KB |
Output is correct |
75 |
Correct |
90 ms |
2904 KB |
Output is correct |
76 |
Correct |
90 ms |
2936 KB |
Output is correct |
77 |
Correct |
65 ms |
1912 KB |
Output is correct |
78 |
Correct |
67 ms |
1884 KB |
Output is correct |
79 |
Correct |
73 ms |
1880 KB |
Output is correct |
80 |
Correct |
64 ms |
1920 KB |
Output is correct |
81 |
Correct |
2728 ms |
20380 KB |
Output is correct |
82 |
Correct |
2716 ms |
20088 KB |
Output is correct |
83 |
Incorrect |
1596 ms |
13452 KB |
Output isn't correct |
84 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
480 KB |
Output is correct |
6 |
Correct |
17 ms |
1312 KB |
Output is correct |
7 |
Correct |
8 ms |
604 KB |
Output is correct |
8 |
Correct |
15 ms |
1084 KB |
Output is correct |
9 |
Correct |
16 ms |
1280 KB |
Output is correct |
10 |
Correct |
9 ms |
600 KB |
Output is correct |
11 |
Correct |
11 ms |
600 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
344 KB |
Output is correct |
16 |
Correct |
3 ms |
348 KB |
Output is correct |
17 |
Correct |
17 ms |
1140 KB |
Output is correct |
18 |
Correct |
8 ms |
600 KB |
Output is correct |
19 |
Correct |
15 ms |
1084 KB |
Output is correct |
20 |
Correct |
16 ms |
1176 KB |
Output is correct |
21 |
Correct |
11 ms |
600 KB |
Output is correct |
22 |
Correct |
9 ms |
604 KB |
Output is correct |
23 |
Correct |
23 ms |
888 KB |
Output is correct |
24 |
Correct |
148 ms |
4460 KB |
Output is correct |
25 |
Correct |
153 ms |
5452 KB |
Output is correct |
26 |
Correct |
159 ms |
4752 KB |
Output is correct |
27 |
Correct |
159 ms |
4724 KB |
Output is correct |
28 |
Correct |
71 ms |
1856 KB |
Output is correct |
29 |
Correct |
66 ms |
1688 KB |
Output is correct |
30 |
Correct |
1 ms |
344 KB |
Output is correct |
31 |
Correct |
3 ms |
604 KB |
Output is correct |
32 |
Correct |
3 ms |
604 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Correct |
3 ms |
604 KB |
Output is correct |
35 |
Correct |
2 ms |
604 KB |
Output is correct |
36 |
Correct |
2 ms |
604 KB |
Output is correct |
37 |
Correct |
2 ms |
604 KB |
Output is correct |
38 |
Correct |
3 ms |
600 KB |
Output is correct |
39 |
Correct |
3 ms |
856 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
344 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
3 ms |
604 KB |
Output is correct |
45 |
Correct |
3 ms |
604 KB |
Output is correct |
46 |
Correct |
3 ms |
604 KB |
Output is correct |
47 |
Correct |
3 ms |
604 KB |
Output is correct |
48 |
Correct |
3 ms |
600 KB |
Output is correct |
49 |
Correct |
3 ms |
604 KB |
Output is correct |
50 |
Correct |
3 ms |
604 KB |
Output is correct |
51 |
Correct |
3 ms |
604 KB |
Output is correct |
52 |
Correct |
3 ms |
604 KB |
Output is correct |
53 |
Correct |
4 ms |
784 KB |
Output is correct |
54 |
Correct |
4 ms |
600 KB |
Output is correct |
55 |
Correct |
4 ms |
656 KB |
Output is correct |
56 |
Correct |
4 ms |
604 KB |
Output is correct |
57 |
Correct |
4 ms |
788 KB |
Output is correct |
58 |
Correct |
1 ms |
348 KB |
Output is correct |
59 |
Correct |
3 ms |
604 KB |
Output is correct |
60 |
Correct |
4 ms |
752 KB |
Output is correct |
61 |
Correct |
3 ms |
604 KB |
Output is correct |
62 |
Correct |
3 ms |
604 KB |
Output is correct |
63 |
Correct |
3 ms |
604 KB |
Output is correct |
64 |
Correct |
3 ms |
604 KB |
Output is correct |
65 |
Correct |
3 ms |
600 KB |
Output is correct |
66 |
Correct |
3 ms |
604 KB |
Output is correct |
67 |
Correct |
3 ms |
600 KB |
Output is correct |
68 |
Correct |
9 ms |
604 KB |
Output is correct |
69 |
Correct |
9 ms |
600 KB |
Output is correct |
70 |
Correct |
13 ms |
1368 KB |
Output is correct |
71 |
Correct |
15 ms |
1116 KB |
Output is correct |
72 |
Correct |
9 ms |
860 KB |
Output is correct |
73 |
Correct |
9 ms |
860 KB |
Output is correct |
74 |
Correct |
9 ms |
624 KB |
Output is correct |
75 |
Correct |
9 ms |
860 KB |
Output is correct |
76 |
Correct |
1 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
3 ms |
348 KB |
Output is correct |
81 |
Correct |
17 ms |
1184 KB |
Output is correct |
82 |
Correct |
9 ms |
600 KB |
Output is correct |
83 |
Correct |
16 ms |
1336 KB |
Output is correct |
84 |
Correct |
18 ms |
1248 KB |
Output is correct |
85 |
Correct |
9 ms |
760 KB |
Output is correct |
86 |
Correct |
9 ms |
604 KB |
Output is correct |
87 |
Correct |
3 ms |
528 KB |
Output is correct |
88 |
Correct |
3 ms |
604 KB |
Output is correct |
89 |
Correct |
2 ms |
604 KB |
Output is correct |
90 |
Correct |
2 ms |
604 KB |
Output is correct |
91 |
Correct |
2 ms |
604 KB |
Output is correct |
92 |
Correct |
3 ms |
604 KB |
Output is correct |
93 |
Correct |
3 ms |
604 KB |
Output is correct |
94 |
Correct |
3 ms |
604 KB |
Output is correct |
95 |
Correct |
3 ms |
604 KB |
Output is correct |
96 |
Correct |
4 ms |
784 KB |
Output is correct |
97 |
Correct |
4 ms |
600 KB |
Output is correct |
98 |
Correct |
5 ms |
768 KB |
Output is correct |
99 |
Correct |
4 ms |
604 KB |
Output is correct |
100 |
Correct |
4 ms |
788 KB |
Output is correct |
101 |
Correct |
13 ms |
1000 KB |
Output is correct |
102 |
Correct |
14 ms |
1112 KB |
Output is correct |
103 |
Correct |
9 ms |
860 KB |
Output is correct |
104 |
Correct |
9 ms |
860 KB |
Output is correct |
105 |
Correct |
9 ms |
860 KB |
Output is correct |
106 |
Correct |
9 ms |
860 KB |
Output is correct |
107 |
Incorrect |
18 ms |
1296 KB |
Output isn't correct |
108 |
Halted |
0 ms |
0 KB |
- |