# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
838655 |
2023-08-27T14:15:19 Z |
makrav |
Maze (JOI23_ho_t3) |
C++14 |
|
2000 ms |
128692 KB |
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vei;
typedef vector<vei> vevei;
#define all(a) (a).begin(), (a).end()
#define sz(a) (int) a.size()
#define con cout << "NO\n"
#define coe cout << "YES\n";
#define str string
#define pb push_back
#define ff first
#define sc second
#define pii pair<int, int>
#define mxe max_element
#define mne min_element
#define stf shrink_to_fit
#define f(i, l, r) for (int i = (l); i < (r); i++)
#define double ld
vector<str> a;
vector<vector<pii>> comps;
vector<vector<int>> used;
int n, m;
void dfs(int i, int j) {
used[i][j] = 1;
comps.back().pb({ i, j });
if (i - 1 >= 0 && a[i - 1][j] == '.' && !used[i - 1][j]) dfs(i - 1, j);
if (i + 1 < n && a[i + 1][j] == '.' && !used[i + 1][j]) dfs(i + 1, j);
if (j - 1 >= 0 && a[i][j - 1] == '.' && !used[i][j - 1]) dfs(i, j - 1);
if (j + 1 < m && a[i][j + 1] == '.' && !used[i][j + 1]) dfs(i, j + 1);
}
struct node {
int sm;
node() = default;
node(int a) {
sm = a;
}
};
struct segtree {
int n;
vector<int> a;
vector<node> t;
segtree() = default;
segtree(int n_, vector<int> a_) {
n = n_;
a = a_;
t.resize(4 * n);
build(1, 0, n);
}
void build(int v, int tl, int tr) {
if (tl + 1 == tr) {
t[v] = node(a[tl]);
return;
}
int tm = (tl + tr) / 2;
build(v * 2, tl, tm);
build(v * 2 + 1, tm, tr);
t[v].sm = t[v * 2].sm + t[v * 2 + 1].sm;
}
void upd(int v, int tl, int tr, int pos, int val) {
if (tl + 1 == tr) {
t[v] = node(val);return;
}
int tm = (tl + tr) / 2;
if (pos < tm) {
upd(v * 2, tl, tm, pos, val);
}
else {
upd(v * 2 + 1, tm, tr, pos, val);
}
t[v].sm = t[v * 2].sm + t[v * 2 + 1].sm;
}
pair<int, int> getkth(int v, int tl, int tr, int l, int r, int k) {
if (tr <= l || tl >= r) return { -1, 0 };
if (l <= tl && tr <= r) {
if (t[v].sm < k) return { -1, t[v].sm };
if (tl + 1 == tr) return { tl, t[v].sm };
int tm = (tl + tr) / 2;
if (t[v * 2].sm >= k) return getkth(v * 2, tl, tm, l, r, k);
else return getkth(v * 2 + 1, tm, tr, l, r, k - t[v * 2].sm);
}
int tm = (tl + tr) / 2;
pii lft = getkth(v * 2, tl, tm, l, r, k);
if (lft.ff != -1) return lft;
else return getkth(v * 2 + 1, tm, tr, l, r, k - lft.sc);
}
};
bool check(pii a, pii b, int k) {
return (max(abs(a.ff - b.ff), abs(a.sc - b.sc)) <= k && min(abs(a.ff - b.ff), abs(a.sc - b.sc)) <= k - 1);
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int k; cin >> n >> m >> k;
pii s, g;
cin >> s.ff >> s.sc >> g.ff >> g.sc;
s.ff--; s.sc--; g.ff--; g.sc--;
a.resize(n);
used.assign(n, vector<int>(m, 0));
f(i, 0, n) cin >> a[i];
vector<vector<int>> comp(n, vector<int>(m, 0));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (a[i][j] == '.' && used[i][j] == 0) {
comps.pb({});
dfs(i, j);
for (auto& u : comps.back()) {
comp[u.ff][u.sc] = sz(comps) - 1;
}
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (a[i][j] == '#') {
comps.pb({ {i, j} });
comp[i][j] = sz(comps) - 1;
}
}
}
vector<vector<int>> dist(n, vector<int>(m, -1));
vector<segtree> sg(n);
vector<int> B(m, 1);
f(i, 0, n) {
sg[i] = segtree(m, B);
}
queue<pair<int, int>> q;
for (auto& u : comps[comp[s.ff][s.sc]]) {
q.push(u);
dist[u.ff][u.sc] = 0;
sg[u.ff].upd(1, 0, m, u.sc, 0);
}
while (!q.empty()) {
auto [i, j] = q.front();
q.pop();
int curd = dist[i][j];
// for (int i1 = i - 2; i1 <= i + 2; i1++) {
// for (int j1 = j - (2 - abs(i - i1)); j1 <= j + abs(2 - abs(i - i1)); j1++) {
// if (0 <= i1 && i1 < n && 0 <= j1 && j1 < m) {
// if ((!check({ i, j }, { i1, j1 }, k) && a[i1][j1] == '#') || dist[i1][j1] != -1) continue;
// for (auto& u : comps[comp[i1][j1]]) {
// dist[u.ff][u.sc] = curd + 1;
// q.push(u);
// }
// }
// }
// }
for (int row = max(0, i - k - 1); row <= min(n - 1, i + k + 1); row++) {
int l = max(0, j - k - 1), r = min(m - 1, j + k + 1) + 1;
if (row == i - k - 1 || row == i + k + 1) {
l = max(0, j - k + 1);
r = min(m - 1, j + k - 1) + 1;
}
if (row == i - k || row == i + k) {
l = max(0, j - k);
r = min(m - 1, j + k) + 1;
}
int K = 1;
int nw = sg[row].getkth(1, 0, m, l, r, K).ff;
while (nw != -1) {
if (!check({ i, j }, { row, nw }, k) && a[row][nw] == '#') {
K++;
nw = sg[row].getkth(1, 0, m, l, r, K).ff;
continue;
}
for (auto& u : comps[comp[row][nw]]) {
dist[u.ff][u.sc] = curd + 1;
q.push(u);
sg[u.ff].upd(1, 0, m, u.sc, 0);
}
nw = sg[row].getkth(1, 0, m, l, r, K).ff;
}
}
}
cout << dist[g.ff][g.sc] << '\n';
return 0;
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:155:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
155 | auto [i, j] = q.front();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 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 |
45 ms |
5384 KB |
Output is correct |
20 |
Correct |
20 ms |
4688 KB |
Output is correct |
21 |
Correct |
23 ms |
8272 KB |
Output is correct |
22 |
Correct |
35 ms |
4744 KB |
Output is correct |
23 |
Correct |
42 ms |
5604 KB |
Output is correct |
24 |
Correct |
13 ms |
3432 KB |
Output is correct |
25 |
Correct |
27 ms |
6112 KB |
Output is correct |
26 |
Correct |
33 ms |
4616 KB |
Output is correct |
27 |
Correct |
34 ms |
4872 KB |
Output is correct |
28 |
Correct |
37 ms |
5640 KB |
Output is correct |
29 |
Correct |
119 ms |
13184 KB |
Output is correct |
30 |
Correct |
34 ms |
5384 KB |
Output is correct |
31 |
Correct |
58 ms |
21444 KB |
Output is correct |
32 |
Correct |
95 ms |
11524 KB |
Output is correct |
33 |
Correct |
135 ms |
13440 KB |
Output is correct |
34 |
Correct |
35 ms |
8072 KB |
Output is correct |
35 |
Correct |
72 ms |
14588 KB |
Output is correct |
36 |
Correct |
104 ms |
10764 KB |
Output is correct |
37 |
Correct |
94 ms |
11640 KB |
Output is correct |
38 |
Correct |
103 ms |
13568 KB |
Output is correct |
39 |
Correct |
1390 ms |
128692 KB |
Output is correct |
40 |
Correct |
118 ms |
12136 KB |
Output is correct |
41 |
Correct |
61 ms |
11948 KB |
Output is correct |
42 |
Correct |
167 ms |
18472 KB |
Output is correct |
43 |
Correct |
142 ms |
21484 KB |
Output is correct |
44 |
Correct |
518 ms |
45704 KB |
Output is correct |
45 |
Incorrect |
709 ms |
70760 KB |
Output isn't correct |
46 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
592 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
356 KB |
Output is correct |
12 |
Correct |
1 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
212 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 |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
464 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
468 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
468 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
428 KB |
Output is correct |
17 |
Correct |
0 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
0 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
1 ms |
340 KB |
Output is correct |
22 |
Correct |
1 ms |
340 KB |
Output is correct |
23 |
Correct |
1 ms |
340 KB |
Output is correct |
24 |
Correct |
3 ms |
468 KB |
Output is correct |
25 |
Correct |
35 ms |
3212 KB |
Output is correct |
26 |
Correct |
57 ms |
6092 KB |
Output is correct |
27 |
Correct |
21 ms |
8400 KB |
Output is correct |
28 |
Correct |
103 ms |
8780 KB |
Output is correct |
29 |
Correct |
100 ms |
5256 KB |
Output is correct |
30 |
Correct |
95 ms |
6152 KB |
Output is correct |
31 |
Correct |
323 ms |
4872 KB |
Output is correct |
32 |
Correct |
32 ms |
4616 KB |
Output is correct |
33 |
Correct |
40 ms |
4880 KB |
Output is correct |
34 |
Correct |
923 ms |
12436 KB |
Output is correct |
35 |
Correct |
66 ms |
21552 KB |
Output is correct |
36 |
Correct |
374 ms |
21940 KB |
Output is correct |
37 |
Correct |
378 ms |
12804 KB |
Output is correct |
38 |
Correct |
404 ms |
14848 KB |
Output is correct |
39 |
Correct |
1896 ms |
41628 KB |
Output is correct |
40 |
Execution timed out |
2029 ms |
122140 KB |
Time limit exceeded |
41 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
592 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
356 KB |
Output is correct |
12 |
Correct |
1 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
212 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 |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
464 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
49 ms |
5508 KB |
Output is correct |
34 |
Correct |
3 ms |
468 KB |
Output is correct |
35 |
Correct |
3 ms |
724 KB |
Output is correct |
36 |
Correct |
34 ms |
3212 KB |
Output is correct |
37 |
Correct |
23 ms |
4688 KB |
Output is correct |
38 |
Correct |
59 ms |
6092 KB |
Output is correct |
39 |
Correct |
21 ms |
8400 KB |
Output is correct |
40 |
Correct |
35 ms |
4876 KB |
Output is correct |
41 |
Correct |
43 ms |
5640 KB |
Output is correct |
42 |
Correct |
95 ms |
8784 KB |
Output is correct |
43 |
Correct |
103 ms |
5256 KB |
Output is correct |
44 |
Correct |
95 ms |
6152 KB |
Output is correct |
45 |
Correct |
16 ms |
3548 KB |
Output is correct |
46 |
Correct |
27 ms |
5984 KB |
Output is correct |
47 |
Correct |
38 ms |
5380 KB |
Output is correct |
48 |
Correct |
109 ms |
4872 KB |
Output is correct |
49 |
Correct |
148 ms |
4916 KB |
Output is correct |
50 |
Correct |
217 ms |
4744 KB |
Output is correct |
51 |
Correct |
319 ms |
4872 KB |
Output is correct |
52 |
Correct |
33 ms |
4616 KB |
Output is correct |
53 |
Correct |
37 ms |
4860 KB |
Output is correct |
54 |
Correct |
37 ms |
5640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
592 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
356 KB |
Output is correct |
12 |
Correct |
1 ms |
468 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
340 KB |
Output is correct |
16 |
Correct |
1 ms |
340 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
212 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 |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
464 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
49 ms |
5508 KB |
Output is correct |
34 |
Correct |
3 ms |
468 KB |
Output is correct |
35 |
Correct |
3 ms |
724 KB |
Output is correct |
36 |
Correct |
34 ms |
3212 KB |
Output is correct |
37 |
Correct |
23 ms |
4688 KB |
Output is correct |
38 |
Correct |
59 ms |
6092 KB |
Output is correct |
39 |
Correct |
21 ms |
8400 KB |
Output is correct |
40 |
Correct |
35 ms |
4876 KB |
Output is correct |
41 |
Correct |
43 ms |
5640 KB |
Output is correct |
42 |
Correct |
95 ms |
8784 KB |
Output is correct |
43 |
Correct |
103 ms |
5256 KB |
Output is correct |
44 |
Correct |
95 ms |
6152 KB |
Output is correct |
45 |
Correct |
16 ms |
3548 KB |
Output is correct |
46 |
Correct |
27 ms |
5984 KB |
Output is correct |
47 |
Correct |
38 ms |
5380 KB |
Output is correct |
48 |
Correct |
109 ms |
4872 KB |
Output is correct |
49 |
Correct |
148 ms |
4916 KB |
Output is correct |
50 |
Correct |
217 ms |
4744 KB |
Output is correct |
51 |
Correct |
319 ms |
4872 KB |
Output is correct |
52 |
Correct |
33 ms |
4616 KB |
Output is correct |
53 |
Correct |
37 ms |
4860 KB |
Output is correct |
54 |
Correct |
37 ms |
5640 KB |
Output is correct |
55 |
Correct |
113 ms |
13312 KB |
Output is correct |
56 |
Correct |
33 ms |
5400 KB |
Output is correct |
57 |
Correct |
954 ms |
12496 KB |
Output is correct |
58 |
Correct |
152 ms |
11272 KB |
Output is correct |
59 |
Correct |
59 ms |
21572 KB |
Output is correct |
60 |
Correct |
101 ms |
11652 KB |
Output is correct |
61 |
Correct |
127 ms |
13568 KB |
Output is correct |
62 |
Correct |
387 ms |
21952 KB |
Output is correct |
63 |
Correct |
382 ms |
12796 KB |
Output is correct |
64 |
Correct |
402 ms |
14840 KB |
Output is correct |
65 |
Correct |
34 ms |
8328 KB |
Output is correct |
66 |
Correct |
78 ms |
14716 KB |
Output is correct |
67 |
Correct |
78 ms |
12832 KB |
Output is correct |
68 |
Correct |
355 ms |
11664 KB |
Output is correct |
69 |
Correct |
518 ms |
11644 KB |
Output is correct |
70 |
Correct |
795 ms |
11652 KB |
Output is correct |
71 |
Correct |
1181 ms |
11780 KB |
Output is correct |
72 |
Correct |
86 ms |
11012 KB |
Output is correct |
73 |
Correct |
91 ms |
11792 KB |
Output is correct |
74 |
Correct |
108 ms |
13696 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 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 |
45 ms |
5384 KB |
Output is correct |
20 |
Correct |
20 ms |
4688 KB |
Output is correct |
21 |
Correct |
23 ms |
8272 KB |
Output is correct |
22 |
Correct |
35 ms |
4744 KB |
Output is correct |
23 |
Correct |
42 ms |
5604 KB |
Output is correct |
24 |
Correct |
13 ms |
3432 KB |
Output is correct |
25 |
Correct |
27 ms |
6112 KB |
Output is correct |
26 |
Correct |
33 ms |
4616 KB |
Output is correct |
27 |
Correct |
34 ms |
4872 KB |
Output is correct |
28 |
Correct |
37 ms |
5640 KB |
Output is correct |
29 |
Correct |
119 ms |
13184 KB |
Output is correct |
30 |
Correct |
34 ms |
5384 KB |
Output is correct |
31 |
Correct |
58 ms |
21444 KB |
Output is correct |
32 |
Correct |
95 ms |
11524 KB |
Output is correct |
33 |
Correct |
135 ms |
13440 KB |
Output is correct |
34 |
Correct |
35 ms |
8072 KB |
Output is correct |
35 |
Correct |
72 ms |
14588 KB |
Output is correct |
36 |
Correct |
104 ms |
10764 KB |
Output is correct |
37 |
Correct |
94 ms |
11640 KB |
Output is correct |
38 |
Correct |
103 ms |
13568 KB |
Output is correct |
39 |
Correct |
1390 ms |
128692 KB |
Output is correct |
40 |
Correct |
118 ms |
12136 KB |
Output is correct |
41 |
Correct |
61 ms |
11948 KB |
Output is correct |
42 |
Correct |
167 ms |
18472 KB |
Output is correct |
43 |
Correct |
142 ms |
21484 KB |
Output is correct |
44 |
Correct |
518 ms |
45704 KB |
Output is correct |
45 |
Incorrect |
709 ms |
70760 KB |
Output isn't correct |
46 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 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 |
45 ms |
5384 KB |
Output is correct |
20 |
Correct |
20 ms |
4688 KB |
Output is correct |
21 |
Correct |
23 ms |
8272 KB |
Output is correct |
22 |
Correct |
35 ms |
4744 KB |
Output is correct |
23 |
Correct |
42 ms |
5604 KB |
Output is correct |
24 |
Correct |
13 ms |
3432 KB |
Output is correct |
25 |
Correct |
27 ms |
6112 KB |
Output is correct |
26 |
Correct |
33 ms |
4616 KB |
Output is correct |
27 |
Correct |
34 ms |
4872 KB |
Output is correct |
28 |
Correct |
37 ms |
5640 KB |
Output is correct |
29 |
Correct |
119 ms |
13184 KB |
Output is correct |
30 |
Correct |
34 ms |
5384 KB |
Output is correct |
31 |
Correct |
58 ms |
21444 KB |
Output is correct |
32 |
Correct |
95 ms |
11524 KB |
Output is correct |
33 |
Correct |
135 ms |
13440 KB |
Output is correct |
34 |
Correct |
35 ms |
8072 KB |
Output is correct |
35 |
Correct |
72 ms |
14588 KB |
Output is correct |
36 |
Correct |
104 ms |
10764 KB |
Output is correct |
37 |
Correct |
94 ms |
11640 KB |
Output is correct |
38 |
Correct |
103 ms |
13568 KB |
Output is correct |
39 |
Correct |
1390 ms |
128692 KB |
Output is correct |
40 |
Correct |
118 ms |
12136 KB |
Output is correct |
41 |
Correct |
61 ms |
11948 KB |
Output is correct |
42 |
Correct |
167 ms |
18472 KB |
Output is correct |
43 |
Correct |
142 ms |
21484 KB |
Output is correct |
44 |
Correct |
518 ms |
45704 KB |
Output is correct |
45 |
Incorrect |
709 ms |
70760 KB |
Output isn't correct |
46 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
468 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
1 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 |
45 ms |
5384 KB |
Output is correct |
20 |
Correct |
20 ms |
4688 KB |
Output is correct |
21 |
Correct |
23 ms |
8272 KB |
Output is correct |
22 |
Correct |
35 ms |
4744 KB |
Output is correct |
23 |
Correct |
42 ms |
5604 KB |
Output is correct |
24 |
Correct |
13 ms |
3432 KB |
Output is correct |
25 |
Correct |
27 ms |
6112 KB |
Output is correct |
26 |
Correct |
33 ms |
4616 KB |
Output is correct |
27 |
Correct |
34 ms |
4872 KB |
Output is correct |
28 |
Correct |
37 ms |
5640 KB |
Output is correct |
29 |
Correct |
119 ms |
13184 KB |
Output is correct |
30 |
Correct |
34 ms |
5384 KB |
Output is correct |
31 |
Correct |
58 ms |
21444 KB |
Output is correct |
32 |
Correct |
95 ms |
11524 KB |
Output is correct |
33 |
Correct |
135 ms |
13440 KB |
Output is correct |
34 |
Correct |
35 ms |
8072 KB |
Output is correct |
35 |
Correct |
72 ms |
14588 KB |
Output is correct |
36 |
Correct |
104 ms |
10764 KB |
Output is correct |
37 |
Correct |
94 ms |
11640 KB |
Output is correct |
38 |
Correct |
103 ms |
13568 KB |
Output is correct |
39 |
Correct |
1390 ms |
128692 KB |
Output is correct |
40 |
Correct |
118 ms |
12136 KB |
Output is correct |
41 |
Correct |
61 ms |
11948 KB |
Output is correct |
42 |
Correct |
167 ms |
18472 KB |
Output is correct |
43 |
Correct |
142 ms |
21484 KB |
Output is correct |
44 |
Correct |
518 ms |
45704 KB |
Output is correct |
45 |
Incorrect |
709 ms |
70760 KB |
Output isn't correct |
46 |
Halted |
0 ms |
0 KB |
- |