#include "parks.h"
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=int(b); a<int(c); ++a)
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#pragma once
bool dfs(int a, int L, vector<vi>& g, vi& btoa, vi& A, vi& B) {
if (A[a] != L) return 0;
A[a] = -1;
for (int b : g[a]) if (B[b] == L + 1) {
B[b] = 0;
if (btoa[b] == -1 || dfs(btoa[b], L + 1, g, btoa, A, B))
return btoa[b] = a, 1;
}
return 0;
}
int hopcroftKarp(vector<vi>& g, vi& btoa) {
int res = 0;
vi A(g.size()), B(btoa.size()), cur, next;
for (;;) {
fill(all(A), 0);
fill(all(B), 0);
/// Find the starting nodes for BFS (i.e. layer 0).
cur.clear();
for (int a : btoa) if(a != -1) A[a] = -1;
rep(a,0,sz(g)) if(A[a] == 0) cur.push_back(a);
/// Find all layers using bfs.
for (int lay = 1;; lay++) {
bool islast = 0;
next.clear();
for (int a : cur) for (int b : g[a]) {
if (btoa[b] == -1) {
B[b] = lay;
islast = 1;
}
else if (btoa[b] != a && !B[b]) {
B[b] = lay;
next.push_back(btoa[b]);
}
}
if (islast) break;
if (next.empty()) return res;
for (int a : next) A[a] = lay;
cur.swap(next);
}
/// Use DFS to scan for augmenting paths.
rep(a,0,sz(g))
res += dfs(a, 0, g, btoa, A, B);
}
}
/*int faster_matching(vector<vi>& g, vi& btoa) {
vector<vi> g2(btoa.size());
rep(i,0,g.size()) {
rep(j,0,g[i].size()) {
g2[g[i][j]].push_back(i);
}
}
vector<int> deg_one;
rep(i,0,g.size()) {
if(g[i].size()==1) {
deg_one.push_back(i);
}
}
int current = 0;
while(true)
rep(i,0,deg_one.size()) {
current = i;
}
}*/
vector<int> parent;
vector<int> s;
int find(int x) {
if(x==parent[x]) return x;
else return parent[x]=find(parent[x]);
}
void makeset(int x) {
parent[x]=x;
}
bool sameset(int x, int y) {
return find(x)==find(y);
}
void join(int x, int y) {
int xroot = find(x);
int yroot = find(y);
if(s[xroot]>s[yroot]) {
parent[yroot]=xroot;
s[xroot] += s[yroot];
} else {
parent[xroot]=yroot;
s[yroot] += s[xroot];
}
}
int construct_roads(vector<int> x, vector<int> y) {
if (x.size() == 1) {
build({}, {}, {}, {});
return 1;
}
int n = x.size();
int M = 2*1e5+1;
vector<vector<pair<int,int>>> x_fountains(M);
vector<vector<pair<int,int>>> y_fountains(M);
// first is the coordinate
// second is the index.
rep(i,0,n) {
x_fountains[x[i]].emplace_back(y[i],i);
y_fountains[y[i]].emplace_back(x[i],i);
}
rep(i,0,M) {
sort(x_fountains[i].begin(), x_fountains[i].end());
sort(y_fountains[i].begin(), y_fountains[i].end());
}
vector<int> u, v, a, b;
parent.clear();
parent.resize(n);
s.resize(n);
rep(i,0,n) makeset(i);
rep(i,0,M) {
rep(j,1,x_fountains[i].size()) {
int ind1 = x_fountains[i][j-1].second;
int y1 = x_fountains[i][j-1].first;
int ind2 = x_fountains[i][j].second;
int y2 = x_fountains[i][j].first;
if(y2-y1!=2) continue;
if(sameset(ind1,ind2)) continue;
join(ind1,ind2);
u.push_back(ind1);
v.push_back(ind2);
}
}
rep(i,0,M) {
rep(j,1,y_fountains[i].size()) {
int ind1 = y_fountains[i][j-1].second;
int x1 = y_fountains[i][j-1].first;
int ind2 = y_fountains[i][j].second;
int x2 = y_fountains[i][j].first;
if(x2-x1!=2) continue;
if(sameset(ind1,ind2)) continue;
join(ind1,ind2);
u.push_back(ind1);
v.push_back(ind2);
}
}
int num_roads = u.size();
if(num_roads!=n-1) return 0;
map<pair<int,int>, int> potential_benches;
vector<pair<int,int>> potential_benches2;
vector<vector<int>> graph(num_roads);
rep(i,0,num_roads) {
int f1 = u[i];
int f2 = v[i];
vector<pair<int,int>> temp;
if(x[f1]==x[f2]) {
int mid = (y[f1]+y[f2])/2;
temp.emplace_back(x[f1]-1, mid);
temp.emplace_back(x[f1]+1, mid);
} else {
assert(y[f1]==y[f2]);
int mid = (x[f1]+x[f2])/2;
temp.emplace_back(mid, y[f1]-1);
temp.emplace_back(mid, y[f1]+1);
}
rep(j,0,temp.size()) {
if (!potential_benches.count(temp[j])) {
potential_benches[temp[j]]=potential_benches.size();
potential_benches2.emplace_back(temp[j]);
}
graph[i].push_back(potential_benches[temp[j]]);
}
}
vector<int> btoa(potential_benches.size(),-1);
assert(hopcroftKarp(graph, btoa)==num_roads);
a.resize(num_roads);
b.resize(num_roads);
rep(i,0,potential_benches2.size()) {
if(btoa[i] != -1) {
a[btoa[i]] = potential_benches2[i].first;
b[btoa[i]] = potential_benches2[i].second;
}
}
build(u, v, a, b);
return 1;
}
Compilation message
parks.cpp:11:9: warning: #pragma once in main file
11 | #pragma once
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
17 |
Correct |
9 ms |
9636 KB |
Output is correct |
18 |
Correct |
10 ms |
9656 KB |
Output is correct |
19 |
Correct |
9 ms |
9676 KB |
Output is correct |
20 |
Correct |
8 ms |
9696 KB |
Output is correct |
21 |
Correct |
10 ms |
9676 KB |
Output is correct |
22 |
Correct |
10 ms |
9664 KB |
Output is correct |
23 |
Correct |
506 ms |
62740 KB |
Output is correct |
24 |
Correct |
9 ms |
9696 KB |
Output is correct |
25 |
Correct |
12 ms |
9932 KB |
Output is correct |
26 |
Correct |
11 ms |
9828 KB |
Output is correct |
27 |
Correct |
11 ms |
9932 KB |
Output is correct |
28 |
Correct |
182 ms |
31112 KB |
Output is correct |
29 |
Correct |
291 ms |
41540 KB |
Output is correct |
30 |
Correct |
431 ms |
52192 KB |
Output is correct |
31 |
Correct |
532 ms |
62816 KB |
Output is correct |
32 |
Correct |
10 ms |
9676 KB |
Output is correct |
33 |
Correct |
10 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
9676 KB |
Output is correct |
35 |
Correct |
8 ms |
9676 KB |
Output is correct |
36 |
Correct |
9 ms |
9676 KB |
Output is correct |
37 |
Correct |
9 ms |
9676 KB |
Output is correct |
38 |
Correct |
9 ms |
9676 KB |
Output is correct |
39 |
Correct |
10 ms |
9676 KB |
Output is correct |
40 |
Correct |
9 ms |
9588 KB |
Output is correct |
41 |
Correct |
10 ms |
9676 KB |
Output is correct |
42 |
Correct |
10 ms |
9688 KB |
Output is correct |
43 |
Correct |
11 ms |
9824 KB |
Output is correct |
44 |
Correct |
10 ms |
9804 KB |
Output is correct |
45 |
Correct |
257 ms |
35620 KB |
Output is correct |
46 |
Correct |
358 ms |
47008 KB |
Output is correct |
47 |
Correct |
365 ms |
46904 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
17 |
Correct |
9 ms |
9636 KB |
Output is correct |
18 |
Correct |
10 ms |
9656 KB |
Output is correct |
19 |
Correct |
9 ms |
9676 KB |
Output is correct |
20 |
Correct |
8 ms |
9696 KB |
Output is correct |
21 |
Correct |
10 ms |
9676 KB |
Output is correct |
22 |
Correct |
10 ms |
9664 KB |
Output is correct |
23 |
Correct |
506 ms |
62740 KB |
Output is correct |
24 |
Correct |
9 ms |
9696 KB |
Output is correct |
25 |
Correct |
12 ms |
9932 KB |
Output is correct |
26 |
Correct |
11 ms |
9828 KB |
Output is correct |
27 |
Correct |
11 ms |
9932 KB |
Output is correct |
28 |
Correct |
182 ms |
31112 KB |
Output is correct |
29 |
Correct |
291 ms |
41540 KB |
Output is correct |
30 |
Correct |
431 ms |
52192 KB |
Output is correct |
31 |
Correct |
532 ms |
62816 KB |
Output is correct |
32 |
Correct |
10 ms |
9676 KB |
Output is correct |
33 |
Correct |
10 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
9676 KB |
Output is correct |
35 |
Correct |
8 ms |
9676 KB |
Output is correct |
36 |
Correct |
9 ms |
9676 KB |
Output is correct |
37 |
Correct |
9 ms |
9676 KB |
Output is correct |
38 |
Correct |
9 ms |
9676 KB |
Output is correct |
39 |
Correct |
10 ms |
9676 KB |
Output is correct |
40 |
Correct |
9 ms |
9588 KB |
Output is correct |
41 |
Correct |
10 ms |
9676 KB |
Output is correct |
42 |
Correct |
10 ms |
9688 KB |
Output is correct |
43 |
Correct |
11 ms |
9824 KB |
Output is correct |
44 |
Correct |
10 ms |
9804 KB |
Output is correct |
45 |
Correct |
257 ms |
35620 KB |
Output is correct |
46 |
Correct |
358 ms |
47008 KB |
Output is correct |
47 |
Correct |
365 ms |
46904 KB |
Output is correct |
48 |
Correct |
8 ms |
9676 KB |
Output is correct |
49 |
Correct |
9 ms |
9676 KB |
Output is correct |
50 |
Correct |
9 ms |
9596 KB |
Output is correct |
51 |
Correct |
9 ms |
9676 KB |
Output is correct |
52 |
Correct |
9 ms |
9612 KB |
Output is correct |
53 |
Correct |
9 ms |
9692 KB |
Output is correct |
54 |
Correct |
9 ms |
9676 KB |
Output is correct |
55 |
Correct |
473 ms |
60472 KB |
Output is correct |
56 |
Correct |
9 ms |
9584 KB |
Output is correct |
57 |
Correct |
12 ms |
10144 KB |
Output is correct |
58 |
Correct |
20 ms |
11212 KB |
Output is correct |
59 |
Correct |
17 ms |
10404 KB |
Output is correct |
60 |
Correct |
240 ms |
35100 KB |
Output is correct |
61 |
Correct |
307 ms |
43932 KB |
Output is correct |
62 |
Correct |
405 ms |
51556 KB |
Output is correct |
63 |
Correct |
574 ms |
60424 KB |
Output is correct |
64 |
Correct |
9 ms |
9676 KB |
Output is correct |
65 |
Correct |
9 ms |
9676 KB |
Output is correct |
66 |
Correct |
10 ms |
9676 KB |
Output is correct |
67 |
Correct |
580 ms |
69136 KB |
Output is correct |
68 |
Correct |
584 ms |
70212 KB |
Output is correct |
69 |
Correct |
637 ms |
69344 KB |
Output is correct |
70 |
Correct |
11 ms |
9932 KB |
Output is correct |
71 |
Correct |
13 ms |
10188 KB |
Output is correct |
72 |
Correct |
274 ms |
34728 KB |
Output is correct |
73 |
Correct |
404 ms |
47148 KB |
Output is correct |
74 |
Correct |
519 ms |
59680 KB |
Output is correct |
75 |
Correct |
510 ms |
64576 KB |
Output is correct |
76 |
Correct |
569 ms |
70196 KB |
Output is correct |
77 |
Correct |
13 ms |
9932 KB |
Output is correct |
78 |
Correct |
14 ms |
10312 KB |
Output is correct |
79 |
Correct |
234 ms |
35548 KB |
Output is correct |
80 |
Correct |
368 ms |
48360 KB |
Output is correct |
81 |
Correct |
544 ms |
61168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
17 |
Correct |
9 ms |
9676 KB |
Output is correct |
18 |
Correct |
10 ms |
9680 KB |
Output is correct |
19 |
Correct |
9 ms |
9700 KB |
Output is correct |
20 |
Correct |
508 ms |
55832 KB |
Output is correct |
21 |
Correct |
479 ms |
54672 KB |
Output is correct |
22 |
Correct |
466 ms |
54608 KB |
Output is correct |
23 |
Correct |
439 ms |
61252 KB |
Output is correct |
24 |
Correct |
86 ms |
18368 KB |
Output is correct |
25 |
Correct |
95 ms |
20156 KB |
Output is correct |
26 |
Correct |
91 ms |
20020 KB |
Output is correct |
27 |
Correct |
408 ms |
68116 KB |
Output is correct |
28 |
Correct |
411 ms |
68060 KB |
Output is correct |
29 |
Correct |
468 ms |
68020 KB |
Output is correct |
30 |
Correct |
464 ms |
68040 KB |
Output is correct |
31 |
Correct |
11 ms |
9676 KB |
Output is correct |
32 |
Correct |
38 ms |
13088 KB |
Output is correct |
33 |
Correct |
97 ms |
18244 KB |
Output is correct |
34 |
Correct |
497 ms |
55900 KB |
Output is correct |
35 |
Correct |
14 ms |
10316 KB |
Output is correct |
36 |
Correct |
34 ms |
12788 KB |
Output is correct |
37 |
Correct |
59 ms |
15716 KB |
Output is correct |
38 |
Correct |
239 ms |
28324 KB |
Output is correct |
39 |
Correct |
275 ms |
35928 KB |
Output is correct |
40 |
Correct |
367 ms |
43028 KB |
Output is correct |
41 |
Correct |
449 ms |
49996 KB |
Output is correct |
42 |
Correct |
596 ms |
56864 KB |
Output is correct |
43 |
Correct |
10 ms |
9676 KB |
Output is correct |
44 |
Correct |
9 ms |
9676 KB |
Output is correct |
45 |
Correct |
10 ms |
9632 KB |
Output is correct |
46 |
Correct |
10 ms |
9700 KB |
Output is correct |
47 |
Correct |
11 ms |
9676 KB |
Output is correct |
48 |
Correct |
9 ms |
9592 KB |
Output is correct |
49 |
Correct |
9 ms |
9676 KB |
Output is correct |
50 |
Correct |
8 ms |
9676 KB |
Output is correct |
51 |
Correct |
10 ms |
9696 KB |
Output is correct |
52 |
Correct |
10 ms |
9620 KB |
Output is correct |
53 |
Correct |
10 ms |
9700 KB |
Output is correct |
54 |
Correct |
11 ms |
9804 KB |
Output is correct |
55 |
Correct |
11 ms |
9896 KB |
Output is correct |
56 |
Correct |
285 ms |
35624 KB |
Output is correct |
57 |
Correct |
347 ms |
46928 KB |
Output is correct |
58 |
Correct |
381 ms |
46956 KB |
Output is correct |
59 |
Correct |
9 ms |
9676 KB |
Output is correct |
60 |
Correct |
12 ms |
9676 KB |
Output is correct |
61 |
Correct |
8 ms |
9692 KB |
Output is correct |
62 |
Correct |
566 ms |
69412 KB |
Output is correct |
63 |
Correct |
575 ms |
70212 KB |
Output is correct |
64 |
Correct |
563 ms |
69356 KB |
Output is correct |
65 |
Correct |
11 ms |
9952 KB |
Output is correct |
66 |
Correct |
13 ms |
10176 KB |
Output is correct |
67 |
Correct |
278 ms |
34812 KB |
Output is correct |
68 |
Correct |
380 ms |
47192 KB |
Output is correct |
69 |
Correct |
515 ms |
59780 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
17 |
Correct |
534 ms |
69704 KB |
Output is correct |
18 |
Correct |
518 ms |
69728 KB |
Output is correct |
19 |
Correct |
466 ms |
59436 KB |
Output is correct |
20 |
Correct |
400 ms |
56820 KB |
Output is correct |
21 |
Correct |
427 ms |
59368 KB |
Output is correct |
22 |
Correct |
10 ms |
9676 KB |
Output is correct |
23 |
Correct |
88 ms |
17196 KB |
Output is correct |
24 |
Correct |
20 ms |
10956 KB |
Output is correct |
25 |
Correct |
44 ms |
14276 KB |
Output is correct |
26 |
Correct |
66 ms |
16764 KB |
Output is correct |
27 |
Correct |
262 ms |
34368 KB |
Output is correct |
28 |
Correct |
314 ms |
40580 KB |
Output is correct |
29 |
Correct |
380 ms |
46420 KB |
Output is correct |
30 |
Correct |
457 ms |
52648 KB |
Output is correct |
31 |
Correct |
531 ms |
58416 KB |
Output is correct |
32 |
Correct |
557 ms |
64648 KB |
Output is correct |
33 |
Correct |
579 ms |
70280 KB |
Output is correct |
34 |
Correct |
12 ms |
9932 KB |
Output is correct |
35 |
Correct |
14 ms |
10236 KB |
Output is correct |
36 |
Correct |
239 ms |
35604 KB |
Output is correct |
37 |
Correct |
370 ms |
48272 KB |
Output is correct |
38 |
Correct |
515 ms |
61244 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
9 ms |
9676 KB |
Output is correct |
3 |
Correct |
9 ms |
9676 KB |
Output is correct |
4 |
Correct |
10 ms |
9676 KB |
Output is correct |
5 |
Correct |
10 ms |
9676 KB |
Output is correct |
6 |
Correct |
11 ms |
9676 KB |
Output is correct |
7 |
Correct |
9 ms |
9616 KB |
Output is correct |
8 |
Correct |
9 ms |
9676 KB |
Output is correct |
9 |
Correct |
264 ms |
41036 KB |
Output is correct |
10 |
Correct |
31 ms |
12744 KB |
Output is correct |
11 |
Correct |
131 ms |
26560 KB |
Output is correct |
12 |
Correct |
39 ms |
14264 KB |
Output is correct |
13 |
Correct |
24 ms |
13168 KB |
Output is correct |
14 |
Correct |
10 ms |
9660 KB |
Output is correct |
15 |
Correct |
9 ms |
9804 KB |
Output is correct |
16 |
Correct |
269 ms |
41104 KB |
Output is correct |
17 |
Correct |
9 ms |
9636 KB |
Output is correct |
18 |
Correct |
10 ms |
9656 KB |
Output is correct |
19 |
Correct |
9 ms |
9676 KB |
Output is correct |
20 |
Correct |
8 ms |
9696 KB |
Output is correct |
21 |
Correct |
10 ms |
9676 KB |
Output is correct |
22 |
Correct |
10 ms |
9664 KB |
Output is correct |
23 |
Correct |
506 ms |
62740 KB |
Output is correct |
24 |
Correct |
9 ms |
9696 KB |
Output is correct |
25 |
Correct |
12 ms |
9932 KB |
Output is correct |
26 |
Correct |
11 ms |
9828 KB |
Output is correct |
27 |
Correct |
11 ms |
9932 KB |
Output is correct |
28 |
Correct |
182 ms |
31112 KB |
Output is correct |
29 |
Correct |
291 ms |
41540 KB |
Output is correct |
30 |
Correct |
431 ms |
52192 KB |
Output is correct |
31 |
Correct |
532 ms |
62816 KB |
Output is correct |
32 |
Correct |
10 ms |
9676 KB |
Output is correct |
33 |
Correct |
10 ms |
9676 KB |
Output is correct |
34 |
Correct |
12 ms |
9676 KB |
Output is correct |
35 |
Correct |
8 ms |
9676 KB |
Output is correct |
36 |
Correct |
9 ms |
9676 KB |
Output is correct |
37 |
Correct |
9 ms |
9676 KB |
Output is correct |
38 |
Correct |
9 ms |
9676 KB |
Output is correct |
39 |
Correct |
10 ms |
9676 KB |
Output is correct |
40 |
Correct |
9 ms |
9588 KB |
Output is correct |
41 |
Correct |
10 ms |
9676 KB |
Output is correct |
42 |
Correct |
10 ms |
9688 KB |
Output is correct |
43 |
Correct |
11 ms |
9824 KB |
Output is correct |
44 |
Correct |
10 ms |
9804 KB |
Output is correct |
45 |
Correct |
257 ms |
35620 KB |
Output is correct |
46 |
Correct |
358 ms |
47008 KB |
Output is correct |
47 |
Correct |
365 ms |
46904 KB |
Output is correct |
48 |
Correct |
8 ms |
9676 KB |
Output is correct |
49 |
Correct |
9 ms |
9676 KB |
Output is correct |
50 |
Correct |
9 ms |
9596 KB |
Output is correct |
51 |
Correct |
9 ms |
9676 KB |
Output is correct |
52 |
Correct |
9 ms |
9612 KB |
Output is correct |
53 |
Correct |
9 ms |
9692 KB |
Output is correct |
54 |
Correct |
9 ms |
9676 KB |
Output is correct |
55 |
Correct |
473 ms |
60472 KB |
Output is correct |
56 |
Correct |
9 ms |
9584 KB |
Output is correct |
57 |
Correct |
12 ms |
10144 KB |
Output is correct |
58 |
Correct |
20 ms |
11212 KB |
Output is correct |
59 |
Correct |
17 ms |
10404 KB |
Output is correct |
60 |
Correct |
240 ms |
35100 KB |
Output is correct |
61 |
Correct |
307 ms |
43932 KB |
Output is correct |
62 |
Correct |
405 ms |
51556 KB |
Output is correct |
63 |
Correct |
574 ms |
60424 KB |
Output is correct |
64 |
Correct |
9 ms |
9676 KB |
Output is correct |
65 |
Correct |
9 ms |
9676 KB |
Output is correct |
66 |
Correct |
10 ms |
9676 KB |
Output is correct |
67 |
Correct |
580 ms |
69136 KB |
Output is correct |
68 |
Correct |
584 ms |
70212 KB |
Output is correct |
69 |
Correct |
637 ms |
69344 KB |
Output is correct |
70 |
Correct |
11 ms |
9932 KB |
Output is correct |
71 |
Correct |
13 ms |
10188 KB |
Output is correct |
72 |
Correct |
274 ms |
34728 KB |
Output is correct |
73 |
Correct |
404 ms |
47148 KB |
Output is correct |
74 |
Correct |
519 ms |
59680 KB |
Output is correct |
75 |
Correct |
510 ms |
64576 KB |
Output is correct |
76 |
Correct |
569 ms |
70196 KB |
Output is correct |
77 |
Correct |
13 ms |
9932 KB |
Output is correct |
78 |
Correct |
14 ms |
10312 KB |
Output is correct |
79 |
Correct |
234 ms |
35548 KB |
Output is correct |
80 |
Correct |
368 ms |
48360 KB |
Output is correct |
81 |
Correct |
544 ms |
61168 KB |
Output is correct |
82 |
Correct |
9 ms |
9676 KB |
Output is correct |
83 |
Correct |
10 ms |
9680 KB |
Output is correct |
84 |
Correct |
9 ms |
9700 KB |
Output is correct |
85 |
Correct |
508 ms |
55832 KB |
Output is correct |
86 |
Correct |
479 ms |
54672 KB |
Output is correct |
87 |
Correct |
466 ms |
54608 KB |
Output is correct |
88 |
Correct |
439 ms |
61252 KB |
Output is correct |
89 |
Correct |
86 ms |
18368 KB |
Output is correct |
90 |
Correct |
95 ms |
20156 KB |
Output is correct |
91 |
Correct |
91 ms |
20020 KB |
Output is correct |
92 |
Correct |
408 ms |
68116 KB |
Output is correct |
93 |
Correct |
411 ms |
68060 KB |
Output is correct |
94 |
Correct |
468 ms |
68020 KB |
Output is correct |
95 |
Correct |
464 ms |
68040 KB |
Output is correct |
96 |
Correct |
11 ms |
9676 KB |
Output is correct |
97 |
Correct |
38 ms |
13088 KB |
Output is correct |
98 |
Correct |
97 ms |
18244 KB |
Output is correct |
99 |
Correct |
497 ms |
55900 KB |
Output is correct |
100 |
Correct |
14 ms |
10316 KB |
Output is correct |
101 |
Correct |
34 ms |
12788 KB |
Output is correct |
102 |
Correct |
59 ms |
15716 KB |
Output is correct |
103 |
Correct |
239 ms |
28324 KB |
Output is correct |
104 |
Correct |
275 ms |
35928 KB |
Output is correct |
105 |
Correct |
367 ms |
43028 KB |
Output is correct |
106 |
Correct |
449 ms |
49996 KB |
Output is correct |
107 |
Correct |
596 ms |
56864 KB |
Output is correct |
108 |
Correct |
10 ms |
9676 KB |
Output is correct |
109 |
Correct |
9 ms |
9676 KB |
Output is correct |
110 |
Correct |
10 ms |
9632 KB |
Output is correct |
111 |
Correct |
10 ms |
9700 KB |
Output is correct |
112 |
Correct |
11 ms |
9676 KB |
Output is correct |
113 |
Correct |
9 ms |
9592 KB |
Output is correct |
114 |
Correct |
9 ms |
9676 KB |
Output is correct |
115 |
Correct |
8 ms |
9676 KB |
Output is correct |
116 |
Correct |
10 ms |
9696 KB |
Output is correct |
117 |
Correct |
10 ms |
9620 KB |
Output is correct |
118 |
Correct |
10 ms |
9700 KB |
Output is correct |
119 |
Correct |
11 ms |
9804 KB |
Output is correct |
120 |
Correct |
11 ms |
9896 KB |
Output is correct |
121 |
Correct |
285 ms |
35624 KB |
Output is correct |
122 |
Correct |
347 ms |
46928 KB |
Output is correct |
123 |
Correct |
381 ms |
46956 KB |
Output is correct |
124 |
Correct |
9 ms |
9676 KB |
Output is correct |
125 |
Correct |
12 ms |
9676 KB |
Output is correct |
126 |
Correct |
8 ms |
9692 KB |
Output is correct |
127 |
Correct |
566 ms |
69412 KB |
Output is correct |
128 |
Correct |
575 ms |
70212 KB |
Output is correct |
129 |
Correct |
563 ms |
69356 KB |
Output is correct |
130 |
Correct |
11 ms |
9952 KB |
Output is correct |
131 |
Correct |
13 ms |
10176 KB |
Output is correct |
132 |
Correct |
278 ms |
34812 KB |
Output is correct |
133 |
Correct |
380 ms |
47192 KB |
Output is correct |
134 |
Correct |
515 ms |
59780 KB |
Output is correct |
135 |
Correct |
534 ms |
69704 KB |
Output is correct |
136 |
Correct |
518 ms |
69728 KB |
Output is correct |
137 |
Correct |
466 ms |
59436 KB |
Output is correct |
138 |
Correct |
400 ms |
56820 KB |
Output is correct |
139 |
Correct |
427 ms |
59368 KB |
Output is correct |
140 |
Correct |
10 ms |
9676 KB |
Output is correct |
141 |
Correct |
88 ms |
17196 KB |
Output is correct |
142 |
Correct |
20 ms |
10956 KB |
Output is correct |
143 |
Correct |
44 ms |
14276 KB |
Output is correct |
144 |
Correct |
66 ms |
16764 KB |
Output is correct |
145 |
Correct |
262 ms |
34368 KB |
Output is correct |
146 |
Correct |
314 ms |
40580 KB |
Output is correct |
147 |
Correct |
380 ms |
46420 KB |
Output is correct |
148 |
Correct |
457 ms |
52648 KB |
Output is correct |
149 |
Correct |
531 ms |
58416 KB |
Output is correct |
150 |
Correct |
557 ms |
64648 KB |
Output is correct |
151 |
Correct |
579 ms |
70280 KB |
Output is correct |
152 |
Correct |
12 ms |
9932 KB |
Output is correct |
153 |
Correct |
14 ms |
10236 KB |
Output is correct |
154 |
Correct |
239 ms |
35604 KB |
Output is correct |
155 |
Correct |
370 ms |
48272 KB |
Output is correct |
156 |
Correct |
515 ms |
61244 KB |
Output is correct |
157 |
Correct |
9 ms |
9676 KB |
Output is correct |
158 |
Correct |
9 ms |
9676 KB |
Output is correct |
159 |
Correct |
10 ms |
9676 KB |
Output is correct |
160 |
Correct |
10 ms |
9676 KB |
Output is correct |
161 |
Correct |
420 ms |
53232 KB |
Output is correct |
162 |
Correct |
526 ms |
55820 KB |
Output is correct |
163 |
Correct |
550 ms |
56284 KB |
Output is correct |
164 |
Correct |
501 ms |
56344 KB |
Output is correct |
165 |
Correct |
437 ms |
56096 KB |
Output is correct |
166 |
Correct |
397 ms |
56016 KB |
Output is correct |
167 |
Runtime error |
130 ms |
37580 KB |
Execution killed with signal 6 |
168 |
Halted |
0 ms |
0 KB |
- |