#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (int)1.01e9;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
void print(vector<int> a) {
for (int x : a) printf("%d\n", x);
}
struct segtree {
int N;
vector<int> t;
segtree(int n) {
N = 1;
while (N < n) N <<= 1;
t.assign(2 * N, INF);
}
void upd(int x, int y) {
x += N;
while (x) {
t[x] = min(t[x], y);
x >>= 1;
}
}
int get(int l, int r) {
l += N;
r += N;
int ans = INF;
while (l <= r) {
if (l & 1) ans = min(ans, t[l]);
if (!(r & 1)) ans = min(ans, t[r]);
l = (l + 1) >> 1;
r = (r - 1) >> 1;
}
return ans;
}
};
vector<int> fast(vector<pair<int, int>> a, vector<pair<int, pair<int, int>>> b) {
int n = a.size();
sort(a.begin(), a.end());
auto getId = [&](pair<int, int> o) {
int id = lower_bound(a.begin(), a.end(), o) - a.begin();
if (id == n || a[id] != o) return -1;
return id;
};
vector<int> ans(b.size(), INF);
vector<vector<int>> eC(n);
for (int i = 0; i < n; i++) {
for (int k = 0; k < 2; k++) {
int to = getId({ a[i].first + dx[k], a[i].second + dy[k] });
if (to != -1) {
eC[i].push_back(to);
eC[to].push_back(i);
}
}
}
vector<int> c(n, -1);
vector<vector<int>> vct;
int m = 0;
for (int i = 0; i < n; i++) {
if (c[i] != -1) continue;
vct.push_back(vector<int>());
for (int x = a[i].first;; x++) {
int id = getId({ x, a[i].second });
if (id == -1) break;
c[id] = m;
vct[m].push_back(id);
}
m++;
}
vector<pair<int, int>> ed;
for (int i = 0; i < n; i++) {
int id = getId({ a[i].first, a[i].second + 1 });
if (id != -1) {
ed.push_back({ c[i], c[id] });
}
}
sort(ed.begin(), ed.end());
ed.resize(unique(ed.begin(), ed.end()) - ed.begin());
vector<vector<int>> eT(m);
for (auto o : ed) {
eT[o.first].push_back(o.second);
eT[o.second].push_back(o.first);
}
vector<char> aliveC(n, 1), aliveT(m, 1);
vector<int> visC(n, 0), visT(m, 0);
int tmr = 0;
vector<int> cntT(m);
vector<int> d(n), p(n);
vector<int> comp(m);
function<void(int)> dfs1 = [&](int v) {
visT[v] = tmr;
cntT[v] = 1;
for (int to : eT[v]) {
if (!aliveT[to] || visT[to] == tmr) continue;
dfs1(to);
cntT[v] += cntT[to];
}
};
function<void(int, int)> dfs2 = [&](int v, int nw) {
visT[v] = tmr;
comp[v] = nw;
for (int to : eT[v]) {
if (!aliveT[to] || visT[to] == tmr) continue;
dfs2(to, nw);
}
};
function<void(int, vector<pair<int, int>>)> solve = [&](int v, vector<pair<int, int>> query) {
tmr++;
dfs1(v);
int all = cntT[v], pr = -1;
while (1) {
int f = 0;
for (int to : eT[v]) {
if (to == pr || !aliveT[to]) continue;
if (cntT[to] * 2 >= all) {
f = 1;
pr = v;
v = to;
break;
}
}
if (!f) break;
}
aliveT[v] = 0;
for (int u : vct[v]) aliveC[u] = 0;
tmr++;
vector<int> q;
for (int i = 0; i < (int)vct[v].size(); i++) {
int u = vct[v][i];
d[u] = 0;
p[u] = i;
visC[u] = 0;
q.push_back(u);
}
for (int qq = 0; qq < (int)q.size(); qq++) {
int u = q[qq];
for (int to : eC[u]) {
if (!aliveC[to]) continue;
if (visC[to] != tmr) {
visC[to] = tmr;
d[to] = INF;
}
if (d[to] > d[u] + 1) {
d[to] = d[u] + 1;
p[to] = p[u];
q.push_back(to);
}
}
}
int k = vct[v].size();
segtree t1(k), t2(k);
for (auto cur : query) {
if (b[cur.first].first == 1) {
int u = cur.second;
int cd = d[u], ci = p[u];
t1.upd(ci, cd + ci);
t2.upd(ci, cd - ci);
}
else {
int u = cur.second;
int cd = d[u], ci = p[u];
int cres = min(t1.get(ci, k - 1) - ci, t2.get(0, ci) + ci) + cd;
ans[cur.first] = min(ans[cur.first], cres);
}
}
for (int i = 0; i < (int)eT[v].size(); i++) {
int to = eT[v][i];
if (!aliveT[to]) continue;
dfs2(to, i);
}
vector<vector<pair<int, int>>> nq(eT[v].size());
for (auto o : query) {
if (c[o.second] == v) continue;
nq[comp[c[o.second]]].push_back(o);
}
for (int i = 0; i < (int)eT[v].size(); i++) {
if (nq[i].empty()) continue;
solve(eT[v][i], nq[i]);
}
};
vector<pair<int, int>> query;
for (int i = 0; i < (int)b.size(); i++) query.push_back({ i, getId(b[i].second) });
solve(0, query);
for (int &x : ans) if (x > n) x = -1;
vector<int> res;
for (int i = 0; i < (int)b.size(); i++) if (b[i].first == 2) res.push_back(ans[i]);
return res;
}
int main() {
int n;
while (scanf("%d", &n) == 1) {
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++) scanf("%d%d", &a[i].first, &a[i].second);
int q;
scanf("%d", &q);
vector<pair<int, pair<int, int>>> b(q);
for (int i = 0; i < q; i++) scanf("%d%d%d", &b[i].first, &b[i].second.first, &b[i].second.second);
print(fast(a, b));
}
return 0;
}
Compilation message
C.cpp: In function 'int main()':
C.cpp:209:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i = 0; i < n; i++) scanf("%d%d", &a[i].first, &a[i].second);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C.cpp:211:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &q);
~~~~~^~~~~~~~~~
C.cpp:213:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i = 0; i < q; i++) scanf("%d%d%d", &b[i].first, &b[i].second.first, &b[i].second.second);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
10 ms |
1280 KB |
Output is correct |
5 |
Correct |
10 ms |
1280 KB |
Output is correct |
6 |
Correct |
13 ms |
1280 KB |
Output is correct |
7 |
Correct |
13 ms |
1408 KB |
Output is correct |
8 |
Correct |
11 ms |
1408 KB |
Output is correct |
9 |
Correct |
12 ms |
1408 KB |
Output is correct |
10 |
Correct |
13 ms |
1536 KB |
Output is correct |
11 |
Correct |
13 ms |
1656 KB |
Output is correct |
12 |
Correct |
13 ms |
1664 KB |
Output is correct |
13 |
Correct |
12 ms |
1536 KB |
Output is correct |
14 |
Correct |
12 ms |
1408 KB |
Output is correct |
15 |
Correct |
11 ms |
1536 KB |
Output is correct |
16 |
Correct |
11 ms |
1408 KB |
Output is correct |
17 |
Correct |
11 ms |
1408 KB |
Output is correct |
18 |
Correct |
13 ms |
1664 KB |
Output is correct |
19 |
Correct |
12 ms |
1536 KB |
Output is correct |
20 |
Correct |
12 ms |
1536 KB |
Output is correct |
21 |
Correct |
12 ms |
1536 KB |
Output is correct |
22 |
Correct |
11 ms |
1408 KB |
Output is correct |
23 |
Correct |
11 ms |
1536 KB |
Output is correct |
24 |
Correct |
11 ms |
1536 KB |
Output is correct |
25 |
Correct |
8 ms |
1208 KB |
Output is correct |
26 |
Correct |
13 ms |
1664 KB |
Output is correct |
27 |
Correct |
13 ms |
2176 KB |
Output is correct |
28 |
Correct |
11 ms |
1536 KB |
Output is correct |
29 |
Correct |
12 ms |
1536 KB |
Output is correct |
30 |
Correct |
11 ms |
1536 KB |
Output is correct |
31 |
Correct |
12 ms |
1564 KB |
Output is correct |
32 |
Correct |
14 ms |
1792 KB |
Output is correct |
33 |
Correct |
14 ms |
1792 KB |
Output is correct |
34 |
Correct |
12 ms |
1536 KB |
Output is correct |
35 |
Correct |
14 ms |
1792 KB |
Output is correct |
36 |
Correct |
7 ms |
1152 KB |
Output is correct |
37 |
Correct |
13 ms |
1792 KB |
Output is correct |
38 |
Correct |
14 ms |
1792 KB |
Output is correct |
39 |
Correct |
13 ms |
1792 KB |
Output is correct |
40 |
Correct |
14 ms |
1920 KB |
Output is correct |
41 |
Correct |
12 ms |
1536 KB |
Output is correct |
42 |
Correct |
11 ms |
1536 KB |
Output is correct |
43 |
Correct |
7 ms |
1152 KB |
Output is correct |
44 |
Correct |
13 ms |
1792 KB |
Output is correct |
45 |
Correct |
13 ms |
1792 KB |
Output is correct |
46 |
Correct |
13 ms |
1920 KB |
Output is correct |
47 |
Correct |
12 ms |
1408 KB |
Output is correct |
48 |
Correct |
11 ms |
1408 KB |
Output is correct |
49 |
Correct |
10 ms |
1408 KB |
Output is correct |
50 |
Correct |
11 ms |
1408 KB |
Output is correct |
51 |
Correct |
10 ms |
1280 KB |
Output is correct |
52 |
Correct |
12 ms |
1536 KB |
Output is correct |
53 |
Correct |
11 ms |
1408 KB |
Output is correct |
54 |
Correct |
11 ms |
1408 KB |
Output is correct |
55 |
Correct |
12 ms |
1408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
10 ms |
1280 KB |
Output is correct |
5 |
Correct |
10 ms |
1280 KB |
Output is correct |
6 |
Correct |
13 ms |
1280 KB |
Output is correct |
7 |
Correct |
13 ms |
1408 KB |
Output is correct |
8 |
Correct |
11 ms |
1408 KB |
Output is correct |
9 |
Correct |
12 ms |
1408 KB |
Output is correct |
10 |
Correct |
13 ms |
1536 KB |
Output is correct |
11 |
Correct |
13 ms |
1656 KB |
Output is correct |
12 |
Correct |
13 ms |
1664 KB |
Output is correct |
13 |
Correct |
12 ms |
1536 KB |
Output is correct |
14 |
Correct |
12 ms |
1408 KB |
Output is correct |
15 |
Correct |
11 ms |
1536 KB |
Output is correct |
16 |
Correct |
11 ms |
1408 KB |
Output is correct |
17 |
Correct |
11 ms |
1408 KB |
Output is correct |
18 |
Correct |
13 ms |
1664 KB |
Output is correct |
19 |
Correct |
12 ms |
1536 KB |
Output is correct |
20 |
Correct |
12 ms |
1536 KB |
Output is correct |
21 |
Correct |
12 ms |
1536 KB |
Output is correct |
22 |
Correct |
11 ms |
1408 KB |
Output is correct |
23 |
Correct |
11 ms |
1536 KB |
Output is correct |
24 |
Correct |
11 ms |
1536 KB |
Output is correct |
25 |
Correct |
8 ms |
1208 KB |
Output is correct |
26 |
Correct |
13 ms |
1664 KB |
Output is correct |
27 |
Correct |
13 ms |
2176 KB |
Output is correct |
28 |
Correct |
11 ms |
1536 KB |
Output is correct |
29 |
Correct |
12 ms |
1536 KB |
Output is correct |
30 |
Correct |
11 ms |
1536 KB |
Output is correct |
31 |
Correct |
12 ms |
1564 KB |
Output is correct |
32 |
Correct |
14 ms |
1792 KB |
Output is correct |
33 |
Correct |
14 ms |
1792 KB |
Output is correct |
34 |
Correct |
12 ms |
1536 KB |
Output is correct |
35 |
Correct |
14 ms |
1792 KB |
Output is correct |
36 |
Correct |
7 ms |
1152 KB |
Output is correct |
37 |
Correct |
13 ms |
1792 KB |
Output is correct |
38 |
Correct |
14 ms |
1792 KB |
Output is correct |
39 |
Correct |
13 ms |
1792 KB |
Output is correct |
40 |
Correct |
14 ms |
1920 KB |
Output is correct |
41 |
Correct |
12 ms |
1536 KB |
Output is correct |
42 |
Correct |
11 ms |
1536 KB |
Output is correct |
43 |
Correct |
7 ms |
1152 KB |
Output is correct |
44 |
Correct |
13 ms |
1792 KB |
Output is correct |
45 |
Correct |
13 ms |
1792 KB |
Output is correct |
46 |
Correct |
13 ms |
1920 KB |
Output is correct |
47 |
Correct |
12 ms |
1408 KB |
Output is correct |
48 |
Correct |
11 ms |
1408 KB |
Output is correct |
49 |
Correct |
10 ms |
1408 KB |
Output is correct |
50 |
Correct |
11 ms |
1408 KB |
Output is correct |
51 |
Correct |
10 ms |
1280 KB |
Output is correct |
52 |
Correct |
12 ms |
1536 KB |
Output is correct |
53 |
Correct |
11 ms |
1408 KB |
Output is correct |
54 |
Correct |
11 ms |
1408 KB |
Output is correct |
55 |
Correct |
12 ms |
1408 KB |
Output is correct |
56 |
Correct |
81 ms |
8808 KB |
Output is correct |
57 |
Correct |
82 ms |
9388 KB |
Output is correct |
58 |
Correct |
81 ms |
8400 KB |
Output is correct |
59 |
Correct |
75 ms |
8052 KB |
Output is correct |
60 |
Correct |
72 ms |
8108 KB |
Output is correct |
61 |
Correct |
72 ms |
7960 KB |
Output is correct |
62 |
Correct |
75 ms |
8168 KB |
Output is correct |
63 |
Correct |
74 ms |
8044 KB |
Output is correct |
64 |
Correct |
80 ms |
8232 KB |
Output is correct |
65 |
Correct |
71 ms |
8180 KB |
Output is correct |
66 |
Correct |
77 ms |
8192 KB |
Output is correct |
67 |
Correct |
74 ms |
8116 KB |
Output is correct |
68 |
Correct |
72 ms |
8112 KB |
Output is correct |
69 |
Correct |
74 ms |
8344 KB |
Output is correct |
70 |
Correct |
77 ms |
7988 KB |
Output is correct |
71 |
Correct |
73 ms |
8056 KB |
Output is correct |
72 |
Correct |
86 ms |
7892 KB |
Output is correct |
73 |
Correct |
74 ms |
8200 KB |
Output is correct |
74 |
Correct |
60 ms |
5612 KB |
Output is correct |
75 |
Correct |
74 ms |
8148 KB |
Output is correct |
76 |
Correct |
76 ms |
8688 KB |
Output is correct |
77 |
Correct |
74 ms |
8176 KB |
Output is correct |
78 |
Correct |
76 ms |
8140 KB |
Output is correct |
79 |
Correct |
60 ms |
5336 KB |
Output is correct |
80 |
Correct |
77 ms |
8428 KB |
Output is correct |
81 |
Correct |
78 ms |
8428 KB |
Output is correct |
82 |
Correct |
73 ms |
8004 KB |
Output is correct |
83 |
Correct |
74 ms |
8048 KB |
Output is correct |
84 |
Correct |
59 ms |
5488 KB |
Output is correct |
85 |
Correct |
77 ms |
8180 KB |
Output is correct |
86 |
Correct |
76 ms |
8296 KB |
Output is correct |
87 |
Correct |
75 ms |
8320 KB |
Output is correct |
88 |
Correct |
73 ms |
7956 KB |
Output is correct |
89 |
Correct |
72 ms |
7988 KB |
Output is correct |
90 |
Correct |
73 ms |
7888 KB |
Output is correct |
91 |
Correct |
73 ms |
7788 KB |
Output is correct |
92 |
Correct |
72 ms |
7660 KB |
Output is correct |
93 |
Correct |
74 ms |
8052 KB |
Output is correct |
94 |
Correct |
73 ms |
7908 KB |
Output is correct |
95 |
Correct |
75 ms |
8028 KB |
Output is correct |
96 |
Correct |
75 ms |
8176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
280 ms |
35336 KB |
Output is correct |
2 |
Correct |
125 ms |
18644 KB |
Output is correct |
3 |
Correct |
251 ms |
30380 KB |
Output is correct |
4 |
Correct |
276 ms |
30376 KB |
Output is correct |
5 |
Correct |
215 ms |
24212 KB |
Output is correct |
6 |
Correct |
237 ms |
23596 KB |
Output is correct |
7 |
Correct |
256 ms |
23748 KB |
Output is correct |
8 |
Correct |
276 ms |
29952 KB |
Output is correct |
9 |
Correct |
281 ms |
32944 KB |
Output is correct |
10 |
Correct |
279 ms |
23776 KB |
Output is correct |
11 |
Correct |
309 ms |
30844 KB |
Output is correct |
12 |
Correct |
306 ms |
32464 KB |
Output is correct |
13 |
Correct |
285 ms |
33360 KB |
Output is correct |
14 |
Correct |
297 ms |
32548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
272 ms |
21624 KB |
Output is correct |
2 |
Correct |
272 ms |
21260 KB |
Output is correct |
3 |
Correct |
298 ms |
21420 KB |
Output is correct |
4 |
Correct |
337 ms |
25988 KB |
Output is correct |
5 |
Correct |
333 ms |
26152 KB |
Output is correct |
6 |
Correct |
323 ms |
26184 KB |
Output is correct |
7 |
Correct |
290 ms |
23724 KB |
Output is correct |
8 |
Correct |
300 ms |
23804 KB |
Output is correct |
9 |
Correct |
289 ms |
24108 KB |
Output is correct |
10 |
Correct |
290 ms |
23364 KB |
Output is correct |
11 |
Correct |
240 ms |
23720 KB |
Output is correct |
12 |
Correct |
242 ms |
23724 KB |
Output is correct |
13 |
Correct |
143 ms |
19052 KB |
Output is correct |
14 |
Correct |
302 ms |
25372 KB |
Output is correct |
15 |
Correct |
282 ms |
36776 KB |
Output is correct |
16 |
Correct |
235 ms |
24192 KB |
Output is correct |
17 |
Correct |
241 ms |
24208 KB |
Output is correct |
18 |
Correct |
213 ms |
23752 KB |
Output is correct |
19 |
Correct |
238 ms |
24468 KB |
Output is correct |
20 |
Correct |
368 ms |
29228 KB |
Output is correct |
21 |
Correct |
282 ms |
30756 KB |
Output is correct |
22 |
Correct |
227 ms |
23728 KB |
Output is correct |
23 |
Correct |
326 ms |
28972 KB |
Output is correct |
24 |
Correct |
116 ms |
16752 KB |
Output is correct |
25 |
Correct |
331 ms |
30224 KB |
Output is correct |
26 |
Correct |
286 ms |
30116 KB |
Output is correct |
27 |
Correct |
256 ms |
30572 KB |
Output is correct |
28 |
Correct |
301 ms |
30176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
10 ms |
1280 KB |
Output is correct |
5 |
Correct |
10 ms |
1280 KB |
Output is correct |
6 |
Correct |
13 ms |
1280 KB |
Output is correct |
7 |
Correct |
13 ms |
1408 KB |
Output is correct |
8 |
Correct |
11 ms |
1408 KB |
Output is correct |
9 |
Correct |
12 ms |
1408 KB |
Output is correct |
10 |
Correct |
13 ms |
1536 KB |
Output is correct |
11 |
Correct |
13 ms |
1656 KB |
Output is correct |
12 |
Correct |
13 ms |
1664 KB |
Output is correct |
13 |
Correct |
12 ms |
1536 KB |
Output is correct |
14 |
Correct |
12 ms |
1408 KB |
Output is correct |
15 |
Correct |
11 ms |
1536 KB |
Output is correct |
16 |
Correct |
11 ms |
1408 KB |
Output is correct |
17 |
Correct |
11 ms |
1408 KB |
Output is correct |
18 |
Correct |
13 ms |
1664 KB |
Output is correct |
19 |
Correct |
12 ms |
1536 KB |
Output is correct |
20 |
Correct |
12 ms |
1536 KB |
Output is correct |
21 |
Correct |
12 ms |
1536 KB |
Output is correct |
22 |
Correct |
11 ms |
1408 KB |
Output is correct |
23 |
Correct |
11 ms |
1536 KB |
Output is correct |
24 |
Correct |
11 ms |
1536 KB |
Output is correct |
25 |
Correct |
8 ms |
1208 KB |
Output is correct |
26 |
Correct |
13 ms |
1664 KB |
Output is correct |
27 |
Correct |
13 ms |
2176 KB |
Output is correct |
28 |
Correct |
11 ms |
1536 KB |
Output is correct |
29 |
Correct |
12 ms |
1536 KB |
Output is correct |
30 |
Correct |
11 ms |
1536 KB |
Output is correct |
31 |
Correct |
12 ms |
1564 KB |
Output is correct |
32 |
Correct |
14 ms |
1792 KB |
Output is correct |
33 |
Correct |
14 ms |
1792 KB |
Output is correct |
34 |
Correct |
12 ms |
1536 KB |
Output is correct |
35 |
Correct |
14 ms |
1792 KB |
Output is correct |
36 |
Correct |
7 ms |
1152 KB |
Output is correct |
37 |
Correct |
13 ms |
1792 KB |
Output is correct |
38 |
Correct |
14 ms |
1792 KB |
Output is correct |
39 |
Correct |
13 ms |
1792 KB |
Output is correct |
40 |
Correct |
14 ms |
1920 KB |
Output is correct |
41 |
Correct |
12 ms |
1536 KB |
Output is correct |
42 |
Correct |
11 ms |
1536 KB |
Output is correct |
43 |
Correct |
7 ms |
1152 KB |
Output is correct |
44 |
Correct |
13 ms |
1792 KB |
Output is correct |
45 |
Correct |
13 ms |
1792 KB |
Output is correct |
46 |
Correct |
13 ms |
1920 KB |
Output is correct |
47 |
Correct |
12 ms |
1408 KB |
Output is correct |
48 |
Correct |
11 ms |
1408 KB |
Output is correct |
49 |
Correct |
10 ms |
1408 KB |
Output is correct |
50 |
Correct |
11 ms |
1408 KB |
Output is correct |
51 |
Correct |
10 ms |
1280 KB |
Output is correct |
52 |
Correct |
12 ms |
1536 KB |
Output is correct |
53 |
Correct |
11 ms |
1408 KB |
Output is correct |
54 |
Correct |
11 ms |
1408 KB |
Output is correct |
55 |
Correct |
12 ms |
1408 KB |
Output is correct |
56 |
Correct |
81 ms |
8808 KB |
Output is correct |
57 |
Correct |
82 ms |
9388 KB |
Output is correct |
58 |
Correct |
81 ms |
8400 KB |
Output is correct |
59 |
Correct |
75 ms |
8052 KB |
Output is correct |
60 |
Correct |
72 ms |
8108 KB |
Output is correct |
61 |
Correct |
72 ms |
7960 KB |
Output is correct |
62 |
Correct |
75 ms |
8168 KB |
Output is correct |
63 |
Correct |
74 ms |
8044 KB |
Output is correct |
64 |
Correct |
80 ms |
8232 KB |
Output is correct |
65 |
Correct |
71 ms |
8180 KB |
Output is correct |
66 |
Correct |
77 ms |
8192 KB |
Output is correct |
67 |
Correct |
74 ms |
8116 KB |
Output is correct |
68 |
Correct |
72 ms |
8112 KB |
Output is correct |
69 |
Correct |
74 ms |
8344 KB |
Output is correct |
70 |
Correct |
77 ms |
7988 KB |
Output is correct |
71 |
Correct |
73 ms |
8056 KB |
Output is correct |
72 |
Correct |
86 ms |
7892 KB |
Output is correct |
73 |
Correct |
74 ms |
8200 KB |
Output is correct |
74 |
Correct |
60 ms |
5612 KB |
Output is correct |
75 |
Correct |
74 ms |
8148 KB |
Output is correct |
76 |
Correct |
76 ms |
8688 KB |
Output is correct |
77 |
Correct |
74 ms |
8176 KB |
Output is correct |
78 |
Correct |
76 ms |
8140 KB |
Output is correct |
79 |
Correct |
60 ms |
5336 KB |
Output is correct |
80 |
Correct |
77 ms |
8428 KB |
Output is correct |
81 |
Correct |
78 ms |
8428 KB |
Output is correct |
82 |
Correct |
73 ms |
8004 KB |
Output is correct |
83 |
Correct |
74 ms |
8048 KB |
Output is correct |
84 |
Correct |
59 ms |
5488 KB |
Output is correct |
85 |
Correct |
77 ms |
8180 KB |
Output is correct |
86 |
Correct |
76 ms |
8296 KB |
Output is correct |
87 |
Correct |
75 ms |
8320 KB |
Output is correct |
88 |
Correct |
73 ms |
7956 KB |
Output is correct |
89 |
Correct |
72 ms |
7988 KB |
Output is correct |
90 |
Correct |
73 ms |
7888 KB |
Output is correct |
91 |
Correct |
73 ms |
7788 KB |
Output is correct |
92 |
Correct |
72 ms |
7660 KB |
Output is correct |
93 |
Correct |
74 ms |
8052 KB |
Output is correct |
94 |
Correct |
73 ms |
7908 KB |
Output is correct |
95 |
Correct |
75 ms |
8028 KB |
Output is correct |
96 |
Correct |
75 ms |
8176 KB |
Output is correct |
97 |
Correct |
280 ms |
35336 KB |
Output is correct |
98 |
Correct |
125 ms |
18644 KB |
Output is correct |
99 |
Correct |
251 ms |
30380 KB |
Output is correct |
100 |
Correct |
276 ms |
30376 KB |
Output is correct |
101 |
Correct |
215 ms |
24212 KB |
Output is correct |
102 |
Correct |
237 ms |
23596 KB |
Output is correct |
103 |
Correct |
256 ms |
23748 KB |
Output is correct |
104 |
Correct |
276 ms |
29952 KB |
Output is correct |
105 |
Correct |
281 ms |
32944 KB |
Output is correct |
106 |
Correct |
279 ms |
23776 KB |
Output is correct |
107 |
Correct |
309 ms |
30844 KB |
Output is correct |
108 |
Correct |
306 ms |
32464 KB |
Output is correct |
109 |
Correct |
285 ms |
33360 KB |
Output is correct |
110 |
Correct |
297 ms |
32548 KB |
Output is correct |
111 |
Correct |
272 ms |
21624 KB |
Output is correct |
112 |
Correct |
272 ms |
21260 KB |
Output is correct |
113 |
Correct |
298 ms |
21420 KB |
Output is correct |
114 |
Correct |
337 ms |
25988 KB |
Output is correct |
115 |
Correct |
333 ms |
26152 KB |
Output is correct |
116 |
Correct |
323 ms |
26184 KB |
Output is correct |
117 |
Correct |
290 ms |
23724 KB |
Output is correct |
118 |
Correct |
300 ms |
23804 KB |
Output is correct |
119 |
Correct |
289 ms |
24108 KB |
Output is correct |
120 |
Correct |
290 ms |
23364 KB |
Output is correct |
121 |
Correct |
240 ms |
23720 KB |
Output is correct |
122 |
Correct |
242 ms |
23724 KB |
Output is correct |
123 |
Correct |
143 ms |
19052 KB |
Output is correct |
124 |
Correct |
302 ms |
25372 KB |
Output is correct |
125 |
Correct |
282 ms |
36776 KB |
Output is correct |
126 |
Correct |
235 ms |
24192 KB |
Output is correct |
127 |
Correct |
241 ms |
24208 KB |
Output is correct |
128 |
Correct |
213 ms |
23752 KB |
Output is correct |
129 |
Correct |
238 ms |
24468 KB |
Output is correct |
130 |
Correct |
368 ms |
29228 KB |
Output is correct |
131 |
Correct |
282 ms |
30756 KB |
Output is correct |
132 |
Correct |
227 ms |
23728 KB |
Output is correct |
133 |
Correct |
326 ms |
28972 KB |
Output is correct |
134 |
Correct |
116 ms |
16752 KB |
Output is correct |
135 |
Correct |
331 ms |
30224 KB |
Output is correct |
136 |
Correct |
286 ms |
30116 KB |
Output is correct |
137 |
Correct |
256 ms |
30572 KB |
Output is correct |
138 |
Correct |
301 ms |
30176 KB |
Output is correct |
139 |
Correct |
157 ms |
15084 KB |
Output is correct |
140 |
Correct |
236 ms |
19152 KB |
Output is correct |
141 |
Correct |
223 ms |
17864 KB |
Output is correct |
142 |
Correct |
263 ms |
20264 KB |
Output is correct |
143 |
Correct |
266 ms |
20268 KB |
Output is correct |
144 |
Correct |
286 ms |
20228 KB |
Output is correct |
145 |
Correct |
304 ms |
24628 KB |
Output is correct |
146 |
Correct |
286 ms |
24008 KB |
Output is correct |
147 |
Correct |
317 ms |
23664 KB |
Output is correct |
148 |
Correct |
302 ms |
23476 KB |
Output is correct |
149 |
Correct |
233 ms |
22996 KB |
Output is correct |
150 |
Correct |
223 ms |
22176 KB |
Output is correct |
151 |
Correct |
118 ms |
16264 KB |
Output is correct |
152 |
Correct |
273 ms |
28040 KB |
Output is correct |
153 |
Correct |
259 ms |
27076 KB |
Output is correct |
154 |
Correct |
265 ms |
29448 KB |
Output is correct |
155 |
Correct |
450 ms |
21560 KB |
Output is correct |
156 |
Correct |
265 ms |
20968 KB |
Output is correct |
157 |
Correct |
261 ms |
20420 KB |
Output is correct |
158 |
Correct |
256 ms |
19112 KB |
Output is correct |
159 |
Correct |
266 ms |
19796 KB |
Output is correct |
160 |
Correct |
301 ms |
24464 KB |
Output is correct |
161 |
Correct |
228 ms |
21696 KB |
Output is correct |
162 |
Correct |
251 ms |
23084 KB |
Output is correct |
163 |
Correct |
258 ms |
23092 KB |
Output is correct |