#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define ff first
#define ss second
#define pb push_back
// global
int a[300001];
int n, m;
int dpf[(1 << 20)]; // 0: 0, -1: 2+, x: position x
pii dpb[(1 << 20)]; // {which level != 0, which level -1}
bool vis[(1 << 20)];
int ps[300001][20];
void init() {
// init
}
void PrecompDPF() {
for (int i = 1; i <= n; i++) {
if (dpf[a[i]] == 0) dpf[a[i]] = i;
else dpf[a[i]] = -1;
}
for (int bit = 0; bit < m; bit++) {
for (int conf = 0; conf < (1 << m); conf++) {
if (conf & (1 << bit)) {
int prev = (conf ^ (1 << bit));
// cerr << "ADD " << prev << " TO " << conf << endl;
if (dpf[prev] == -1) {
dpf[conf] = -1;
} else if (dpf[prev] != 0) {
if (dpf[conf] == 0) {
dpf[conf] = dpf[prev];
} else {
dpf[conf] = -1;
}
}
}
}
}
}
bool comp(int &lhs, int &rhs) {
return __builtin_popcount(lhs) < __builtin_popcount(rhs);
}
void PrecompDPB() {
for (int conf = 0; conf < (1 << m); conf++) {
if (dpf[conf] == -1) {
dpb[conf] = {conf, conf};
} else if (dpf[conf] != 0) {
dpb[conf] = {conf, -1};
} else {
dpb[conf] = {-1, -1};
}
vis[conf] = false;
// cerr << conf << ' ' << dpb[conf].ff << ' ' << dpb[conf].ss << endl;
}
for (int bits = m - 1; bits >= 0; bits--) {
for (int conf = 0; conf < (1 << m); conf++) {
if (__builtin_popcount(conf) != bits) continue;
int ncur;
int cur = 0;
for (int i = 0; i < m; i++) {
if (!bool(conf & (1 << i))) {
ncur = (conf ^ (1 << i));
if (dpb[ncur].ff != -1) {
if (comp(dpb[ncur].ff, dpb[conf].ff)) {
dpb[conf].ff = dpb[ncur].ff;
}
if (dpf[dpb[ncur].ff] == -1 || (dpf[conf] != 0 && dpf[dpb[ncur].ff] != dpf[conf])) {
if (comp(dpb[ncur].ff, dpb[conf].ss)) {
dpb[conf].ss = dpb[ncur].ff;
}
} else if (cur == 0) {
cur = dpb[ncur].ff;
} else {
if (dpf[cur] != dpf[dpb[ncur].ff]) {
if (comp(cur, dpb[ncur].ff)) {
if (comp(dpb[ncur].ff, dpb[conf].ss)) {
dpb[conf].ss = dpb[ncur].ff;
}
} else {
if (comp(cur, dpb[conf].ss)) {
dpb[conf].ss = cur;
}
}
}
if (!comp(cur, dpb[ncur].ff)) {
cur = dpb[ncur].ff;
}
}
}
if (dpb[ncur].ss != -1) {
if (comp(dpb[ncur].ss, dpb[conf].ss)) {
dpb[conf].ss = dpb[ncur].ss;
}
if (comp(dpb[ncur].ss, dpb[conf].ff)) {
dpb[conf].ff = dpb[ncur].ss;
}
}
}
}
}
}
}
void PrecompPS() {
for (int j = 0; j < m; j++) {
ps[0][j] = 0;
for (int i = 1; i <= n; i++) {
ps[i][j] = ps[i - 1][j] + bool(a[i] & (1 << j));
}
}
}
void st7() {
PrecompDPF();
// cerr << "DPF:\n";
// for (int i = 0; i < (1 << m); i++) cerr << dpf[i] << ' '; cerr << endl;
// cerr << "END\n";
PrecompDPB();
// cerr << "DPB:\n";
// for (int i = 0; i < (1 << m); i++) {
// cerr << i << ": " << dpb[i].ff << ' ' << dpb[i].ss << endl;
// }
// cerr << "END\n";
PrecompPS();
for (int i = 1; i <= n; i++) {
int ans = 0, tar = 0;
for (int j = 0; j < m; j++) {
if ((ps[n][j] - bool(a[i] & (1 << j))) > (n >> 1)) {
ans++;
} else if ((ps[n][j] - bool(a[i] & (1 << j))) == (n >> 1)) {
tar |= (1 << j);
}
}
tar ^= ((1 << m) - 1);
// cerr << ans << ' ' << tar << endl;
// cerr << dpb[tar].ff << ' ' << dpb[tar].ss << endl;
int buff = 0;
if (dpb[tar].ff != -1) {
if (dpf[dpb[tar].ff] != i) {
buff = max(buff, m - __builtin_popcount(dpb[tar].ff));
}
}
if (dpb[tar].ss != -1) {
buff = max(buff, m - __builtin_popcount(dpb[tar].ss));
}
// cerr << ans << ' ' << buff << endl;
ans += buff;
cout << ans << endl;
}
}
void st6() {
return st7();
}
void st5() {
return st7();
}
void st4() {
return st7();
}
void st3() {
return st7();
}
void st2() {
return st7();
PrecompPS();
for (int i = 1; i <= n; i++) {
int ans = 0;
int cur;
for (int j = 1; j <= n; j++) {
if (i == j) continue;
cur = 0;
for (int k = 0; k < m; k++) {
cur += ((ps[n][k] - bool(a[i] & (1 << k)) - bool(a[j] & (1 << k))) >= (n >> 1));
}
ans = max(ans, cur);
}
cout << ans << endl;
}
}
void st1() {
return st2();
}
void solve() {
// solve
cin >> n >> m;
for (int i = 1; i <= n; i++) {
a[i] = 0;
bool temp;
for (int j = 0; j < m; j++) {
cin >> temp;
if (temp) {
a[i] |= (1 << j);
}
}
}
if (n <= 300) return st1();
if (n <= 3000) return st2();
if (m <= 2) return st3();
if (m <= 10) return st4();
if (m <= 14) return st5();
if (m <= 17) return st6();
return st7();
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
init(); solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
299 ms |
21876 KB |
Output is correct |
6 |
Correct |
284 ms |
17792 KB |
Output is correct |
7 |
Correct |
352 ms |
20528 KB |
Output is correct |
8 |
Correct |
384 ms |
20912 KB |
Output is correct |
9 |
Correct |
387 ms |
25564 KB |
Output is correct |
10 |
Correct |
351 ms |
19868 KB |
Output is correct |
11 |
Correct |
374 ms |
22100 KB |
Output is correct |
12 |
Correct |
476 ms |
25592 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
324 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
320 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
4 ms |
596 KB |
Output is correct |
42 |
Correct |
4 ms |
596 KB |
Output is correct |
43 |
Correct |
5 ms |
724 KB |
Output is correct |
44 |
Correct |
6 ms |
724 KB |
Output is correct |
45 |
Correct |
5 ms |
724 KB |
Output is correct |
46 |
Correct |
31 ms |
3036 KB |
Output is correct |
47 |
Correct |
48 ms |
2956 KB |
Output is correct |
48 |
Correct |
39 ms |
3196 KB |
Output is correct |
49 |
Correct |
35 ms |
2900 KB |
Output is correct |
50 |
Correct |
47 ms |
3548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
299 ms |
21876 KB |
Output is correct |
6 |
Correct |
284 ms |
17792 KB |
Output is correct |
7 |
Correct |
352 ms |
20528 KB |
Output is correct |
8 |
Correct |
384 ms |
20912 KB |
Output is correct |
9 |
Correct |
387 ms |
25564 KB |
Output is correct |
10 |
Correct |
351 ms |
19868 KB |
Output is correct |
11 |
Correct |
374 ms |
22100 KB |
Output is correct |
12 |
Correct |
476 ms |
25592 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
324 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
320 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
4 ms |
596 KB |
Output is correct |
42 |
Correct |
4 ms |
596 KB |
Output is correct |
43 |
Correct |
5 ms |
724 KB |
Output is correct |
44 |
Correct |
6 ms |
724 KB |
Output is correct |
45 |
Correct |
5 ms |
724 KB |
Output is correct |
46 |
Correct |
31 ms |
3036 KB |
Output is correct |
47 |
Correct |
48 ms |
2956 KB |
Output is correct |
48 |
Correct |
39 ms |
3196 KB |
Output is correct |
49 |
Correct |
35 ms |
2900 KB |
Output is correct |
50 |
Correct |
47 ms |
3548 KB |
Output is correct |
51 |
Correct |
305 ms |
18312 KB |
Output is correct |
52 |
Correct |
350 ms |
26500 KB |
Output is correct |
53 |
Correct |
361 ms |
26576 KB |
Output is correct |
54 |
Correct |
357 ms |
26488 KB |
Output is correct |
55 |
Correct |
4 ms |
852 KB |
Output is correct |
56 |
Correct |
40 ms |
4064 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
348 ms |
50368 KB |
Output is correct |
3 |
Correct |
345 ms |
50288 KB |
Output is correct |
4 |
Correct |
356 ms |
50356 KB |
Output is correct |
5 |
Correct |
362 ms |
50348 KB |
Output is correct |
6 |
Correct |
329 ms |
50280 KB |
Output is correct |
7 |
Correct |
346 ms |
50308 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
328 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
328 KB |
Output is correct |
17 |
Correct |
4 ms |
880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
348 ms |
50368 KB |
Output is correct |
3 |
Correct |
345 ms |
50288 KB |
Output is correct |
4 |
Correct |
356 ms |
50356 KB |
Output is correct |
5 |
Correct |
362 ms |
50348 KB |
Output is correct |
6 |
Correct |
329 ms |
50280 KB |
Output is correct |
7 |
Correct |
346 ms |
50308 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
328 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
328 KB |
Output is correct |
17 |
Correct |
4 ms |
880 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
503 ms |
50388 KB |
Output is correct |
21 |
Correct |
484 ms |
50268 KB |
Output is correct |
22 |
Correct |
476 ms |
50360 KB |
Output is correct |
23 |
Correct |
515 ms |
50624 KB |
Output is correct |
24 |
Correct |
466 ms |
50328 KB |
Output is correct |
25 |
Correct |
522 ms |
50360 KB |
Output is correct |
26 |
Correct |
508 ms |
50368 KB |
Output is correct |
27 |
Correct |
1 ms |
328 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
328 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
328 KB |
Output is correct |
38 |
Correct |
0 ms |
328 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
324 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
348 ms |
50368 KB |
Output is correct |
3 |
Correct |
345 ms |
50288 KB |
Output is correct |
4 |
Correct |
356 ms |
50356 KB |
Output is correct |
5 |
Correct |
362 ms |
50348 KB |
Output is correct |
6 |
Correct |
329 ms |
50280 KB |
Output is correct |
7 |
Correct |
346 ms |
50308 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
328 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
328 KB |
Output is correct |
17 |
Correct |
4 ms |
880 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
503 ms |
50388 KB |
Output is correct |
21 |
Correct |
484 ms |
50268 KB |
Output is correct |
22 |
Correct |
476 ms |
50360 KB |
Output is correct |
23 |
Correct |
515 ms |
50624 KB |
Output is correct |
24 |
Correct |
466 ms |
50328 KB |
Output is correct |
25 |
Correct |
522 ms |
50360 KB |
Output is correct |
26 |
Correct |
508 ms |
50368 KB |
Output is correct |
27 |
Correct |
1 ms |
328 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
328 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
328 KB |
Output is correct |
38 |
Correct |
0 ms |
328 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
324 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
340 KB |
Output is correct |
47 |
Correct |
571 ms |
50740 KB |
Output is correct |
48 |
Correct |
820 ms |
50460 KB |
Output is correct |
49 |
Correct |
721 ms |
50464 KB |
Output is correct |
50 |
Correct |
561 ms |
50832 KB |
Output is correct |
51 |
Correct |
542 ms |
50740 KB |
Output is correct |
52 |
Correct |
620 ms |
50780 KB |
Output is correct |
53 |
Correct |
576 ms |
51016 KB |
Output is correct |
54 |
Correct |
4 ms |
596 KB |
Output is correct |
55 |
Correct |
4 ms |
712 KB |
Output is correct |
56 |
Correct |
5 ms |
712 KB |
Output is correct |
57 |
Correct |
5 ms |
712 KB |
Output is correct |
58 |
Correct |
5 ms |
712 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
348 ms |
50368 KB |
Output is correct |
3 |
Correct |
345 ms |
50288 KB |
Output is correct |
4 |
Correct |
356 ms |
50356 KB |
Output is correct |
5 |
Correct |
362 ms |
50348 KB |
Output is correct |
6 |
Correct |
329 ms |
50280 KB |
Output is correct |
7 |
Correct |
346 ms |
50308 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
328 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
328 KB |
Output is correct |
17 |
Correct |
4 ms |
880 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
503 ms |
50388 KB |
Output is correct |
21 |
Correct |
484 ms |
50268 KB |
Output is correct |
22 |
Correct |
476 ms |
50360 KB |
Output is correct |
23 |
Correct |
515 ms |
50624 KB |
Output is correct |
24 |
Correct |
466 ms |
50328 KB |
Output is correct |
25 |
Correct |
522 ms |
50360 KB |
Output is correct |
26 |
Correct |
508 ms |
50368 KB |
Output is correct |
27 |
Correct |
1 ms |
328 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
328 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
328 KB |
Output is correct |
38 |
Correct |
0 ms |
328 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
1 ms |
324 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
1 ms |
340 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
1 ms |
340 KB |
Output is correct |
47 |
Correct |
571 ms |
50740 KB |
Output is correct |
48 |
Correct |
820 ms |
50460 KB |
Output is correct |
49 |
Correct |
721 ms |
50464 KB |
Output is correct |
50 |
Correct |
561 ms |
50832 KB |
Output is correct |
51 |
Correct |
542 ms |
50740 KB |
Output is correct |
52 |
Correct |
620 ms |
50780 KB |
Output is correct |
53 |
Correct |
576 ms |
51016 KB |
Output is correct |
54 |
Correct |
4 ms |
596 KB |
Output is correct |
55 |
Correct |
4 ms |
712 KB |
Output is correct |
56 |
Correct |
5 ms |
712 KB |
Output is correct |
57 |
Correct |
5 ms |
712 KB |
Output is correct |
58 |
Correct |
5 ms |
712 KB |
Output is correct |
59 |
Correct |
625 ms |
61396 KB |
Output is correct |
60 |
Correct |
300 ms |
26448 KB |
Output is correct |
61 |
Correct |
297 ms |
28156 KB |
Output is correct |
62 |
Correct |
418 ms |
28968 KB |
Output is correct |
63 |
Correct |
647 ms |
61160 KB |
Output is correct |
64 |
Correct |
714 ms |
63336 KB |
Output is correct |
65 |
Correct |
726 ms |
63320 KB |
Output is correct |
66 |
Correct |
684 ms |
62660 KB |
Output is correct |
67 |
Correct |
626 ms |
63408 KB |
Output is correct |
68 |
Correct |
695 ms |
63404 KB |
Output is correct |
69 |
Correct |
825 ms |
63660 KB |
Output is correct |
70 |
Correct |
35 ms |
3028 KB |
Output is correct |
71 |
Correct |
36 ms |
2900 KB |
Output is correct |
72 |
Correct |
40 ms |
3196 KB |
Output is correct |
73 |
Correct |
36 ms |
2900 KB |
Output is correct |
74 |
Correct |
39 ms |
3540 KB |
Output is correct |
75 |
Correct |
46 ms |
4048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
299 ms |
21876 KB |
Output is correct |
6 |
Correct |
284 ms |
17792 KB |
Output is correct |
7 |
Correct |
352 ms |
20528 KB |
Output is correct |
8 |
Correct |
384 ms |
20912 KB |
Output is correct |
9 |
Correct |
387 ms |
25564 KB |
Output is correct |
10 |
Correct |
351 ms |
19868 KB |
Output is correct |
11 |
Correct |
374 ms |
22100 KB |
Output is correct |
12 |
Correct |
476 ms |
25592 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
328 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
1 ms |
324 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
1 ms |
340 KB |
Output is correct |
26 |
Correct |
1 ms |
340 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
320 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
4 ms |
596 KB |
Output is correct |
42 |
Correct |
4 ms |
596 KB |
Output is correct |
43 |
Correct |
5 ms |
724 KB |
Output is correct |
44 |
Correct |
6 ms |
724 KB |
Output is correct |
45 |
Correct |
5 ms |
724 KB |
Output is correct |
46 |
Correct |
31 ms |
3036 KB |
Output is correct |
47 |
Correct |
48 ms |
2956 KB |
Output is correct |
48 |
Correct |
39 ms |
3196 KB |
Output is correct |
49 |
Correct |
35 ms |
2900 KB |
Output is correct |
50 |
Correct |
47 ms |
3548 KB |
Output is correct |
51 |
Correct |
305 ms |
18312 KB |
Output is correct |
52 |
Correct |
350 ms |
26500 KB |
Output is correct |
53 |
Correct |
361 ms |
26576 KB |
Output is correct |
54 |
Correct |
357 ms |
26488 KB |
Output is correct |
55 |
Correct |
4 ms |
852 KB |
Output is correct |
56 |
Correct |
40 ms |
4064 KB |
Output is correct |
57 |
Correct |
1 ms |
324 KB |
Output is correct |
58 |
Correct |
348 ms |
50368 KB |
Output is correct |
59 |
Correct |
345 ms |
50288 KB |
Output is correct |
60 |
Correct |
356 ms |
50356 KB |
Output is correct |
61 |
Correct |
362 ms |
50348 KB |
Output is correct |
62 |
Correct |
329 ms |
50280 KB |
Output is correct |
63 |
Correct |
346 ms |
50308 KB |
Output is correct |
64 |
Correct |
1 ms |
340 KB |
Output is correct |
65 |
Correct |
1 ms |
340 KB |
Output is correct |
66 |
Correct |
1 ms |
340 KB |
Output is correct |
67 |
Correct |
0 ms |
340 KB |
Output is correct |
68 |
Correct |
1 ms |
340 KB |
Output is correct |
69 |
Correct |
1 ms |
328 KB |
Output is correct |
70 |
Correct |
0 ms |
340 KB |
Output is correct |
71 |
Correct |
1 ms |
340 KB |
Output is correct |
72 |
Correct |
1 ms |
328 KB |
Output is correct |
73 |
Correct |
4 ms |
880 KB |
Output is correct |
74 |
Correct |
0 ms |
340 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
503 ms |
50388 KB |
Output is correct |
77 |
Correct |
484 ms |
50268 KB |
Output is correct |
78 |
Correct |
476 ms |
50360 KB |
Output is correct |
79 |
Correct |
515 ms |
50624 KB |
Output is correct |
80 |
Correct |
466 ms |
50328 KB |
Output is correct |
81 |
Correct |
522 ms |
50360 KB |
Output is correct |
82 |
Correct |
508 ms |
50368 KB |
Output is correct |
83 |
Correct |
1 ms |
328 KB |
Output is correct |
84 |
Correct |
1 ms |
340 KB |
Output is correct |
85 |
Correct |
0 ms |
340 KB |
Output is correct |
86 |
Correct |
1 ms |
340 KB |
Output is correct |
87 |
Correct |
1 ms |
332 KB |
Output is correct |
88 |
Correct |
1 ms |
340 KB |
Output is correct |
89 |
Correct |
1 ms |
340 KB |
Output is correct |
90 |
Correct |
1 ms |
328 KB |
Output is correct |
91 |
Correct |
1 ms |
340 KB |
Output is correct |
92 |
Correct |
1 ms |
340 KB |
Output is correct |
93 |
Correct |
0 ms |
328 KB |
Output is correct |
94 |
Correct |
0 ms |
328 KB |
Output is correct |
95 |
Correct |
0 ms |
340 KB |
Output is correct |
96 |
Correct |
1 ms |
340 KB |
Output is correct |
97 |
Correct |
1 ms |
324 KB |
Output is correct |
98 |
Correct |
1 ms |
340 KB |
Output is correct |
99 |
Correct |
1 ms |
340 KB |
Output is correct |
100 |
Correct |
1 ms |
340 KB |
Output is correct |
101 |
Correct |
1 ms |
340 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
571 ms |
50740 KB |
Output is correct |
104 |
Correct |
820 ms |
50460 KB |
Output is correct |
105 |
Correct |
721 ms |
50464 KB |
Output is correct |
106 |
Correct |
561 ms |
50832 KB |
Output is correct |
107 |
Correct |
542 ms |
50740 KB |
Output is correct |
108 |
Correct |
620 ms |
50780 KB |
Output is correct |
109 |
Correct |
576 ms |
51016 KB |
Output is correct |
110 |
Correct |
4 ms |
596 KB |
Output is correct |
111 |
Correct |
4 ms |
712 KB |
Output is correct |
112 |
Correct |
5 ms |
712 KB |
Output is correct |
113 |
Correct |
5 ms |
712 KB |
Output is correct |
114 |
Correct |
5 ms |
712 KB |
Output is correct |
115 |
Correct |
625 ms |
61396 KB |
Output is correct |
116 |
Correct |
300 ms |
26448 KB |
Output is correct |
117 |
Correct |
297 ms |
28156 KB |
Output is correct |
118 |
Correct |
418 ms |
28968 KB |
Output is correct |
119 |
Correct |
647 ms |
61160 KB |
Output is correct |
120 |
Correct |
714 ms |
63336 KB |
Output is correct |
121 |
Correct |
726 ms |
63320 KB |
Output is correct |
122 |
Correct |
684 ms |
62660 KB |
Output is correct |
123 |
Correct |
626 ms |
63408 KB |
Output is correct |
124 |
Correct |
695 ms |
63404 KB |
Output is correct |
125 |
Correct |
825 ms |
63660 KB |
Output is correct |
126 |
Correct |
35 ms |
3028 KB |
Output is correct |
127 |
Correct |
36 ms |
2900 KB |
Output is correct |
128 |
Correct |
40 ms |
3196 KB |
Output is correct |
129 |
Correct |
36 ms |
2900 KB |
Output is correct |
130 |
Correct |
39 ms |
3540 KB |
Output is correct |
131 |
Correct |
46 ms |
4048 KB |
Output is correct |
132 |
Correct |
1027 ms |
87916 KB |
Output is correct |
133 |
Correct |
992 ms |
87708 KB |
Output is correct |
134 |
Correct |
1096 ms |
87888 KB |
Output is correct |
135 |
Correct |
1063 ms |
87776 KB |
Output is correct |
136 |
Correct |
1130 ms |
87868 KB |
Output is correct |
137 |
Correct |
874 ms |
74396 KB |
Output is correct |
138 |
Correct |
856 ms |
74408 KB |
Output is correct |
139 |
Correct |
970 ms |
79808 KB |
Output is correct |
140 |
Correct |
914 ms |
87496 KB |
Output is correct |
141 |
Correct |
969 ms |
87644 KB |
Output is correct |
142 |
Correct |
1050 ms |
87832 KB |
Output is correct |