#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mx = 55;
const int mx2 = mx*mx*mx;
const ll inf = 1e18;
const ll ninf = -1e18;
ll m, l;
ll cnt_neg[mx];
ll cnt_pos[mx];
ll cnt_zero;
ll dp[mx2*2];
ll cnt_pos_good[mx];
ll cnt_pos_bad[mx];
ll cnt_neg_good[mx];
ll cnt_neg_bad[mx];
void solve(ll target, ll cur_cnt_sum) {
if(target >= mx2 || target < -mx2) {
cout << "impossible" << endl;
return;
}
dp[mx2 + target] = cur_cnt_sum;
for(int i = 1; i <= m; i++) {
/* positive good */
if(cnt_pos_good[i]) {
for(int residue = 0; residue < i; residue++) {
map<ll, ll> vals;
vector<ll> history;
ll t = 0;
for(int cur_pos = residue; cur_pos < mx2*2; cur_pos += i) {
ll tmp_val = dp[cur_pos] - t;
if(vals.size())
dp[cur_pos] = max(dp[cur_pos], vals.rbegin()->first + t);
vals[tmp_val]++;
history.push_back(tmp_val);
if(t >= cnt_pos_good[i]) {
ll tmp = history[t - cnt_pos_good[i]];
vals[tmp]--;
if(vals[tmp] == 0) vals.erase(tmp);
}
t++;
}
}
}
/* positive bad */
if(cnt_pos_bad[i]) {
for(int residue = 0; residue < i; residue++) {
map<ll, ll> vals;
vector<ll> history;
ll t = 0;
for(int cur_pos = residue; cur_pos < mx2*2; cur_pos += i) {
ll tmp_val = dp[cur_pos] + t;
if(vals.size())
dp[cur_pos] = max(dp[cur_pos], vals.rbegin()->first - t);
vals[tmp_val]++;
history.push_back(tmp_val);
if(t >= cnt_pos_bad[i]) {
ll tmp = history[t - cnt_pos_bad[i]];
vals[tmp]--;
if(vals[tmp] == 0) vals.erase(tmp);
}
t++;
}
}
}
/* negitive good */
if(cnt_neg_good[i]) {
for(int residue = 0; residue < i; residue++) {
map<ll, ll> vals;
vector<ll> history;
ll t = 0;
for(int cur_neg = mx2*2 - 1 - residue; cur_neg >= 0; cur_neg -= i) {
ll tmp_val = dp[cur_neg] - t;
if(vals.size())
dp[cur_neg] = max(dp[cur_neg], vals.rbegin()->first + t);
vals[tmp_val]++;
history.push_back(tmp_val);
if(t >= cnt_neg_good[i]) {
ll tmp = history[t - cnt_neg_good[i]];
vals[tmp]--;
if(vals[tmp] == 0) vals.erase(tmp);
}
t++;
}
}
}
/* negitive bad */
if(cnt_neg_bad[i]) {
for(int residue = 0; residue < i; residue++) {
map<ll, ll> vals;
vector<ll> history;
ll t = 0;
for(int cur_neg = mx2*2 - 1 - residue; cur_neg >= 0; cur_neg -= i) {
ll tmp_val = dp[cur_neg] + t;
if(vals.size())
dp[cur_neg] = max(dp[cur_neg], vals.rbegin()->first - t);
vals[tmp_val]++;
history.push_back(tmp_val);
if(t >= cnt_neg_bad[i]) {
ll tmp = history[t - cnt_neg_bad[i]];
vals[tmp]--;
if(vals[tmp] == 0) vals.erase(tmp);
}
t++;
}
}
}
}
if(dp[mx2] < 0) cout << "impossible" << endl;
else cout << dp[mx2] << endl;
}
void eq() {
ll total_cnt = cnt_zero;
for(int i = 1; i <= m; i++) {
total_cnt += cnt_neg[i] + cnt_pos[i];
}
cout << total_cnt << endl;
exit(0);
}
void more_pos() {
ll sum_neg = l;
for(int i = 1; i <= m; i++) {
sum_neg += cnt_neg[i] * i;
}
/* binary search: */
ll cnt_pos_used = 0;
for(ll delta = (1ll<<60); delta >= 1; delta >>= 1) {
ll test_value = cnt_pos_used + delta;
ll cur_sum = 0;
ll remaining = test_value;
for(int i = 1; i <= m; i++) {
if(cnt_pos[i] >= remaining) {
cur_sum += remaining * i;
remaining = 0;
break;
} else {
cur_sum += cnt_pos[i] * i;
remaining -= cnt_pos[i];
}
}
if(remaining > 0) continue;
if(cur_sum < sum_neg) cnt_pos_used = test_value;
}
cnt_pos_used++;
ll target = -sum_neg;
ll remaining = cnt_pos_used;
ll ans = cnt_pos_used + cnt_zero;
for(int i = 1; i <= m; i++) {
if(remaining <= cnt_pos[i]) {
cnt_pos_good[i] = cnt_pos[i] - remaining;
cnt_neg_bad[i] = remaining;
target += remaining * i;
remaining = 0;
} else {
cnt_neg_bad[i] = cnt_pos[i];
target += cnt_pos[i] * i;
remaining -= cnt_pos[i];
}
cnt_pos_bad[i] = cnt_neg[i];
ans += cnt_neg[i];
}
solve(target, ans);
}
void more_neg() {
for(int i = 1; i <= m; i++) {
swap(cnt_pos[i], cnt_neg[i]);
}
l *= -1;
more_pos();
}
main() {
for(int i = 0; i < mx2*2; i++) dp[i] = ninf;
cin >> m >> l;
ll sum_pos = 0;
ll sum_neg = 0;
for(int i = m; i >= 1; i--) {
cin >> cnt_neg[i];
sum_neg += cnt_neg[i] * i;
}
cin >> cnt_zero;
for(int i = 1; i <= m; i++) {
cin >> cnt_pos[i];
sum_pos += cnt_pos[i] * i;
}
if(sum_pos < l) {
cout << "impossible" << endl;
return 0;
}
if(sum_pos - sum_neg == l) eq();
if(sum_pos - sum_neg > l) more_pos();
if(sum_pos - sum_neg < l) more_neg();
}
Compilation message
vault.cpp:171:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
171 | main() {
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
9480 KB |
Output is correct |
2 |
Correct |
62 ms |
6224 KB |
Output is correct |
3 |
Correct |
52 ms |
9576 KB |
Output is correct |
4 |
Correct |
214 ms |
9560 KB |
Output is correct |
5 |
Correct |
1 ms |
2900 KB |
Output is correct |
6 |
Correct |
3145 ms |
9564 KB |
Output is correct |
7 |
Correct |
1413 ms |
6184 KB |
Output is correct |
8 |
Correct |
3120 ms |
9544 KB |
Output is correct |
9 |
Correct |
3493 ms |
9484 KB |
Output is correct |
10 |
Correct |
89 ms |
3028 KB |
Output is correct |
11 |
Correct |
162 ms |
3144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
9480 KB |
Output is correct |
2 |
Correct |
62 ms |
6224 KB |
Output is correct |
3 |
Correct |
52 ms |
9576 KB |
Output is correct |
4 |
Correct |
214 ms |
9560 KB |
Output is correct |
5 |
Correct |
1 ms |
2900 KB |
Output is correct |
6 |
Correct |
3145 ms |
9564 KB |
Output is correct |
7 |
Correct |
1413 ms |
6184 KB |
Output is correct |
8 |
Correct |
3120 ms |
9544 KB |
Output is correct |
9 |
Correct |
3493 ms |
9484 KB |
Output is correct |
10 |
Correct |
89 ms |
3028 KB |
Output is correct |
11 |
Correct |
162 ms |
3144 KB |
Output is correct |
12 |
Correct |
110 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
6192 KB |
Output is correct |
14 |
Correct |
52 ms |
9600 KB |
Output is correct |
15 |
Correct |
212 ms |
9528 KB |
Output is correct |
16 |
Correct |
1 ms |
2900 KB |
Output is correct |
17 |
Correct |
3163 ms |
9604 KB |
Output is correct |
18 |
Correct |
1384 ms |
6204 KB |
Output is correct |
19 |
Correct |
3111 ms |
9540 KB |
Output is correct |
20 |
Correct |
3471 ms |
9588 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
161 ms |
3012 KB |
Output is correct |
23 |
Execution timed out |
5072 ms |
9588 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
230 ms |
9520 KB |
Output is correct |
2 |
Correct |
791 ms |
10712 KB |
Output is correct |
3 |
Correct |
256 ms |
4580 KB |
Output is correct |
4 |
Correct |
839 ms |
14624 KB |
Output is correct |
5 |
Correct |
785 ms |
8032 KB |
Output is correct |
6 |
Correct |
971 ms |
26236 KB |
Output is correct |
7 |
Correct |
53 ms |
3700 KB |
Output is correct |
8 |
Correct |
139 ms |
3712 KB |
Output is correct |
9 |
Correct |
532 ms |
26296 KB |
Output is correct |
10 |
Correct |
607 ms |
7096 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
230 ms |
9520 KB |
Output is correct |
2 |
Correct |
791 ms |
10712 KB |
Output is correct |
3 |
Correct |
256 ms |
4580 KB |
Output is correct |
4 |
Correct |
839 ms |
14624 KB |
Output is correct |
5 |
Correct |
785 ms |
8032 KB |
Output is correct |
6 |
Correct |
971 ms |
26236 KB |
Output is correct |
7 |
Correct |
53 ms |
3700 KB |
Output is correct |
8 |
Correct |
139 ms |
3712 KB |
Output is correct |
9 |
Correct |
532 ms |
26296 KB |
Output is correct |
10 |
Correct |
607 ms |
7096 KB |
Output is correct |
11 |
Correct |
109 ms |
9536 KB |
Output is correct |
12 |
Correct |
67 ms |
6200 KB |
Output is correct |
13 |
Correct |
51 ms |
9500 KB |
Output is correct |
14 |
Correct |
216 ms |
9696 KB |
Output is correct |
15 |
Correct |
763 ms |
10636 KB |
Output is correct |
16 |
Correct |
260 ms |
4628 KB |
Output is correct |
17 |
Correct |
819 ms |
14580 KB |
Output is correct |
18 |
Correct |
785 ms |
8064 KB |
Output is correct |
19 |
Correct |
963 ms |
26304 KB |
Output is correct |
20 |
Correct |
53 ms |
3700 KB |
Output is correct |
21 |
Correct |
140 ms |
3604 KB |
Output is correct |
22 |
Correct |
531 ms |
26328 KB |
Output is correct |
23 |
Correct |
602 ms |
7100 KB |
Output is correct |
24 |
Correct |
1449 ms |
10812 KB |
Output is correct |
25 |
Correct |
702 ms |
5464 KB |
Output is correct |
26 |
Correct |
1995 ms |
9596 KB |
Output is correct |
27 |
Correct |
1459 ms |
9592 KB |
Output is correct |
28 |
Correct |
2031 ms |
26228 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
230 ms |
9520 KB |
Output is correct |
2 |
Correct |
791 ms |
10712 KB |
Output is correct |
3 |
Correct |
256 ms |
4580 KB |
Output is correct |
4 |
Correct |
839 ms |
14624 KB |
Output is correct |
5 |
Correct |
785 ms |
8032 KB |
Output is correct |
6 |
Correct |
971 ms |
26236 KB |
Output is correct |
7 |
Correct |
53 ms |
3700 KB |
Output is correct |
8 |
Correct |
139 ms |
3712 KB |
Output is correct |
9 |
Correct |
532 ms |
26296 KB |
Output is correct |
10 |
Correct |
607 ms |
7096 KB |
Output is correct |
11 |
Correct |
222 ms |
9592 KB |
Output is correct |
12 |
Correct |
773 ms |
10604 KB |
Output is correct |
13 |
Correct |
261 ms |
4552 KB |
Output is correct |
14 |
Correct |
838 ms |
14736 KB |
Output is correct |
15 |
Correct |
785 ms |
8032 KB |
Output is correct |
16 |
Correct |
973 ms |
26320 KB |
Output is correct |
17 |
Correct |
58 ms |
3764 KB |
Output is correct |
18 |
Correct |
142 ms |
3704 KB |
Output is correct |
19 |
Correct |
533 ms |
26248 KB |
Output is correct |
20 |
Correct |
599 ms |
7100 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
178 ms |
3028 KB |
Output is correct |
23 |
Correct |
1213 ms |
8052 KB |
Output is correct |
24 |
Correct |
550 ms |
4728 KB |
Output is correct |
25 |
Correct |
1178 ms |
26292 KB |
Output is correct |
26 |
Correct |
1260 ms |
14616 KB |
Output is correct |
27 |
Correct |
1668 ms |
26328 KB |
Output is correct |
28 |
Correct |
986 ms |
8760 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
9480 KB |
Output is correct |
2 |
Correct |
62 ms |
6224 KB |
Output is correct |
3 |
Correct |
52 ms |
9576 KB |
Output is correct |
4 |
Correct |
214 ms |
9560 KB |
Output is correct |
5 |
Correct |
1 ms |
2900 KB |
Output is correct |
6 |
Correct |
3145 ms |
9564 KB |
Output is correct |
7 |
Correct |
1413 ms |
6184 KB |
Output is correct |
8 |
Correct |
3120 ms |
9544 KB |
Output is correct |
9 |
Correct |
3493 ms |
9484 KB |
Output is correct |
10 |
Correct |
89 ms |
3028 KB |
Output is correct |
11 |
Correct |
162 ms |
3144 KB |
Output is correct |
12 |
Correct |
230 ms |
9520 KB |
Output is correct |
13 |
Correct |
791 ms |
10712 KB |
Output is correct |
14 |
Correct |
256 ms |
4580 KB |
Output is correct |
15 |
Correct |
839 ms |
14624 KB |
Output is correct |
16 |
Correct |
785 ms |
8032 KB |
Output is correct |
17 |
Correct |
971 ms |
26236 KB |
Output is correct |
18 |
Correct |
53 ms |
3700 KB |
Output is correct |
19 |
Correct |
139 ms |
3712 KB |
Output is correct |
20 |
Correct |
532 ms |
26296 KB |
Output is correct |
21 |
Correct |
607 ms |
7096 KB |
Output is correct |
22 |
Correct |
109 ms |
9536 KB |
Output is correct |
23 |
Correct |
67 ms |
6200 KB |
Output is correct |
24 |
Correct |
51 ms |
9500 KB |
Output is correct |
25 |
Correct |
216 ms |
9696 KB |
Output is correct |
26 |
Correct |
763 ms |
10636 KB |
Output is correct |
27 |
Correct |
260 ms |
4628 KB |
Output is correct |
28 |
Correct |
819 ms |
14580 KB |
Output is correct |
29 |
Correct |
785 ms |
8064 KB |
Output is correct |
30 |
Correct |
963 ms |
26304 KB |
Output is correct |
31 |
Correct |
53 ms |
3700 KB |
Output is correct |
32 |
Correct |
140 ms |
3604 KB |
Output is correct |
33 |
Correct |
531 ms |
26328 KB |
Output is correct |
34 |
Correct |
602 ms |
7100 KB |
Output is correct |
35 |
Correct |
1449 ms |
10812 KB |
Output is correct |
36 |
Correct |
702 ms |
5464 KB |
Output is correct |
37 |
Correct |
1995 ms |
9596 KB |
Output is correct |
38 |
Correct |
1459 ms |
9592 KB |
Output is correct |
39 |
Correct |
2031 ms |
26228 KB |
Output is correct |
40 |
Correct |
222 ms |
9592 KB |
Output is correct |
41 |
Correct |
773 ms |
10604 KB |
Output is correct |
42 |
Correct |
261 ms |
4552 KB |
Output is correct |
43 |
Correct |
838 ms |
14736 KB |
Output is correct |
44 |
Correct |
785 ms |
8032 KB |
Output is correct |
45 |
Correct |
973 ms |
26320 KB |
Output is correct |
46 |
Correct |
58 ms |
3764 KB |
Output is correct |
47 |
Correct |
142 ms |
3704 KB |
Output is correct |
48 |
Correct |
533 ms |
26248 KB |
Output is correct |
49 |
Correct |
599 ms |
7100 KB |
Output is correct |
50 |
Correct |
90 ms |
3028 KB |
Output is correct |
51 |
Correct |
178 ms |
3028 KB |
Output is correct |
52 |
Correct |
1213 ms |
8052 KB |
Output is correct |
53 |
Correct |
550 ms |
4728 KB |
Output is correct |
54 |
Correct |
1178 ms |
26292 KB |
Output is correct |
55 |
Correct |
1260 ms |
14616 KB |
Output is correct |
56 |
Correct |
1668 ms |
26328 KB |
Output is correct |
57 |
Correct |
986 ms |
8760 KB |
Output is correct |
58 |
Correct |
110 ms |
9588 KB |
Output is correct |
59 |
Correct |
66 ms |
6260 KB |
Output is correct |
60 |
Correct |
55 ms |
9488 KB |
Output is correct |
61 |
Correct |
212 ms |
9588 KB |
Output is correct |
62 |
Correct |
2 ms |
2900 KB |
Output is correct |
63 |
Correct |
3249 ms |
9548 KB |
Output is correct |
64 |
Correct |
1446 ms |
6228 KB |
Output is correct |
65 |
Correct |
3439 ms |
9552 KB |
Output is correct |
66 |
Correct |
3739 ms |
9580 KB |
Output is correct |
67 |
Correct |
110 ms |
3016 KB |
Output is correct |
68 |
Correct |
178 ms |
3020 KB |
Output is correct |
69 |
Correct |
877 ms |
10712 KB |
Output is correct |
70 |
Correct |
285 ms |
4536 KB |
Output is correct |
71 |
Correct |
912 ms |
14624 KB |
Output is correct |
72 |
Correct |
866 ms |
7912 KB |
Output is correct |
73 |
Correct |
1053 ms |
26276 KB |
Output is correct |
74 |
Correct |
67 ms |
3768 KB |
Output is correct |
75 |
Correct |
147 ms |
3704 KB |
Output is correct |
76 |
Correct |
570 ms |
26288 KB |
Output is correct |
77 |
Correct |
663 ms |
7120 KB |
Output is correct |
78 |
Correct |
1573 ms |
10716 KB |
Output is correct |
79 |
Correct |
749 ms |
5456 KB |
Output is correct |
80 |
Correct |
2186 ms |
9556 KB |
Output is correct |
81 |
Correct |
1577 ms |
9532 KB |
Output is correct |
82 |
Correct |
2185 ms |
26336 KB |
Output is correct |
83 |
Correct |
1365 ms |
8028 KB |
Output is correct |
84 |
Correct |
662 ms |
4800 KB |
Output is correct |
85 |
Correct |
1254 ms |
26232 KB |
Output is correct |
86 |
Correct |
1390 ms |
14612 KB |
Output is correct |
87 |
Correct |
1844 ms |
26320 KB |
Output is correct |
88 |
Correct |
1082 ms |
8752 KB |
Output is correct |
89 |
Correct |
2543 ms |
14616 KB |
Output is correct |
90 |
Correct |
2891 ms |
26272 KB |
Output is correct |
91 |
Correct |
2973 ms |
26336 KB |
Output is correct |
92 |
Correct |
3676 ms |
26340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
230 ms |
9520 KB |
Output is correct |
2 |
Correct |
791 ms |
10712 KB |
Output is correct |
3 |
Correct |
256 ms |
4580 KB |
Output is correct |
4 |
Correct |
839 ms |
14624 KB |
Output is correct |
5 |
Correct |
785 ms |
8032 KB |
Output is correct |
6 |
Correct |
971 ms |
26236 KB |
Output is correct |
7 |
Correct |
53 ms |
3700 KB |
Output is correct |
8 |
Correct |
139 ms |
3712 KB |
Output is correct |
9 |
Correct |
532 ms |
26296 KB |
Output is correct |
10 |
Correct |
607 ms |
7096 KB |
Output is correct |
11 |
Correct |
222 ms |
9592 KB |
Output is correct |
12 |
Correct |
773 ms |
10604 KB |
Output is correct |
13 |
Correct |
261 ms |
4552 KB |
Output is correct |
14 |
Correct |
838 ms |
14736 KB |
Output is correct |
15 |
Correct |
785 ms |
8032 KB |
Output is correct |
16 |
Correct |
973 ms |
26320 KB |
Output is correct |
17 |
Correct |
58 ms |
3764 KB |
Output is correct |
18 |
Correct |
142 ms |
3704 KB |
Output is correct |
19 |
Correct |
533 ms |
26248 KB |
Output is correct |
20 |
Correct |
599 ms |
7100 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
178 ms |
3028 KB |
Output is correct |
23 |
Correct |
1213 ms |
8052 KB |
Output is correct |
24 |
Correct |
550 ms |
4728 KB |
Output is correct |
25 |
Correct |
1178 ms |
26292 KB |
Output is correct |
26 |
Correct |
1260 ms |
14616 KB |
Output is correct |
27 |
Correct |
1668 ms |
26328 KB |
Output is correct |
28 |
Correct |
986 ms |
8760 KB |
Output is correct |
29 |
Correct |
223 ms |
9548 KB |
Output is correct |
30 |
Correct |
822 ms |
10712 KB |
Output is correct |
31 |
Correct |
260 ms |
4480 KB |
Output is correct |
32 |
Correct |
909 ms |
14612 KB |
Output is correct |
33 |
Correct |
836 ms |
8028 KB |
Output is correct |
34 |
Correct |
984 ms |
26328 KB |
Output is correct |
35 |
Correct |
58 ms |
3700 KB |
Output is correct |
36 |
Correct |
146 ms |
3684 KB |
Output is correct |
37 |
Correct |
567 ms |
26284 KB |
Output is correct |
38 |
Correct |
619 ms |
7076 KB |
Output is correct |
39 |
Correct |
99 ms |
3028 KB |
Output is correct |
40 |
Correct |
172 ms |
3028 KB |
Output is correct |
41 |
Correct |
1371 ms |
8024 KB |
Output is correct |
42 |
Correct |
592 ms |
4808 KB |
Output is correct |
43 |
Correct |
1244 ms |
26324 KB |
Output is correct |
44 |
Correct |
1349 ms |
14700 KB |
Output is correct |
45 |
Correct |
1729 ms |
26316 KB |
Output is correct |
46 |
Correct |
1016 ms |
8828 KB |
Output is correct |
47 |
Incorrect |
2 ms |
2900 KB |
Output isn't correct |
48 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
9480 KB |
Output is correct |
2 |
Correct |
62 ms |
6224 KB |
Output is correct |
3 |
Correct |
52 ms |
9576 KB |
Output is correct |
4 |
Correct |
214 ms |
9560 KB |
Output is correct |
5 |
Correct |
1 ms |
2900 KB |
Output is correct |
6 |
Correct |
3145 ms |
9564 KB |
Output is correct |
7 |
Correct |
1413 ms |
6184 KB |
Output is correct |
8 |
Correct |
3120 ms |
9544 KB |
Output is correct |
9 |
Correct |
3493 ms |
9484 KB |
Output is correct |
10 |
Correct |
89 ms |
3028 KB |
Output is correct |
11 |
Correct |
162 ms |
3144 KB |
Output is correct |
12 |
Correct |
110 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
6192 KB |
Output is correct |
14 |
Correct |
52 ms |
9600 KB |
Output is correct |
15 |
Correct |
212 ms |
9528 KB |
Output is correct |
16 |
Correct |
1 ms |
2900 KB |
Output is correct |
17 |
Correct |
3163 ms |
9604 KB |
Output is correct |
18 |
Correct |
1384 ms |
6204 KB |
Output is correct |
19 |
Correct |
3111 ms |
9540 KB |
Output is correct |
20 |
Correct |
3471 ms |
9588 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
161 ms |
3012 KB |
Output is correct |
23 |
Execution timed out |
5072 ms |
9588 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
230 ms |
9520 KB |
Output is correct |
2 |
Correct |
791 ms |
10712 KB |
Output is correct |
3 |
Correct |
256 ms |
4580 KB |
Output is correct |
4 |
Correct |
839 ms |
14624 KB |
Output is correct |
5 |
Correct |
785 ms |
8032 KB |
Output is correct |
6 |
Correct |
971 ms |
26236 KB |
Output is correct |
7 |
Correct |
53 ms |
3700 KB |
Output is correct |
8 |
Correct |
139 ms |
3712 KB |
Output is correct |
9 |
Correct |
532 ms |
26296 KB |
Output is correct |
10 |
Correct |
607 ms |
7096 KB |
Output is correct |
11 |
Correct |
222 ms |
9592 KB |
Output is correct |
12 |
Correct |
773 ms |
10604 KB |
Output is correct |
13 |
Correct |
261 ms |
4552 KB |
Output is correct |
14 |
Correct |
838 ms |
14736 KB |
Output is correct |
15 |
Correct |
785 ms |
8032 KB |
Output is correct |
16 |
Correct |
973 ms |
26320 KB |
Output is correct |
17 |
Correct |
58 ms |
3764 KB |
Output is correct |
18 |
Correct |
142 ms |
3704 KB |
Output is correct |
19 |
Correct |
533 ms |
26248 KB |
Output is correct |
20 |
Correct |
599 ms |
7100 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
178 ms |
3028 KB |
Output is correct |
23 |
Correct |
1213 ms |
8052 KB |
Output is correct |
24 |
Correct |
550 ms |
4728 KB |
Output is correct |
25 |
Correct |
1178 ms |
26292 KB |
Output is correct |
26 |
Correct |
1260 ms |
14616 KB |
Output is correct |
27 |
Correct |
1668 ms |
26328 KB |
Output is correct |
28 |
Correct |
986 ms |
8760 KB |
Output is correct |
29 |
Correct |
223 ms |
9548 KB |
Output is correct |
30 |
Correct |
822 ms |
10712 KB |
Output is correct |
31 |
Correct |
260 ms |
4480 KB |
Output is correct |
32 |
Correct |
909 ms |
14612 KB |
Output is correct |
33 |
Correct |
836 ms |
8028 KB |
Output is correct |
34 |
Correct |
984 ms |
26328 KB |
Output is correct |
35 |
Correct |
58 ms |
3700 KB |
Output is correct |
36 |
Correct |
146 ms |
3684 KB |
Output is correct |
37 |
Correct |
567 ms |
26284 KB |
Output is correct |
38 |
Correct |
619 ms |
7076 KB |
Output is correct |
39 |
Correct |
99 ms |
3028 KB |
Output is correct |
40 |
Correct |
172 ms |
3028 KB |
Output is correct |
41 |
Correct |
1371 ms |
8024 KB |
Output is correct |
42 |
Correct |
592 ms |
4808 KB |
Output is correct |
43 |
Correct |
1244 ms |
26324 KB |
Output is correct |
44 |
Correct |
1349 ms |
14700 KB |
Output is correct |
45 |
Correct |
1729 ms |
26316 KB |
Output is correct |
46 |
Correct |
1016 ms |
8828 KB |
Output is correct |
47 |
Incorrect |
2 ms |
2900 KB |
Output isn't correct |
48 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
9480 KB |
Output is correct |
2 |
Correct |
62 ms |
6224 KB |
Output is correct |
3 |
Correct |
52 ms |
9576 KB |
Output is correct |
4 |
Correct |
214 ms |
9560 KB |
Output is correct |
5 |
Correct |
1 ms |
2900 KB |
Output is correct |
6 |
Correct |
3145 ms |
9564 KB |
Output is correct |
7 |
Correct |
1413 ms |
6184 KB |
Output is correct |
8 |
Correct |
3120 ms |
9544 KB |
Output is correct |
9 |
Correct |
3493 ms |
9484 KB |
Output is correct |
10 |
Correct |
89 ms |
3028 KB |
Output is correct |
11 |
Correct |
162 ms |
3144 KB |
Output is correct |
12 |
Correct |
110 ms |
9556 KB |
Output is correct |
13 |
Correct |
66 ms |
6192 KB |
Output is correct |
14 |
Correct |
52 ms |
9600 KB |
Output is correct |
15 |
Correct |
212 ms |
9528 KB |
Output is correct |
16 |
Correct |
1 ms |
2900 KB |
Output is correct |
17 |
Correct |
3163 ms |
9604 KB |
Output is correct |
18 |
Correct |
1384 ms |
6204 KB |
Output is correct |
19 |
Correct |
3111 ms |
9540 KB |
Output is correct |
20 |
Correct |
3471 ms |
9588 KB |
Output is correct |
21 |
Correct |
90 ms |
3028 KB |
Output is correct |
22 |
Correct |
161 ms |
3012 KB |
Output is correct |
23 |
Execution timed out |
5072 ms |
9588 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |