#include "mars.h"
#include <bits/stdc++.h>
using namespace std;
bool val(string &s, int p = 0) {
return s[p]-'0';
}
int find(int i, vector<int> &uf) {
return uf[i] == i ? i : uf[i] = find(uf[i], uf);
}
void merge(int a, int b, vector<int> &uf) {
a = find(a, uf);
b = find(b, uf);
if (a != b) uf[a] = b;
}
/*
BIT ALLOCATION:
For main diag, first bit is for value,
next 44 bits are for start and then end union find when starting from the bottom,
going up, and then right
last 10 bits are for the answer
For off diag, first 50 bits represent going down/right,
and next 50 bits are down/right one row/column over
*/
string process(vector<vector<string>> visible, int i, int j, int k, int n) {
if (i < 2*(n-k-1) && j < 2*(n-k-1)) return visible[0][0];
int m = 2*k+3;
if (i == j) {
if (i & 1) return visible[0][0];
bool **grid;
grid = new bool*[m];
for (int a = 0; a < m; a++) {
grid[a] = new bool[m];
fill(grid[a], grid[a]+m, 0);
} // make the grid
for (int a = 0; a < 3; a++) {
for (int b = 0; b < 3; b++)
grid[a][b] = val(visible[a][b]);
}
for (int b = 3; b < m; b++) {
grid[b][0] = val(visible[2][0], b-2);
grid[b][1] = val(visible[2][1], b-2);
grid[b][2] = val(visible[2][1], 50+b-2);
grid[0][b] = val(visible[0][2], b-2);
grid[1][b] = val(visible[1][2], b-2);
grid[2][b] = val(visible[1][2], 50+b-2);
}
// for (int a = 0; a < m; a++) {
// for (int b = 0; b < m; b++) {
// cerr << grid[a][b] << ' ';
// }
// cerr << '\n';
// }
// extract current answer from visible[2][2]
int ans = 0;
vector<int> uf(m*m);
iota(uf.begin(), uf.end(), 0);
if (m > 3) {
for (int a = 0; a < 10; a++) {
ans += (val(visible[2][2], 100-a-1)<<a);
}
for (int b = 0; b < m-2; b++) {
for (int a = 0; a < 2; a++) {
grid[b+2][1+a] = val(visible[2][1], 50*a+b);
grid[1+a][b+2] = val(visible[1][2], 50*a+b);
}
grid[b+2][0] = val(visible[2][0], b);
grid[0][b+2] = val(visible[0][2], b);
}
vector<int> starts;
int p = 0;
// cerr << visible[2][2] << '\n';
bool prv = 0;
int pid;
for (int a = m-1; a >= 2; a--) {
for (int b = 2; b < m; b++) {
if (a != 2 && b != 2) continue;
if (!grid[a][b]) {
prv = 0;
continue;
}
if (prv) {
merge(m*a+b, pid, uf);
pid = m*a+b;
continue;
}
prv = 1;
bool is_start = val(visible[2][2], p+1);
bool is_end = val(visible[2][2], p+45);
int cur = m*a+b;
pid = cur;
p++;
if (is_end) {
// if (starts.empty()) exit(0);
assert(starts.size());
merge(starts.back(), cur, uf);
starts.pop_back();
// cerr << "0\n";
}
if (is_start) {
starts.push_back(cur);
// cerr << "1\n";
}
}
}
assert(starts.empty());
for (int a = m-1; a >= 2; a--) {
for (int b = 2; b < m; b++) {
if (a != 2 && b != 2) continue;
if (!grid[a][b]) continue;
int cur = m*a+b;
ans -= (uf[cur] == cur); // this cc is currently represented
}
}
}
for (int a = 0; a < m; a++) {
for (int b = 0; b < m; b++) {
if (a < m-1 && grid[a][b] && grid[a+1][b]) merge(m*a+b, m*a+b+m, uf);
if (b < m-1 && grid[a][b] && grid[a][b+1]) merge(m*a+b, m*a+b+1, uf);
}
}
for (int a = 0; a < m; a++) {
for (int b = 0; b < m; b++) {
ans += (grid[a][b] && uf[m*a+b] == m*a+b);
}
}
string res(100, '0');
res[0] = visible[0][0][0];
if (i == 0) {
int p = 0;
while (ans) {
res[p] = '0'+(ans&1);
ans /= 2;
p++;
}
}
else {
for (int p = 0; p < 10; p++, ans /= 2) res[100-p-1] = '0'+(ans&1);
vector<char> seen(m*m, 0);
int p = 0;
bool prv = 0;
for (int a = m-1; a >= 0; a--) {
for (int b = 0; b < m; b++) {
if (a && b) continue;
if (!grid[a][b]) {
prv = 0;
continue;
}
if (prv) continue;
prv = 1;
res[45+p] = '0'+seen[find(m*a+b, uf)];
seen[find(m*a+b, uf)] = 1;
p++;
}
}
fill(seen.begin(), seen.end(), 0);
prv = 0;
for (int b = m-1; b >= 0; b--) {
for (int a = 0; a < m; a++) {
if (a && b) continue;
if (!grid[a][b]) {
prv = 0;
continue;
}
if (prv) continue;
prv = 1;
--p;
res[1+p] = '0'+seen[find(m*a+b, uf)];
seen[find(m*a+b, uf)] = 1;
}
}
}
for (int a = 0; a < m; a++) {
delete[] grid[a];
}
delete[] grid;
return res;
}
if (i > j) {
if (i & 1) return visible[0][0];
string res(100, '0');
for (int a = 0; a < 2; a++) {
for (int b = 0; b < m; b++) {
if (b <= 2) res[50*a+b] = visible[b][a][0];
else res[50*a+b] = visible[2][0][50*a+b-2];
}
}
return res;
}
if (j & 1) return visible[0][0];
string res(100, '0');
for (int a = 0; a < 2; a++) {
for (int b = 0; b < m; b++) {
if (b <= 2) res[50*a+b] = visible[a][b][0];
else res[50*a+b] = visible[0][2][50*a+b-2];
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
37 |
Correct |
157 ms |
3812 KB |
Output is correct |
38 |
Correct |
206 ms |
3816 KB |
Output is correct |
39 |
Correct |
198 ms |
3892 KB |
Output is correct |
40 |
Correct |
185 ms |
3964 KB |
Output is correct |
41 |
Correct |
203 ms |
3976 KB |
Output is correct |
42 |
Correct |
216 ms |
3868 KB |
Output is correct |
43 |
Correct |
187 ms |
3988 KB |
Output is correct |
44 |
Correct |
196 ms |
3752 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
37 |
Correct |
157 ms |
3812 KB |
Output is correct |
38 |
Correct |
206 ms |
3816 KB |
Output is correct |
39 |
Correct |
198 ms |
3892 KB |
Output is correct |
40 |
Correct |
185 ms |
3964 KB |
Output is correct |
41 |
Correct |
203 ms |
3976 KB |
Output is correct |
42 |
Correct |
216 ms |
3868 KB |
Output is correct |
43 |
Correct |
187 ms |
3988 KB |
Output is correct |
44 |
Correct |
196 ms |
3752 KB |
Output is correct |
45 |
Correct |
258 ms |
4052 KB |
Output is correct |
46 |
Correct |
318 ms |
4216 KB |
Output is correct |
47 |
Correct |
310 ms |
4144 KB |
Output is correct |
48 |
Correct |
333 ms |
4196 KB |
Output is correct |
49 |
Correct |
359 ms |
4164 KB |
Output is correct |
50 |
Correct |
325 ms |
3948 KB |
Output is correct |
51 |
Correct |
338 ms |
3928 KB |
Output is correct |
52 |
Correct |
307 ms |
4304 KB |
Output is correct |
53 |
Correct |
344 ms |
4432 KB |
Output is correct |
54 |
Correct |
332 ms |
4080 KB |
Output is correct |
55 |
Correct |
322 ms |
4396 KB |
Output is correct |
56 |
Correct |
321 ms |
4132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
37 |
Correct |
157 ms |
3812 KB |
Output is correct |
38 |
Correct |
206 ms |
3816 KB |
Output is correct |
39 |
Correct |
198 ms |
3892 KB |
Output is correct |
40 |
Correct |
185 ms |
3964 KB |
Output is correct |
41 |
Correct |
203 ms |
3976 KB |
Output is correct |
42 |
Correct |
216 ms |
3868 KB |
Output is correct |
43 |
Correct |
187 ms |
3988 KB |
Output is correct |
44 |
Correct |
196 ms |
3752 KB |
Output is correct |
45 |
Correct |
258 ms |
4052 KB |
Output is correct |
46 |
Correct |
318 ms |
4216 KB |
Output is correct |
47 |
Correct |
310 ms |
4144 KB |
Output is correct |
48 |
Correct |
333 ms |
4196 KB |
Output is correct |
49 |
Correct |
359 ms |
4164 KB |
Output is correct |
50 |
Correct |
325 ms |
3948 KB |
Output is correct |
51 |
Correct |
338 ms |
3928 KB |
Output is correct |
52 |
Correct |
307 ms |
4304 KB |
Output is correct |
53 |
Correct |
344 ms |
4432 KB |
Output is correct |
54 |
Correct |
332 ms |
4080 KB |
Output is correct |
55 |
Correct |
322 ms |
4396 KB |
Output is correct |
56 |
Correct |
321 ms |
4132 KB |
Output is correct |
57 |
Correct |
369 ms |
4676 KB |
Output is correct |
58 |
Correct |
487 ms |
5668 KB |
Output is correct |
59 |
Correct |
463 ms |
4708 KB |
Output is correct |
60 |
Correct |
472 ms |
4872 KB |
Output is correct |
61 |
Correct |
432 ms |
4584 KB |
Output is correct |
62 |
Correct |
487 ms |
4924 KB |
Output is correct |
63 |
Correct |
439 ms |
4940 KB |
Output is correct |
64 |
Correct |
479 ms |
6516 KB |
Output is correct |
65 |
Correct |
472 ms |
5300 KB |
Output is correct |
66 |
Correct |
458 ms |
4916 KB |
Output is correct |
67 |
Correct |
504 ms |
5200 KB |
Output is correct |
68 |
Correct |
494 ms |
5464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
37 |
Correct |
157 ms |
3812 KB |
Output is correct |
38 |
Correct |
206 ms |
3816 KB |
Output is correct |
39 |
Correct |
198 ms |
3892 KB |
Output is correct |
40 |
Correct |
185 ms |
3964 KB |
Output is correct |
41 |
Correct |
203 ms |
3976 KB |
Output is correct |
42 |
Correct |
216 ms |
3868 KB |
Output is correct |
43 |
Correct |
187 ms |
3988 KB |
Output is correct |
44 |
Correct |
196 ms |
3752 KB |
Output is correct |
45 |
Correct |
258 ms |
4052 KB |
Output is correct |
46 |
Correct |
318 ms |
4216 KB |
Output is correct |
47 |
Correct |
310 ms |
4144 KB |
Output is correct |
48 |
Correct |
333 ms |
4196 KB |
Output is correct |
49 |
Correct |
359 ms |
4164 KB |
Output is correct |
50 |
Correct |
325 ms |
3948 KB |
Output is correct |
51 |
Correct |
338 ms |
3928 KB |
Output is correct |
52 |
Correct |
307 ms |
4304 KB |
Output is correct |
53 |
Correct |
344 ms |
4432 KB |
Output is correct |
54 |
Correct |
332 ms |
4080 KB |
Output is correct |
55 |
Correct |
322 ms |
4396 KB |
Output is correct |
56 |
Correct |
321 ms |
4132 KB |
Output is correct |
57 |
Correct |
369 ms |
4676 KB |
Output is correct |
58 |
Correct |
487 ms |
5668 KB |
Output is correct |
59 |
Correct |
463 ms |
4708 KB |
Output is correct |
60 |
Correct |
472 ms |
4872 KB |
Output is correct |
61 |
Correct |
432 ms |
4584 KB |
Output is correct |
62 |
Correct |
487 ms |
4924 KB |
Output is correct |
63 |
Correct |
439 ms |
4940 KB |
Output is correct |
64 |
Correct |
479 ms |
6516 KB |
Output is correct |
65 |
Correct |
472 ms |
5300 KB |
Output is correct |
66 |
Correct |
458 ms |
4916 KB |
Output is correct |
67 |
Correct |
504 ms |
5200 KB |
Output is correct |
68 |
Correct |
494 ms |
5464 KB |
Output is correct |
69 |
Correct |
580 ms |
5188 KB |
Output is correct |
70 |
Correct |
698 ms |
5188 KB |
Output is correct |
71 |
Correct |
647 ms |
6860 KB |
Output is correct |
72 |
Correct |
764 ms |
5164 KB |
Output is correct |
73 |
Correct |
716 ms |
5128 KB |
Output is correct |
74 |
Correct |
712 ms |
5164 KB |
Output is correct |
75 |
Correct |
656 ms |
5072 KB |
Output is correct |
76 |
Correct |
719 ms |
5160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2324 KB |
Output is correct |
3 |
Correct |
10 ms |
2592 KB |
Output is correct |
4 |
Correct |
6 ms |
2444 KB |
Output is correct |
5 |
Correct |
5 ms |
2492 KB |
Output is correct |
6 |
Correct |
9 ms |
2432 KB |
Output is correct |
7 |
Correct |
10 ms |
2412 KB |
Output is correct |
8 |
Correct |
11 ms |
2292 KB |
Output is correct |
9 |
Correct |
10 ms |
2320 KB |
Output is correct |
10 |
Correct |
10 ms |
2556 KB |
Output is correct |
11 |
Correct |
11 ms |
2544 KB |
Output is correct |
12 |
Correct |
14 ms |
2252 KB |
Output is correct |
13 |
Correct |
13 ms |
2228 KB |
Output is correct |
14 |
Correct |
20 ms |
3084 KB |
Output is correct |
15 |
Correct |
27 ms |
3092 KB |
Output is correct |
16 |
Correct |
26 ms |
3112 KB |
Output is correct |
17 |
Correct |
27 ms |
3076 KB |
Output is correct |
18 |
Correct |
28 ms |
2844 KB |
Output is correct |
19 |
Correct |
27 ms |
3220 KB |
Output is correct |
20 |
Correct |
30 ms |
3204 KB |
Output is correct |
21 |
Correct |
39 ms |
3168 KB |
Output is correct |
22 |
Correct |
57 ms |
3264 KB |
Output is correct |
23 |
Correct |
59 ms |
3316 KB |
Output is correct |
24 |
Correct |
59 ms |
3320 KB |
Output is correct |
25 |
Correct |
60 ms |
3320 KB |
Output is correct |
26 |
Correct |
61 ms |
3264 KB |
Output is correct |
27 |
Correct |
60 ms |
3028 KB |
Output is correct |
28 |
Correct |
60 ms |
3248 KB |
Output is correct |
29 |
Correct |
82 ms |
3376 KB |
Output is correct |
30 |
Correct |
112 ms |
3476 KB |
Output is correct |
31 |
Correct |
117 ms |
3640 KB |
Output is correct |
32 |
Correct |
112 ms |
3480 KB |
Output is correct |
33 |
Correct |
109 ms |
3212 KB |
Output is correct |
34 |
Correct |
115 ms |
3472 KB |
Output is correct |
35 |
Correct |
112 ms |
3408 KB |
Output is correct |
36 |
Correct |
116 ms |
3448 KB |
Output is correct |
37 |
Correct |
157 ms |
3812 KB |
Output is correct |
38 |
Correct |
206 ms |
3816 KB |
Output is correct |
39 |
Correct |
198 ms |
3892 KB |
Output is correct |
40 |
Correct |
185 ms |
3964 KB |
Output is correct |
41 |
Correct |
203 ms |
3976 KB |
Output is correct |
42 |
Correct |
216 ms |
3868 KB |
Output is correct |
43 |
Correct |
187 ms |
3988 KB |
Output is correct |
44 |
Correct |
196 ms |
3752 KB |
Output is correct |
45 |
Correct |
258 ms |
4052 KB |
Output is correct |
46 |
Correct |
318 ms |
4216 KB |
Output is correct |
47 |
Correct |
310 ms |
4144 KB |
Output is correct |
48 |
Correct |
333 ms |
4196 KB |
Output is correct |
49 |
Correct |
359 ms |
4164 KB |
Output is correct |
50 |
Correct |
325 ms |
3948 KB |
Output is correct |
51 |
Correct |
338 ms |
3928 KB |
Output is correct |
52 |
Correct |
307 ms |
4304 KB |
Output is correct |
53 |
Correct |
344 ms |
4432 KB |
Output is correct |
54 |
Correct |
332 ms |
4080 KB |
Output is correct |
55 |
Correct |
322 ms |
4396 KB |
Output is correct |
56 |
Correct |
321 ms |
4132 KB |
Output is correct |
57 |
Correct |
369 ms |
4676 KB |
Output is correct |
58 |
Correct |
487 ms |
5668 KB |
Output is correct |
59 |
Correct |
463 ms |
4708 KB |
Output is correct |
60 |
Correct |
472 ms |
4872 KB |
Output is correct |
61 |
Correct |
432 ms |
4584 KB |
Output is correct |
62 |
Correct |
487 ms |
4924 KB |
Output is correct |
63 |
Correct |
439 ms |
4940 KB |
Output is correct |
64 |
Correct |
479 ms |
6516 KB |
Output is correct |
65 |
Correct |
472 ms |
5300 KB |
Output is correct |
66 |
Correct |
458 ms |
4916 KB |
Output is correct |
67 |
Correct |
504 ms |
5200 KB |
Output is correct |
68 |
Correct |
494 ms |
5464 KB |
Output is correct |
69 |
Correct |
580 ms |
5188 KB |
Output is correct |
70 |
Correct |
698 ms |
5188 KB |
Output is correct |
71 |
Correct |
647 ms |
6860 KB |
Output is correct |
72 |
Correct |
764 ms |
5164 KB |
Output is correct |
73 |
Correct |
716 ms |
5128 KB |
Output is correct |
74 |
Correct |
712 ms |
5164 KB |
Output is correct |
75 |
Correct |
656 ms |
5072 KB |
Output is correct |
76 |
Correct |
719 ms |
5160 KB |
Output is correct |
77 |
Correct |
665 ms |
5164 KB |
Output is correct |
78 |
Correct |
937 ms |
5700 KB |
Output is correct |
79 |
Correct |
942 ms |
5464 KB |
Output is correct |
80 |
Correct |
933 ms |
5544 KB |
Output is correct |
81 |
Correct |
932 ms |
5500 KB |
Output is correct |
82 |
Correct |
917 ms |
5516 KB |
Output is correct |
83 |
Correct |
908 ms |
5512 KB |
Output is correct |
84 |
Correct |
964 ms |
5596 KB |
Output is correct |