# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1029913 |
2024-07-21T13:46:31 Z |
adaawf |
Council (JOI23_council) |
C++17 |
|
2490 ms |
1048576 KB |
#include <bits/stdc++.h>
using namespace std;
bool a[300005][21];
int c[21], da[21], db[21], z = 0, zz = 0;
int x[300005], y[300005], d[300005];
vector<vector<int>> f, g;
vector<vector<deque<pair<int, int>>>> dd;
priority_queue<pair<long long int, pair<int, int>>> q;
int ch(int x) {
return __builtin_popcount(x);
}
void trans(int x, int y, int z, int t, int w, int l) {
int h = dd[z][t].size();
for (auto w : dd[x][y]) {
dd[z][t].push_back({w.first - l, w.second});
}
pair<int, int> k = {-1, -1}, res = k;
for (auto w : dd[z][t]) {
if (w.first > k.first) k = w;
}
for (auto w : dd[z][t]) {
if (w.first > res.first && w.second != k.second) {
res = w;
}
}
dd[z][t].clear();
dd[z][t].push_back(k);
if (res.first != -1) dd[z][t].push_back(res);
if (dd[z][t].size() != h) q.push({w, {z, t}});
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, m, l = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
c[j] += a[i][j];
}
}
for (int j = 0; j < m; j++) {
if (c[j] == n / 2) {
da[j] = ++z;
}
else if (c[j] == (n / 2) + 1) {
db[j] = ++zz;
}
else if (c[j] < n / 2) l++;
}
for (int i = 1; i <= n; i++) {
int h = 0, k = 0;
for (int j = 0; j < m; j++) {
if (a[i][j] == 1) {
if (da[j] != 0) {
h += (1 << (da[j] - 1));
}
else if (db[j] != 0) {
k += (1 << (db[j] - 1));
}
}
}
x[i] = (1 << z) - h - 1;
y[i] = (1 << zz) - k - 1;
d[i] = k;
}
g = vector<vector<int>>((1 << z), vector<int>(1 << zz, 0));
dd = vector<vector<deque<pair<int, int>>>>((1 << z), vector<deque<pair<int, int>>>(1 << zz));
for (int i = 1; i <= n; i++) {
dd[x[i]][y[i]].push_back({ch(x[i]) + ch(y[i]), i});
if (dd[x[i]][y[i]].size() > 2) dd[x[i]][y[i]].pop_back();
//cout << i << " " << x[i] << " " << y[i] << " " << d[i] << '\n';
if (dd[x[i]][y[i]].size() == 1) q.push({ch(x[i]) + ch(y[i]), {x[i], y[i]}});
}
while (!q.empty()) {
auto p = q.top();
q.pop();
int x = p.first, u = p.second.first, v = p.second.second;
if (dd[u][v].empty() || g[u][v] == 1) continue;
g[u][v] = 1;
for (int i = 0; i < z; i++) {
if (u & (1 << i)) {
trans(u, v, u - (1 << i), v, x - 1, 1);
}
}
for (int i = 0; i < zz; i++) {
if (v & (1 << i)) {
trans(u, v, u, v - (1 << i), x - 1, 1);
}
}
}
f = vector<vector<int>>((1 << z), vector<int>(1 << zz, -1e9));
for (int i = 0; i < (1 << z); i++) {
for (int j = 0; j < (1 << zz); j++) {
if (g[i][j] == 1) {
f[i][j] = ch(i) + ch(j);
/*for (auto w : dd[i][j]) cout << w.first << "|" << w.second << " ";
cout << '\n';*/
q.push({f[i][j], {i, j}});
}
}
}
while (!q.empty()) {
auto p = q.top();
q.pop();
int x = p.first, u = p.second.first, v = p.second.second;
/*cout << 12131 << " " << u << " " << v << '\n';
for (auto w : dd[u][v]) cout << w.first << "|" << w.second << " ";
cout << '\n';*/
for (int i = 0; i < z; i++) {
if (!(u & (1 << i))) {
trans(u, v, u + (1 << i), v, x, 0);
}
}
for (int i = 0; i < zz; i++) {
if (!(v & (1 << i))) {
trans(u, v, u, v + (1 << i), x, 0);
}
}
}
for (int i = 1; i <= n; i++) {
int h = 0;
for (auto w : dd[x[i]][d[i]]) {
if (w.second != i) {
h = max(h, w.first);
//cout << i << " " << x[i] << " " << d[i] << " " << w.first << " " << w.second << '\n';
}
}
h += ch(y[i]);
cout << m - (z + zz - h) - l << '\n';
}
}
Compilation message
council.cpp: In function 'void trans(int, int, int, int, int, int)':
council.cpp:29:25: warning: comparison of integer expressions of different signedness: 'std::deque<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
29 | if (dd[z][t].size() != h) q.push({w, {z, t}});
| ~~~~~~~~~~~~~~~~^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
1112 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
2127 ms |
800696 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
2 ms |
4696 KB |
Output is correct |
8 |
Correct |
2 ms |
5208 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
2427 ms |
719832 KB |
Output is correct |
11 |
Correct |
2357 ms |
719516 KB |
Output is correct |
12 |
Correct |
2403 ms |
728420 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4440 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
4444 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
0 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
5208 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
2396 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
504 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 |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
1 ms |
1116 KB |
Output is correct |
40 |
Correct |
1 ms |
1116 KB |
Output is correct |
41 |
Correct |
15 ms |
12892 KB |
Output is correct |
42 |
Correct |
1 ms |
2396 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
22 ms |
11612 KB |
Output is correct |
45 |
Correct |
19 ms |
12120 KB |
Output is correct |
46 |
Correct |
194 ms |
100292 KB |
Output is correct |
47 |
Correct |
2 ms |
1884 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
208 ms |
89892 KB |
Output is correct |
50 |
Correct |
196 ms |
92156 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
1112 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
2127 ms |
800696 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
2 ms |
4696 KB |
Output is correct |
8 |
Correct |
2 ms |
5208 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
2427 ms |
719832 KB |
Output is correct |
11 |
Correct |
2357 ms |
719516 KB |
Output is correct |
12 |
Correct |
2403 ms |
728420 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4440 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
4444 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
0 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
5208 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
2396 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
504 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 |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
1 ms |
1116 KB |
Output is correct |
40 |
Correct |
1 ms |
1116 KB |
Output is correct |
41 |
Correct |
15 ms |
12892 KB |
Output is correct |
42 |
Correct |
1 ms |
2396 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
22 ms |
11612 KB |
Output is correct |
45 |
Correct |
19 ms |
12120 KB |
Output is correct |
46 |
Correct |
194 ms |
100292 KB |
Output is correct |
47 |
Correct |
2 ms |
1884 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
208 ms |
89892 KB |
Output is correct |
50 |
Correct |
196 ms |
92156 KB |
Output is correct |
51 |
Correct |
3 ms |
344 KB |
Output is correct |
52 |
Correct |
2 ms |
344 KB |
Output is correct |
53 |
Correct |
6 ms |
544 KB |
Output is correct |
54 |
Correct |
2490 ms |
731192 KB |
Output is correct |
55 |
Correct |
1 ms |
600 KB |
Output is correct |
56 |
Correct |
233 ms |
91988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
56 ms |
10636 KB |
Output is correct |
3 |
Correct |
39 ms |
10724 KB |
Output is correct |
4 |
Correct |
44 ms |
10504 KB |
Output is correct |
5 |
Correct |
51 ms |
10580 KB |
Output is correct |
6 |
Correct |
35 ms |
10576 KB |
Output is correct |
7 |
Correct |
67 ms |
10580 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
0 ms |
2444 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
56 ms |
10636 KB |
Output is correct |
3 |
Correct |
39 ms |
10724 KB |
Output is correct |
4 |
Correct |
44 ms |
10504 KB |
Output is correct |
5 |
Correct |
51 ms |
10580 KB |
Output is correct |
6 |
Correct |
35 ms |
10576 KB |
Output is correct |
7 |
Correct |
67 ms |
10580 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
0 ms |
2444 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
179 ms |
11396 KB |
Output is correct |
21 |
Correct |
164 ms |
11088 KB |
Output is correct |
22 |
Correct |
148 ms |
10936 KB |
Output is correct |
23 |
Correct |
176 ms |
10952 KB |
Output is correct |
24 |
Correct |
135 ms |
10576 KB |
Output is correct |
25 |
Correct |
199 ms |
10576 KB |
Output is correct |
26 |
Correct |
174 ms |
11348 KB |
Output is correct |
27 |
Correct |
1 ms |
3164 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 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 |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
1116 KB |
Output is correct |
45 |
Correct |
2 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
56 ms |
10636 KB |
Output is correct |
3 |
Correct |
39 ms |
10724 KB |
Output is correct |
4 |
Correct |
44 ms |
10504 KB |
Output is correct |
5 |
Correct |
51 ms |
10580 KB |
Output is correct |
6 |
Correct |
35 ms |
10576 KB |
Output is correct |
7 |
Correct |
67 ms |
10580 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
0 ms |
2444 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
179 ms |
11396 KB |
Output is correct |
21 |
Correct |
164 ms |
11088 KB |
Output is correct |
22 |
Correct |
148 ms |
10936 KB |
Output is correct |
23 |
Correct |
176 ms |
10952 KB |
Output is correct |
24 |
Correct |
135 ms |
10576 KB |
Output is correct |
25 |
Correct |
199 ms |
10576 KB |
Output is correct |
26 |
Correct |
174 ms |
11348 KB |
Output is correct |
27 |
Correct |
1 ms |
3164 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 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 |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
1116 KB |
Output is correct |
45 |
Correct |
2 ms |
1116 KB |
Output is correct |
46 |
Correct |
1 ms |
1116 KB |
Output is correct |
47 |
Correct |
278 ms |
24404 KB |
Output is correct |
48 |
Correct |
260 ms |
16992 KB |
Output is correct |
49 |
Correct |
249 ms |
16844 KB |
Output is correct |
50 |
Correct |
246 ms |
10812 KB |
Output is correct |
51 |
Correct |
223 ms |
10576 KB |
Output is correct |
52 |
Correct |
241 ms |
10580 KB |
Output is correct |
53 |
Correct |
282 ms |
22344 KB |
Output is correct |
54 |
Correct |
20 ms |
14936 KB |
Output is correct |
55 |
Correct |
1 ms |
2396 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
21 ms |
11804 KB |
Output is correct |
58 |
Correct |
18 ms |
12124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
56 ms |
10636 KB |
Output is correct |
3 |
Correct |
39 ms |
10724 KB |
Output is correct |
4 |
Correct |
44 ms |
10504 KB |
Output is correct |
5 |
Correct |
51 ms |
10580 KB |
Output is correct |
6 |
Correct |
35 ms |
10576 KB |
Output is correct |
7 |
Correct |
67 ms |
10580 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
392 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
0 ms |
2444 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
344 KB |
Output is correct |
20 |
Correct |
179 ms |
11396 KB |
Output is correct |
21 |
Correct |
164 ms |
11088 KB |
Output is correct |
22 |
Correct |
148 ms |
10936 KB |
Output is correct |
23 |
Correct |
176 ms |
10952 KB |
Output is correct |
24 |
Correct |
135 ms |
10576 KB |
Output is correct |
25 |
Correct |
199 ms |
10576 KB |
Output is correct |
26 |
Correct |
174 ms |
11348 KB |
Output is correct |
27 |
Correct |
1 ms |
3164 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 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 |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
1 ms |
344 KB |
Output is correct |
38 |
Correct |
1 ms |
344 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
604 KB |
Output is correct |
43 |
Correct |
1 ms |
604 KB |
Output is correct |
44 |
Correct |
1 ms |
1116 KB |
Output is correct |
45 |
Correct |
2 ms |
1116 KB |
Output is correct |
46 |
Correct |
1 ms |
1116 KB |
Output is correct |
47 |
Correct |
278 ms |
24404 KB |
Output is correct |
48 |
Correct |
260 ms |
16992 KB |
Output is correct |
49 |
Correct |
249 ms |
16844 KB |
Output is correct |
50 |
Correct |
246 ms |
10812 KB |
Output is correct |
51 |
Correct |
223 ms |
10576 KB |
Output is correct |
52 |
Correct |
241 ms |
10580 KB |
Output is correct |
53 |
Correct |
282 ms |
22344 KB |
Output is correct |
54 |
Correct |
20 ms |
14936 KB |
Output is correct |
55 |
Correct |
1 ms |
2396 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
21 ms |
11804 KB |
Output is correct |
58 |
Correct |
18 ms |
12124 KB |
Output is correct |
59 |
Correct |
288 ms |
10956 KB |
Output is correct |
60 |
Correct |
429 ms |
181836 KB |
Output is correct |
61 |
Correct |
442 ms |
182092 KB |
Output is correct |
62 |
Correct |
462 ms |
182352 KB |
Output is correct |
63 |
Correct |
418 ms |
65596 KB |
Output is correct |
64 |
Correct |
612 ms |
110092 KB |
Output is correct |
65 |
Correct |
577 ms |
110292 KB |
Output is correct |
66 |
Correct |
238 ms |
10832 KB |
Output is correct |
67 |
Correct |
248 ms |
10592 KB |
Output is correct |
68 |
Correct |
306 ms |
10576 KB |
Output is correct |
69 |
Correct |
603 ms |
103236 KB |
Output is correct |
70 |
Correct |
183 ms |
104388 KB |
Output is correct |
71 |
Correct |
2 ms |
5980 KB |
Output is correct |
72 |
Correct |
1 ms |
4700 KB |
Output is correct |
73 |
Correct |
208 ms |
94012 KB |
Output is correct |
74 |
Correct |
204 ms |
94192 KB |
Output is correct |
75 |
Correct |
231 ms |
96076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
1112 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
2127 ms |
800696 KB |
Output is correct |
6 |
Correct |
1 ms |
4440 KB |
Output is correct |
7 |
Correct |
2 ms |
4696 KB |
Output is correct |
8 |
Correct |
2 ms |
5208 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
2427 ms |
719832 KB |
Output is correct |
11 |
Correct |
2357 ms |
719516 KB |
Output is correct |
12 |
Correct |
2403 ms |
728420 KB |
Output is correct |
13 |
Correct |
1 ms |
4440 KB |
Output is correct |
14 |
Correct |
1 ms |
4440 KB |
Output is correct |
15 |
Correct |
1 ms |
4444 KB |
Output is correct |
16 |
Correct |
1 ms |
4444 KB |
Output is correct |
17 |
Correct |
1 ms |
4444 KB |
Output is correct |
18 |
Correct |
1 ms |
4444 KB |
Output is correct |
19 |
Correct |
1 ms |
4444 KB |
Output is correct |
20 |
Correct |
0 ms |
4444 KB |
Output is correct |
21 |
Correct |
1 ms |
4440 KB |
Output is correct |
22 |
Correct |
1 ms |
5208 KB |
Output is correct |
23 |
Correct |
1 ms |
4444 KB |
Output is correct |
24 |
Correct |
1 ms |
4444 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
2396 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
504 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 |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
1 ms |
1116 KB |
Output is correct |
40 |
Correct |
1 ms |
1116 KB |
Output is correct |
41 |
Correct |
15 ms |
12892 KB |
Output is correct |
42 |
Correct |
1 ms |
2396 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
22 ms |
11612 KB |
Output is correct |
45 |
Correct |
19 ms |
12120 KB |
Output is correct |
46 |
Correct |
194 ms |
100292 KB |
Output is correct |
47 |
Correct |
2 ms |
1884 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
208 ms |
89892 KB |
Output is correct |
50 |
Correct |
196 ms |
92156 KB |
Output is correct |
51 |
Correct |
3 ms |
344 KB |
Output is correct |
52 |
Correct |
2 ms |
344 KB |
Output is correct |
53 |
Correct |
6 ms |
544 KB |
Output is correct |
54 |
Correct |
2490 ms |
731192 KB |
Output is correct |
55 |
Correct |
1 ms |
600 KB |
Output is correct |
56 |
Correct |
233 ms |
91988 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
56 ms |
10636 KB |
Output is correct |
59 |
Correct |
39 ms |
10724 KB |
Output is correct |
60 |
Correct |
44 ms |
10504 KB |
Output is correct |
61 |
Correct |
51 ms |
10580 KB |
Output is correct |
62 |
Correct |
35 ms |
10576 KB |
Output is correct |
63 |
Correct |
67 ms |
10580 KB |
Output is correct |
64 |
Correct |
1 ms |
2396 KB |
Output is correct |
65 |
Correct |
0 ms |
392 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
1 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 |
1 ms |
2396 KB |
Output is correct |
71 |
Correct |
0 ms |
2444 KB |
Output is correct |
72 |
Correct |
0 ms |
348 KB |
Output is correct |
73 |
Correct |
1 ms |
348 KB |
Output is correct |
74 |
Correct |
1 ms |
344 KB |
Output is correct |
75 |
Correct |
1 ms |
344 KB |
Output is correct |
76 |
Correct |
179 ms |
11396 KB |
Output is correct |
77 |
Correct |
164 ms |
11088 KB |
Output is correct |
78 |
Correct |
148 ms |
10936 KB |
Output is correct |
79 |
Correct |
176 ms |
10952 KB |
Output is correct |
80 |
Correct |
135 ms |
10576 KB |
Output is correct |
81 |
Correct |
199 ms |
10576 KB |
Output is correct |
82 |
Correct |
174 ms |
11348 KB |
Output is correct |
83 |
Correct |
1 ms |
3164 KB |
Output is correct |
84 |
Correct |
0 ms |
344 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
1 ms |
348 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
1 ms |
348 KB |
Output is correct |
90 |
Correct |
0 ms |
348 KB |
Output is correct |
91 |
Correct |
1 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
344 KB |
Output is correct |
94 |
Correct |
1 ms |
344 KB |
Output is correct |
95 |
Correct |
0 ms |
348 KB |
Output is correct |
96 |
Correct |
1 ms |
348 KB |
Output is correct |
97 |
Correct |
1 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
604 KB |
Output is correct |
99 |
Correct |
1 ms |
604 KB |
Output is correct |
100 |
Correct |
1 ms |
1116 KB |
Output is correct |
101 |
Correct |
2 ms |
1116 KB |
Output is correct |
102 |
Correct |
1 ms |
1116 KB |
Output is correct |
103 |
Correct |
278 ms |
24404 KB |
Output is correct |
104 |
Correct |
260 ms |
16992 KB |
Output is correct |
105 |
Correct |
249 ms |
16844 KB |
Output is correct |
106 |
Correct |
246 ms |
10812 KB |
Output is correct |
107 |
Correct |
223 ms |
10576 KB |
Output is correct |
108 |
Correct |
241 ms |
10580 KB |
Output is correct |
109 |
Correct |
282 ms |
22344 KB |
Output is correct |
110 |
Correct |
20 ms |
14936 KB |
Output is correct |
111 |
Correct |
1 ms |
2396 KB |
Output is correct |
112 |
Correct |
0 ms |
348 KB |
Output is correct |
113 |
Correct |
21 ms |
11804 KB |
Output is correct |
114 |
Correct |
18 ms |
12124 KB |
Output is correct |
115 |
Correct |
288 ms |
10956 KB |
Output is correct |
116 |
Correct |
429 ms |
181836 KB |
Output is correct |
117 |
Correct |
442 ms |
182092 KB |
Output is correct |
118 |
Correct |
462 ms |
182352 KB |
Output is correct |
119 |
Correct |
418 ms |
65596 KB |
Output is correct |
120 |
Correct |
612 ms |
110092 KB |
Output is correct |
121 |
Correct |
577 ms |
110292 KB |
Output is correct |
122 |
Correct |
238 ms |
10832 KB |
Output is correct |
123 |
Correct |
248 ms |
10592 KB |
Output is correct |
124 |
Correct |
306 ms |
10576 KB |
Output is correct |
125 |
Correct |
603 ms |
103236 KB |
Output is correct |
126 |
Correct |
183 ms |
104388 KB |
Output is correct |
127 |
Correct |
2 ms |
5980 KB |
Output is correct |
128 |
Correct |
1 ms |
4700 KB |
Output is correct |
129 |
Correct |
208 ms |
94012 KB |
Output is correct |
130 |
Correct |
204 ms |
94192 KB |
Output is correct |
131 |
Correct |
231 ms |
96076 KB |
Output is correct |
132 |
Runtime error |
727 ms |
1048576 KB |
Execution killed with signal 9 |
133 |
Halted |
0 ms |
0 KB |
- |