#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2", "popcnt")
using namespace std;
typedef long long ll;
const int N = 3000 + 7;
const int M = 15000 + 7;
int n, m, a[M], b[M];
int vertical[M];
int rest[M];
struct MyBitset {
vector<ll> b;
int n;
void resize(int nn) {
n = nn;
b.resize(n / 63 + 2, 0);
}
void set(int x) {
b[x / 63] |= (1LL << rest[x]);
}
bool get(int x) {
if (x > n) {
return 0;
}
if (b[x / 63] & (1LL << rest[x])) {
return true;
} else {
return false;
}
}
};
int f[M];
void add(int i, int x) {
for (; i <= n; i += i & -i) f[i] += x;
}
int get(int i) {
int res = 0;
for (; i >= 1; i -= i & -i) res += f[i];
return res;
}
int get_next(int x) {
int l = 1, r = x, sol = 0;
while (l <= r) {
int m = (l + r) / 2;
if (get(x) - get(m - 1) >= 1) {
l = m + 1;
sol = m;
} else {
r = m - 1;
}
}
return sol;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
cin >> m;
for (int i = 1; i <= m; ++i) cin >> b[i];
int sumA = 0;
for (int i = 1; i <= n; ++i) {
sumA += a[i];
}
reverse(b + 1, b + m + 1);
for (int i = 1; i <= sumA; ++i) {
rest[i] = i % 63;
for (int j = 1; j <= n; ++j) {
vertical[i] += min(i, a[j]);
}
}
vector<vector<MyBitset>> dp(m + 1, vector<MyBitset>(sumA + 1));
dp[0][0].resize(1);
dp[0][0].set(0);
for (int i = 1; i <= m; ++i) {
for (int sum = 0; sum <= sumA; ++sum) {
dp[i][sum].resize(sum / b[i]);
}
for (int x = 0; x <= sumA / b[i]; ++x) {
for (int sum = x * b[i]; sum <= vertical[x]; ++sum) {
if (vertical[x] >= sum) {
bool b1 = (x == 0 ? 0 : dp[i][sum - b[i]].get(x - 1));
bool b2 = dp[i - 1][sum].get(x);
if (b1 | b2) {
dp[i][sum].set(x);
}
// dp[i][sum][x] = dp[i][x - 1][sum - b[i]] | dp[i - 1][x][sum];
}
}
}
}
for (int x = 1; x <= sumA / b[m]; ++x) {
if (dp[m][sumA].get(x) == true) {
cout << x << "\n";
vector<pair<int, int>> boxes;
int cnt = x;
int sum = sumA;
int pos = m;
while (pos > 0) {
if (cnt != 0 && dp[pos][sum - b[pos]].get(cnt - 1)) {
boxes.push_back({b[pos], boxes.size()});
sum -= b[pos];
cnt--;
} else {
assert(dp[pos - 1][sum].get(cnt) == 1);
pos--;
}
}
vector<vector<int>> sol(boxes.size());
vector<vector<int>> occ(n + 1);
sort(boxes.rbegin(), boxes.rend());
for (int i = 0; i < boxes.size(); ++i) {
occ[boxes[i].first].push_back(boxes[i].second);
add(boxes[i].first, 1);
}
for (int it = 1; it <= n; ++it) {
vector<int> mod;
int x = get_next(n);
int val = a[it];
while (a[it] > 0) {
int steps = min(a[it], (int) occ[x].size());
for (int i = 1; i <= steps; ++i) {
mod.push_back(x);
}
a[it] -= steps;
x = get_next(x - 1);
}
reverse(mod.begin(), mod.end());
for (auto i : mod) {
assert(occ[i].size() > 0);
int x = occ[i].back();
occ[i].pop_back();
add(i, -1);
sol[x].push_back(it);
if (i >= 2) {
add(i - 1, 1);
occ[i - 1].push_back(x);
}
}
}
for (int i = 0; i < boxes.size(); ++i) {
cout << sol[i].size() << " ";
for (auto j : sol[i]) {
cout << j << " ";
}
cout << "\n";
}
return 0;
}
}
cout << -1 << "\n";
return 0;
}
Compilation message
cookies.cpp: In function 'int main()':
cookies.cpp:127:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
127 | for (int i = 0; i < boxes.size(); ++i) {
| ~~^~~~~~~~~~~~~~
cookies.cpp:134:21: warning: unused variable 'val' [-Wunused-variable]
134 | int val = a[it];
| ^~~
cookies.cpp:160:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
160 | for (int i = 0; i < boxes.size(); ++i) {
| ~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
392 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
16220 KB |
Output is correct |
11 |
Correct |
8 ms |
8284 KB |
Output is correct |
12 |
Correct |
3 ms |
1704 KB |
Output is correct |
13 |
Correct |
5 ms |
4444 KB |
Output is correct |
14 |
Correct |
7 ms |
7516 KB |
Output is correct |
15 |
Correct |
7 ms |
7260 KB |
Output is correct |
16 |
Correct |
8 ms |
8028 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
4 ms |
3668 KB |
Output is correct |
22 |
Correct |
8 ms |
8240 KB |
Output is correct |
23 |
Correct |
8 ms |
8284 KB |
Output is correct |
24 |
Correct |
1 ms |
1372 KB |
Output is correct |
25 |
Correct |
2 ms |
1372 KB |
Output is correct |
26 |
Correct |
1 ms |
1372 KB |
Output is correct |
27 |
Correct |
1 ms |
1372 KB |
Output is correct |
28 |
Correct |
5 ms |
4956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
1372 KB |
Output is correct |
10 |
Correct |
10 ms |
17000 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
404 KB |
Output is correct |
17 |
Correct |
0 ms |
424 KB |
Output is correct |
18 |
Correct |
18 ms |
5760 KB |
Output is correct |
19 |
Correct |
105 ms |
6792 KB |
Output is correct |
20 |
Correct |
5 ms |
2176 KB |
Output is correct |
21 |
Correct |
3 ms |
2180 KB |
Output is correct |
22 |
Correct |
3 ms |
1928 KB |
Output is correct |
23 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 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 |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
428 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
392 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
16220 KB |
Output is correct |
11 |
Correct |
8 ms |
8284 KB |
Output is correct |
12 |
Correct |
3 ms |
1704 KB |
Output is correct |
13 |
Correct |
5 ms |
4444 KB |
Output is correct |
14 |
Correct |
7 ms |
7516 KB |
Output is correct |
15 |
Correct |
7 ms |
7260 KB |
Output is correct |
16 |
Correct |
8 ms |
8028 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
4 ms |
3668 KB |
Output is correct |
22 |
Correct |
8 ms |
8240 KB |
Output is correct |
23 |
Correct |
8 ms |
8284 KB |
Output is correct |
24 |
Correct |
1 ms |
1372 KB |
Output is correct |
25 |
Correct |
2 ms |
1372 KB |
Output is correct |
26 |
Correct |
1 ms |
1372 KB |
Output is correct |
27 |
Correct |
1 ms |
1372 KB |
Output is correct |
28 |
Correct |
5 ms |
4956 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
344 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
428 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
0 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
1116 KB |
Output is correct |
71 |
Correct |
1 ms |
860 KB |
Output is correct |
72 |
Correct |
1 ms |
860 KB |
Output is correct |
73 |
Correct |
1 ms |
600 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
944 KB |
Output is correct |
76 |
Correct |
1 ms |
860 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
2 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
0 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
600 KB |
Output is correct |
84 |
Correct |
2 ms |
1884 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
2 ms |
1116 KB |
Output is correct |
87 |
Correct |
2 ms |
1116 KB |
Output is correct |
88 |
Correct |
2 ms |
1116 KB |
Output is correct |
89 |
Correct |
2 ms |
1116 KB |
Output is correct |
90 |
Correct |
2 ms |
1116 KB |
Output is correct |
91 |
Correct |
2 ms |
1116 KB |
Output is correct |
92 |
Correct |
2 ms |
1884 KB |
Output is correct |
93 |
Correct |
13 ms |
14172 KB |
Output is correct |
94 |
Correct |
9 ms |
7772 KB |
Output is correct |
95 |
Correct |
1 ms |
860 KB |
Output is correct |
96 |
Correct |
1 ms |
604 KB |
Output is correct |
97 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
392 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
16220 KB |
Output is correct |
11 |
Correct |
8 ms |
8284 KB |
Output is correct |
12 |
Correct |
3 ms |
1704 KB |
Output is correct |
13 |
Correct |
5 ms |
4444 KB |
Output is correct |
14 |
Correct |
7 ms |
7516 KB |
Output is correct |
15 |
Correct |
7 ms |
7260 KB |
Output is correct |
16 |
Correct |
8 ms |
8028 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
4 ms |
3668 KB |
Output is correct |
22 |
Correct |
8 ms |
8240 KB |
Output is correct |
23 |
Correct |
8 ms |
8284 KB |
Output is correct |
24 |
Correct |
1 ms |
1372 KB |
Output is correct |
25 |
Correct |
2 ms |
1372 KB |
Output is correct |
26 |
Correct |
1 ms |
1372 KB |
Output is correct |
27 |
Correct |
1 ms |
1372 KB |
Output is correct |
28 |
Correct |
5 ms |
4956 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
344 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
1 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
428 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
0 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
1116 KB |
Output is correct |
71 |
Correct |
1 ms |
860 KB |
Output is correct |
72 |
Correct |
1 ms |
860 KB |
Output is correct |
73 |
Correct |
1 ms |
600 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
944 KB |
Output is correct |
76 |
Correct |
1 ms |
860 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
2 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
0 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
600 KB |
Output is correct |
84 |
Correct |
2 ms |
1884 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
2 ms |
1116 KB |
Output is correct |
87 |
Correct |
2 ms |
1116 KB |
Output is correct |
88 |
Correct |
2 ms |
1116 KB |
Output is correct |
89 |
Correct |
2 ms |
1116 KB |
Output is correct |
90 |
Correct |
2 ms |
1116 KB |
Output is correct |
91 |
Correct |
2 ms |
1116 KB |
Output is correct |
92 |
Correct |
2 ms |
1884 KB |
Output is correct |
93 |
Correct |
13 ms |
14172 KB |
Output is correct |
94 |
Correct |
9 ms |
7772 KB |
Output is correct |
95 |
Correct |
1 ms |
860 KB |
Output is correct |
96 |
Correct |
1 ms |
604 KB |
Output is correct |
97 |
Correct |
1 ms |
604 KB |
Output is correct |
98 |
Correct |
1 ms |
1368 KB |
Output is correct |
99 |
Correct |
1 ms |
600 KB |
Output is correct |
100 |
Correct |
14 ms |
2444 KB |
Output is correct |
101 |
Correct |
6 ms |
2652 KB |
Output is correct |
102 |
Correct |
7 ms |
2908 KB |
Output is correct |
103 |
Correct |
41 ms |
7024 KB |
Output is correct |
104 |
Correct |
39 ms |
6788 KB |
Output is correct |
105 |
Correct |
96 ms |
45136 KB |
Output is correct |
106 |
Correct |
512 ms |
515668 KB |
Output is correct |
107 |
Correct |
296 ms |
276564 KB |
Output is correct |
108 |
Correct |
43 ms |
9040 KB |
Output is correct |
109 |
Correct |
31 ms |
3664 KB |
Output is correct |
110 |
Correct |
28 ms |
3824 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
392 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
18 ms |
16220 KB |
Output is correct |
11 |
Correct |
8 ms |
8284 KB |
Output is correct |
12 |
Correct |
3 ms |
1704 KB |
Output is correct |
13 |
Correct |
5 ms |
4444 KB |
Output is correct |
14 |
Correct |
7 ms |
7516 KB |
Output is correct |
15 |
Correct |
7 ms |
7260 KB |
Output is correct |
16 |
Correct |
8 ms |
8028 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
1 ms |
600 KB |
Output is correct |
19 |
Correct |
1 ms |
600 KB |
Output is correct |
20 |
Correct |
1 ms |
604 KB |
Output is correct |
21 |
Correct |
4 ms |
3668 KB |
Output is correct |
22 |
Correct |
8 ms |
8240 KB |
Output is correct |
23 |
Correct |
8 ms |
8284 KB |
Output is correct |
24 |
Correct |
1 ms |
1372 KB |
Output is correct |
25 |
Correct |
2 ms |
1372 KB |
Output is correct |
26 |
Correct |
1 ms |
1372 KB |
Output is correct |
27 |
Correct |
1 ms |
1372 KB |
Output is correct |
28 |
Correct |
5 ms |
4956 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
1372 KB |
Output is correct |
38 |
Correct |
10 ms |
17000 KB |
Output is correct |
39 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
404 KB |
Output is correct |
45 |
Correct |
0 ms |
424 KB |
Output is correct |
46 |
Correct |
18 ms |
5760 KB |
Output is correct |
47 |
Correct |
105 ms |
6792 KB |
Output is correct |
48 |
Correct |
5 ms |
2176 KB |
Output is correct |
49 |
Correct |
3 ms |
2180 KB |
Output is correct |
50 |
Correct |
3 ms |
1928 KB |
Output is correct |
51 |
Correct |
1 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
344 KB |
Output is correct |
53 |
Correct |
0 ms |
344 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
344 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
0 ms |
348 KB |
Output is correct |
67 |
Correct |
0 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
0 ms |
348 KB |
Output is correct |
71 |
Correct |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
348 KB |
Output is correct |
73 |
Correct |
1 ms |
344 KB |
Output is correct |
74 |
Correct |
0 ms |
348 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
0 ms |
428 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 |
0 ms |
348 KB |
Output is correct |
81 |
Correct |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
0 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
0 ms |
348 KB |
Output is correct |
90 |
Correct |
0 ms |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
1116 KB |
Output is correct |
94 |
Correct |
1 ms |
860 KB |
Output is correct |
95 |
Correct |
1 ms |
860 KB |
Output is correct |
96 |
Correct |
1 ms |
600 KB |
Output is correct |
97 |
Correct |
1 ms |
604 KB |
Output is correct |
98 |
Correct |
1 ms |
944 KB |
Output is correct |
99 |
Correct |
1 ms |
860 KB |
Output is correct |
100 |
Correct |
1 ms |
604 KB |
Output is correct |
101 |
Correct |
2 ms |
604 KB |
Output is correct |
102 |
Correct |
1 ms |
604 KB |
Output is correct |
103 |
Correct |
1 ms |
604 KB |
Output is correct |
104 |
Correct |
0 ms |
604 KB |
Output is correct |
105 |
Correct |
1 ms |
860 KB |
Output is correct |
106 |
Correct |
1 ms |
600 KB |
Output is correct |
107 |
Correct |
2 ms |
1884 KB |
Output is correct |
108 |
Correct |
1 ms |
604 KB |
Output is correct |
109 |
Correct |
2 ms |
1116 KB |
Output is correct |
110 |
Correct |
2 ms |
1116 KB |
Output is correct |
111 |
Correct |
2 ms |
1116 KB |
Output is correct |
112 |
Correct |
2 ms |
1116 KB |
Output is correct |
113 |
Correct |
2 ms |
1116 KB |
Output is correct |
114 |
Correct |
2 ms |
1116 KB |
Output is correct |
115 |
Correct |
2 ms |
1884 KB |
Output is correct |
116 |
Correct |
13 ms |
14172 KB |
Output is correct |
117 |
Correct |
9 ms |
7772 KB |
Output is correct |
118 |
Correct |
1 ms |
860 KB |
Output is correct |
119 |
Correct |
1 ms |
604 KB |
Output is correct |
120 |
Correct |
1 ms |
604 KB |
Output is correct |
121 |
Correct |
1 ms |
1368 KB |
Output is correct |
122 |
Correct |
1 ms |
600 KB |
Output is correct |
123 |
Correct |
14 ms |
2444 KB |
Output is correct |
124 |
Correct |
6 ms |
2652 KB |
Output is correct |
125 |
Correct |
7 ms |
2908 KB |
Output is correct |
126 |
Correct |
41 ms |
7024 KB |
Output is correct |
127 |
Correct |
39 ms |
6788 KB |
Output is correct |
128 |
Correct |
96 ms |
45136 KB |
Output is correct |
129 |
Correct |
512 ms |
515668 KB |
Output is correct |
130 |
Correct |
296 ms |
276564 KB |
Output is correct |
131 |
Correct |
43 ms |
9040 KB |
Output is correct |
132 |
Correct |
31 ms |
3664 KB |
Output is correct |
133 |
Correct |
28 ms |
3824 KB |
Output is correct |
134 |
Correct |
488 ms |
26972 KB |
Output is correct |
135 |
Correct |
71 ms |
15732 KB |
Output is correct |
136 |
Correct |
31 ms |
14512 KB |
Output is correct |
137 |
Execution timed out |
1043 ms |
45948 KB |
Time limit exceeded |
138 |
Halted |
0 ms |
0 KB |
- |