#include <bits/stdc++.h>
#include "parks.h"
using namespace std;
typedef long long ll;
struct Point{
int x, y, idx;
Point(){}
Point(int x, int y, int idx): x(x), y(y), idx(idx){}
bool operator<(const Point &r)const{
if(x==r.x) return x<r.x;
return y<r.y;
}
};
struct Edge{
int u, v, idx;
Edge(){}
Edge(int u, int v, int idx): u(u), v(v), idx(idx){}
bool operator==(const Edge &r)const{
return idx==r.idx;
}
};
struct dat{
int x, y;
vector<Edge> vec;
dat(){}
dat(int x, int y, vector<Edge> vec): x(x), y(y), vec(vec){}
bool operator<(const dat &r)const{
if(vec.size() != r.vec.size()) return vec.size() < r.vec.size();
return make_pair(x, y) < make_pair(r.x, r.y);
}
};
int xx[]={1, -1, 0, 0}, yy[]={0, 0, 1, -1};
int n;
Point arr[200002];
map<pair<int, int>, int> idx;
int par[200002];
int edgeU[400002], edgeV[400002], edgeCnt;
int edgeA[400002], edgeB[400002];
int find(int x){
if(x==par[x]) return x;
return par[x] = find(par[x]);
}
void merge(int x, int y){
x = find(x), y = find(y);
par[y] = x;
}
set<pair<int, int> > criticalPoints;
map<pair<int, int>, vector<pair<int, int> > > link;
int findPoint(int x, int y){
if(idx.find(make_pair(x, y)) == idx.end()) return -1;
return idx[make_pair(x, y)];
}
bool findCritical(int x, int y){
return criticalPoints.find(make_pair(x, y)) != criticalPoints.end();
}
set<pair<pair<int, int>, pair<int, int> > > avoid;
int mid(int x, int y){
return (x+y)/2;
}
map<pair<int, int>, bool> visited;
void dfs(pair<int, int> p){
int x = p.first, y = p.second;
visited[p] = 1;
for(auto nxt: link[p]){
if(visited[nxt]) continue;
if(x){
if(x == nxt.first) avoid.insert(make_pair(make_pair(x-1, mid(y, nxt.second)), make_pair(x+1, mid(y, nxt.second))));
else avoid.insert(make_pair(make_pair(mid(x, nxt.first), y-1), make_pair(mid(x, nxt.first), y+1)));
}
dfs(nxt);
}
}
bool firstTime;
int construct_roads(vector<int> x, vector<int> y) {
n = (int)x.size();
for(int i=0; i<n; i++){
arr[i] = Point(x[i], y[i], i);
par[i] = i;
idx[make_pair(x[i], y[i])] = i;
}
for(int i=0; i<n; i++){
if(findPoint(arr[i].x+2, arr[i].y) != -1){
edgeU[edgeCnt] = i, edgeV[edgeCnt] = idx[make_pair(arr[i].x+2, arr[i].y)];
edgeA[edgeCnt] = arr[i].x+1;
edgeB[edgeCnt] = (arr[i].x+arr[i].y) % 4 == 0 ? arr[i].y-1 : arr[i].y+1;
edgeCnt++;
}
if(findPoint(arr[i].x, arr[i].y+2) != -1){
edgeU[edgeCnt] = i, edgeV[edgeCnt] = idx[make_pair(arr[i].x, arr[i].y+2)];
edgeA[edgeCnt] = (arr[i].x+arr[i].y) % 4 == 0 ? arr[i].x+1 : arr[i].x-1;
edgeB[edgeCnt] = arr[i].y+1;
edgeCnt++;
}
}
for(int i=0; i<edgeCnt; i++) merge(edgeU[i], edgeV[i]);
for(int i=0; i<n; i++) if(find(0) != find(i)) return 0;
for(int i=0; i<n; i++){
if(findPoint(arr[i].x, arr[i].y+2) == -1 || findPoint(arr[i].x+2, arr[i].y) == -1 || findPoint(arr[i].x+2, arr[i].y+2) == -1) continue;
criticalPoints.insert(make_pair(arr[i].x+1, arr[i].y+1));
}
pair<int, int> origin (0, 0);
for(auto p: criticalPoints){
if((p.first+p.second)%4 == 2){
if(findCritical(p.first, p.second + 2)) link[p].push_back(make_pair(p.first, p.second+2));
if(findCritical(p.first, p.second - 2)) link[p].push_back(make_pair(p.first, p.second-2));
if(!findCritical(p.first-2, p.second)){
link[origin].push_back(make_pair(p.first-2, p.second));
link[make_pair(p.first-2, p.second)].push_back(p);
}
if(!findCritical(p.first+2, p.second)){
link[origin].push_back(make_pair(p.first+2, p.second));
link[make_pair(p.first+2, p.second)].push_back(p);
}
}
else{
if(findCritical(p.first + 2, p.second)) link[p].push_back(make_pair(p.first+2, p.second));
if(findCritical(p.first - 2, p.second)) link[p].push_back(make_pair(p.first-2, p.second));
if(!findCritical(p.first, p.second-2)){
link[origin].push_back(make_pair(p.first, p.second-2));
link[make_pair(p.first, p.second-2)].push_back(p);
}
if(!findCritical(p.first, p.second+2)){
link[origin].push_back(make_pair(p.first, p.second+2));
link[make_pair(p.first, p.second+2)].push_back(p);
}
}
}
dfs(origin);
int pnt = 0;
for(int i=0; i<edgeCnt; i++){
auto minPoint = make_pair(min(arr[edgeU[i]].x, arr[edgeV[i]].x), min(arr[edgeU[i]].y, arr[edgeV[i]].y));
auto maxPoint = make_pair(max(arr[edgeU[i]].x, arr[edgeV[i]].x), max(arr[edgeU[i]].y, arr[edgeV[i]].y));
if(avoid.find(make_pair(minPoint, maxPoint)) != avoid.end()) continue;
swap(edgeU[i], edgeU[pnt]);
swap(edgeV[i], edgeV[pnt]);
swap(edgeA[i], edgeA[pnt]);
swap(edgeB[i], edgeB[pnt]);
pnt++;
}
edgeCnt = pnt;
n = pnt+1;
build(vector<int>(edgeU, edgeU+n-1), vector<int>(edgeV, edgeV+n-1), vector<int>(edgeA, edgeA+n-1), vector<int>(edgeB, edgeB+n-1));
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1442 ms |
74688 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
4 ms |
716 KB |
Output is correct |
26 |
Correct |
4 ms |
588 KB |
Output is correct |
27 |
Correct |
5 ms |
716 KB |
Output is correct |
28 |
Correct |
385 ms |
29992 KB |
Output is correct |
29 |
Correct |
749 ms |
44884 KB |
Output is correct |
30 |
Correct |
1051 ms |
59800 KB |
Output is correct |
31 |
Correct |
1393 ms |
74796 KB |
Output is correct |
32 |
Correct |
1 ms |
204 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
2 ms |
204 KB |
Output is correct |
36 |
Correct |
1 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
204 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
2 ms |
460 KB |
Output is correct |
44 |
Correct |
3 ms |
588 KB |
Output is correct |
45 |
Correct |
290 ms |
14320 KB |
Output is correct |
46 |
Correct |
474 ms |
20696 KB |
Output is correct |
47 |
Correct |
474 ms |
20776 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1442 ms |
74688 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
4 ms |
716 KB |
Output is correct |
26 |
Correct |
4 ms |
588 KB |
Output is correct |
27 |
Correct |
5 ms |
716 KB |
Output is correct |
28 |
Correct |
385 ms |
29992 KB |
Output is correct |
29 |
Correct |
749 ms |
44884 KB |
Output is correct |
30 |
Correct |
1051 ms |
59800 KB |
Output is correct |
31 |
Correct |
1393 ms |
74796 KB |
Output is correct |
32 |
Correct |
1 ms |
204 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
2 ms |
204 KB |
Output is correct |
36 |
Correct |
1 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
204 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
2 ms |
460 KB |
Output is correct |
44 |
Correct |
3 ms |
588 KB |
Output is correct |
45 |
Correct |
290 ms |
14320 KB |
Output is correct |
46 |
Correct |
474 ms |
20696 KB |
Output is correct |
47 |
Correct |
474 ms |
20776 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
1 ms |
332 KB |
Output is correct |
53 |
Correct |
1 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1789 ms |
96812 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
7 ms |
1100 KB |
Output is correct |
58 |
Correct |
25 ms |
3252 KB |
Output is correct |
59 |
Correct |
12 ms |
1484 KB |
Output is correct |
60 |
Correct |
678 ms |
48568 KB |
Output is correct |
61 |
Correct |
1024 ms |
65476 KB |
Output is correct |
62 |
Correct |
1311 ms |
80056 KB |
Output is correct |
63 |
Correct |
1677 ms |
96836 KB |
Output is correct |
64 |
Correct |
1 ms |
204 KB |
Output is correct |
65 |
Correct |
1 ms |
332 KB |
Output is correct |
66 |
Correct |
1 ms |
204 KB |
Output is correct |
67 |
Correct |
621 ms |
28484 KB |
Output is correct |
68 |
Correct |
634 ms |
28492 KB |
Output is correct |
69 |
Correct |
647 ms |
28280 KB |
Output is correct |
70 |
Correct |
4 ms |
716 KB |
Output is correct |
71 |
Correct |
8 ms |
1100 KB |
Output is correct |
72 |
Correct |
269 ms |
14404 KB |
Output is correct |
73 |
Correct |
517 ms |
21368 KB |
Output is correct |
74 |
Correct |
783 ms |
28504 KB |
Output is correct |
75 |
Correct |
759 ms |
30292 KB |
Output is correct |
76 |
Correct |
649 ms |
28488 KB |
Output is correct |
77 |
Correct |
5 ms |
844 KB |
Output is correct |
78 |
Correct |
10 ms |
1228 KB |
Output is correct |
79 |
Correct |
295 ms |
14876 KB |
Output is correct |
80 |
Correct |
543 ms |
22212 KB |
Output is correct |
81 |
Correct |
786 ms |
29596 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
733 ms |
29032 KB |
Output is correct |
21 |
Correct |
832 ms |
28648 KB |
Output is correct |
22 |
Correct |
781 ms |
28772 KB |
Output is correct |
23 |
Correct |
527 ms |
24284 KB |
Output is correct |
24 |
Correct |
422 ms |
19116 KB |
Output is correct |
25 |
Correct |
532 ms |
22236 KB |
Output is correct |
26 |
Correct |
455 ms |
22212 KB |
Output is correct |
27 |
Correct |
751 ms |
28484 KB |
Output is correct |
28 |
Correct |
752 ms |
28500 KB |
Output is correct |
29 |
Correct |
740 ms |
28484 KB |
Output is correct |
30 |
Correct |
718 ms |
28484 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
28 ms |
2640 KB |
Output is correct |
33 |
Correct |
121 ms |
9624 KB |
Output is correct |
34 |
Correct |
712 ms |
29096 KB |
Output is correct |
35 |
Correct |
12 ms |
1356 KB |
Output is correct |
36 |
Correct |
79 ms |
5700 KB |
Output is correct |
37 |
Correct |
182 ms |
11232 KB |
Output is correct |
38 |
Correct |
220 ms |
11772 KB |
Output is correct |
39 |
Correct |
349 ms |
16036 KB |
Output is correct |
40 |
Correct |
498 ms |
20332 KB |
Output is correct |
41 |
Correct |
648 ms |
24640 KB |
Output is correct |
42 |
Correct |
824 ms |
28924 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
204 KB |
Output is correct |
47 |
Correct |
1 ms |
204 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
1 ms |
204 KB |
Output is correct |
53 |
Correct |
1 ms |
332 KB |
Output is correct |
54 |
Correct |
2 ms |
460 KB |
Output is correct |
55 |
Correct |
4 ms |
636 KB |
Output is correct |
56 |
Correct |
264 ms |
14356 KB |
Output is correct |
57 |
Correct |
455 ms |
20720 KB |
Output is correct |
58 |
Correct |
446 ms |
20696 KB |
Output is correct |
59 |
Correct |
1 ms |
204 KB |
Output is correct |
60 |
Correct |
1 ms |
332 KB |
Output is correct |
61 |
Correct |
1 ms |
204 KB |
Output is correct |
62 |
Correct |
617 ms |
28516 KB |
Output is correct |
63 |
Correct |
607 ms |
28504 KB |
Output is correct |
64 |
Correct |
603 ms |
28372 KB |
Output is correct |
65 |
Correct |
5 ms |
716 KB |
Output is correct |
66 |
Correct |
8 ms |
1124 KB |
Output is correct |
67 |
Correct |
289 ms |
14464 KB |
Output is correct |
68 |
Correct |
499 ms |
21364 KB |
Output is correct |
69 |
Correct |
772 ms |
28612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
17 |
Correct |
666 ms |
28512 KB |
Output is correct |
18 |
Correct |
647 ms |
28576 KB |
Output is correct |
19 |
Correct |
740 ms |
28672 KB |
Output is correct |
20 |
Correct |
882 ms |
31328 KB |
Output is correct |
21 |
Correct |
706 ms |
25836 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
76 ms |
5132 KB |
Output is correct |
24 |
Correct |
27 ms |
2496 KB |
Output is correct |
25 |
Correct |
118 ms |
8156 KB |
Output is correct |
26 |
Correct |
265 ms |
13744 KB |
Output is correct |
27 |
Correct |
343 ms |
15560 KB |
Output is correct |
28 |
Correct |
474 ms |
19616 KB |
Output is correct |
29 |
Correct |
626 ms |
23532 KB |
Output is correct |
30 |
Correct |
729 ms |
27148 KB |
Output is correct |
31 |
Correct |
903 ms |
31188 KB |
Output is correct |
32 |
Correct |
762 ms |
30276 KB |
Output is correct |
33 |
Correct |
658 ms |
28504 KB |
Output is correct |
34 |
Correct |
7 ms |
844 KB |
Output is correct |
35 |
Correct |
10 ms |
1228 KB |
Output is correct |
36 |
Correct |
340 ms |
14788 KB |
Output is correct |
37 |
Correct |
488 ms |
22212 KB |
Output is correct |
38 |
Correct |
797 ms |
29472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
233 ms |
14388 KB |
Output is correct |
10 |
Correct |
15 ms |
1868 KB |
Output is correct |
11 |
Correct |
91 ms |
7876 KB |
Output is correct |
12 |
Correct |
23 ms |
2604 KB |
Output is correct |
13 |
Correct |
40 ms |
5060 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
2 ms |
460 KB |
Output is correct |
16 |
Correct |
229 ms |
14404 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1442 ms |
74688 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
4 ms |
716 KB |
Output is correct |
26 |
Correct |
4 ms |
588 KB |
Output is correct |
27 |
Correct |
5 ms |
716 KB |
Output is correct |
28 |
Correct |
385 ms |
29992 KB |
Output is correct |
29 |
Correct |
749 ms |
44884 KB |
Output is correct |
30 |
Correct |
1051 ms |
59800 KB |
Output is correct |
31 |
Correct |
1393 ms |
74796 KB |
Output is correct |
32 |
Correct |
1 ms |
204 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
2 ms |
204 KB |
Output is correct |
36 |
Correct |
1 ms |
204 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
204 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
2 ms |
460 KB |
Output is correct |
44 |
Correct |
3 ms |
588 KB |
Output is correct |
45 |
Correct |
290 ms |
14320 KB |
Output is correct |
46 |
Correct |
474 ms |
20696 KB |
Output is correct |
47 |
Correct |
474 ms |
20776 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
1 ms |
332 KB |
Output is correct |
53 |
Correct |
1 ms |
332 KB |
Output is correct |
54 |
Correct |
1 ms |
332 KB |
Output is correct |
55 |
Correct |
1789 ms |
96812 KB |
Output is correct |
56 |
Correct |
1 ms |
332 KB |
Output is correct |
57 |
Correct |
7 ms |
1100 KB |
Output is correct |
58 |
Correct |
25 ms |
3252 KB |
Output is correct |
59 |
Correct |
12 ms |
1484 KB |
Output is correct |
60 |
Correct |
678 ms |
48568 KB |
Output is correct |
61 |
Correct |
1024 ms |
65476 KB |
Output is correct |
62 |
Correct |
1311 ms |
80056 KB |
Output is correct |
63 |
Correct |
1677 ms |
96836 KB |
Output is correct |
64 |
Correct |
1 ms |
204 KB |
Output is correct |
65 |
Correct |
1 ms |
332 KB |
Output is correct |
66 |
Correct |
1 ms |
204 KB |
Output is correct |
67 |
Correct |
621 ms |
28484 KB |
Output is correct |
68 |
Correct |
634 ms |
28492 KB |
Output is correct |
69 |
Correct |
647 ms |
28280 KB |
Output is correct |
70 |
Correct |
4 ms |
716 KB |
Output is correct |
71 |
Correct |
8 ms |
1100 KB |
Output is correct |
72 |
Correct |
269 ms |
14404 KB |
Output is correct |
73 |
Correct |
517 ms |
21368 KB |
Output is correct |
74 |
Correct |
783 ms |
28504 KB |
Output is correct |
75 |
Correct |
759 ms |
30292 KB |
Output is correct |
76 |
Correct |
649 ms |
28488 KB |
Output is correct |
77 |
Correct |
5 ms |
844 KB |
Output is correct |
78 |
Correct |
10 ms |
1228 KB |
Output is correct |
79 |
Correct |
295 ms |
14876 KB |
Output is correct |
80 |
Correct |
543 ms |
22212 KB |
Output is correct |
81 |
Correct |
786 ms |
29596 KB |
Output is correct |
82 |
Correct |
1 ms |
332 KB |
Output is correct |
83 |
Correct |
1 ms |
332 KB |
Output is correct |
84 |
Correct |
1 ms |
332 KB |
Output is correct |
85 |
Correct |
733 ms |
29032 KB |
Output is correct |
86 |
Correct |
832 ms |
28648 KB |
Output is correct |
87 |
Correct |
781 ms |
28772 KB |
Output is correct |
88 |
Correct |
527 ms |
24284 KB |
Output is correct |
89 |
Correct |
422 ms |
19116 KB |
Output is correct |
90 |
Correct |
532 ms |
22236 KB |
Output is correct |
91 |
Correct |
455 ms |
22212 KB |
Output is correct |
92 |
Correct |
751 ms |
28484 KB |
Output is correct |
93 |
Correct |
752 ms |
28500 KB |
Output is correct |
94 |
Correct |
740 ms |
28484 KB |
Output is correct |
95 |
Correct |
718 ms |
28484 KB |
Output is correct |
96 |
Correct |
1 ms |
332 KB |
Output is correct |
97 |
Correct |
28 ms |
2640 KB |
Output is correct |
98 |
Correct |
121 ms |
9624 KB |
Output is correct |
99 |
Correct |
712 ms |
29096 KB |
Output is correct |
100 |
Correct |
12 ms |
1356 KB |
Output is correct |
101 |
Correct |
79 ms |
5700 KB |
Output is correct |
102 |
Correct |
182 ms |
11232 KB |
Output is correct |
103 |
Correct |
220 ms |
11772 KB |
Output is correct |
104 |
Correct |
349 ms |
16036 KB |
Output is correct |
105 |
Correct |
498 ms |
20332 KB |
Output is correct |
106 |
Correct |
648 ms |
24640 KB |
Output is correct |
107 |
Correct |
824 ms |
28924 KB |
Output is correct |
108 |
Correct |
1 ms |
332 KB |
Output is correct |
109 |
Correct |
1 ms |
332 KB |
Output is correct |
110 |
Correct |
1 ms |
332 KB |
Output is correct |
111 |
Correct |
1 ms |
204 KB |
Output is correct |
112 |
Correct |
1 ms |
204 KB |
Output is correct |
113 |
Correct |
1 ms |
332 KB |
Output is correct |
114 |
Correct |
1 ms |
332 KB |
Output is correct |
115 |
Correct |
1 ms |
332 KB |
Output is correct |
116 |
Correct |
1 ms |
332 KB |
Output is correct |
117 |
Correct |
1 ms |
204 KB |
Output is correct |
118 |
Correct |
1 ms |
332 KB |
Output is correct |
119 |
Correct |
2 ms |
460 KB |
Output is correct |
120 |
Correct |
4 ms |
636 KB |
Output is correct |
121 |
Correct |
264 ms |
14356 KB |
Output is correct |
122 |
Correct |
455 ms |
20720 KB |
Output is correct |
123 |
Correct |
446 ms |
20696 KB |
Output is correct |
124 |
Correct |
1 ms |
204 KB |
Output is correct |
125 |
Correct |
1 ms |
332 KB |
Output is correct |
126 |
Correct |
1 ms |
204 KB |
Output is correct |
127 |
Correct |
617 ms |
28516 KB |
Output is correct |
128 |
Correct |
607 ms |
28504 KB |
Output is correct |
129 |
Correct |
603 ms |
28372 KB |
Output is correct |
130 |
Correct |
5 ms |
716 KB |
Output is correct |
131 |
Correct |
8 ms |
1124 KB |
Output is correct |
132 |
Correct |
289 ms |
14464 KB |
Output is correct |
133 |
Correct |
499 ms |
21364 KB |
Output is correct |
134 |
Correct |
772 ms |
28612 KB |
Output is correct |
135 |
Correct |
666 ms |
28512 KB |
Output is correct |
136 |
Correct |
647 ms |
28576 KB |
Output is correct |
137 |
Correct |
740 ms |
28672 KB |
Output is correct |
138 |
Correct |
882 ms |
31328 KB |
Output is correct |
139 |
Correct |
706 ms |
25836 KB |
Output is correct |
140 |
Correct |
1 ms |
332 KB |
Output is correct |
141 |
Correct |
76 ms |
5132 KB |
Output is correct |
142 |
Correct |
27 ms |
2496 KB |
Output is correct |
143 |
Correct |
118 ms |
8156 KB |
Output is correct |
144 |
Correct |
265 ms |
13744 KB |
Output is correct |
145 |
Correct |
343 ms |
15560 KB |
Output is correct |
146 |
Correct |
474 ms |
19616 KB |
Output is correct |
147 |
Correct |
626 ms |
23532 KB |
Output is correct |
148 |
Correct |
729 ms |
27148 KB |
Output is correct |
149 |
Correct |
903 ms |
31188 KB |
Output is correct |
150 |
Correct |
762 ms |
30276 KB |
Output is correct |
151 |
Correct |
658 ms |
28504 KB |
Output is correct |
152 |
Correct |
7 ms |
844 KB |
Output is correct |
153 |
Correct |
10 ms |
1228 KB |
Output is correct |
154 |
Correct |
340 ms |
14788 KB |
Output is correct |
155 |
Correct |
488 ms |
22212 KB |
Output is correct |
156 |
Correct |
797 ms |
29472 KB |
Output is correct |
157 |
Correct |
1 ms |
204 KB |
Output is correct |
158 |
Correct |
1 ms |
204 KB |
Output is correct |
159 |
Correct |
1 ms |
332 KB |
Output is correct |
160 |
Correct |
1 ms |
332 KB |
Output is correct |
161 |
Correct |
2145 ms |
102196 KB |
Output is correct |
162 |
Correct |
648 ms |
28988 KB |
Output is correct |
163 |
Correct |
1161 ms |
73840 KB |
Output is correct |
164 |
Correct |
1188 ms |
73732 KB |
Output is correct |
165 |
Correct |
1684 ms |
94100 KB |
Output is correct |
166 |
Correct |
2130 ms |
101680 KB |
Output is correct |
167 |
Correct |
247 ms |
19400 KB |
Output is correct |
168 |
Correct |
49 ms |
4040 KB |
Output is correct |
169 |
Correct |
154 ms |
10180 KB |
Output is correct |
170 |
Correct |
372 ms |
18888 KB |
Output is correct |
171 |
Correct |
613 ms |
25188 KB |
Output is correct |
172 |
Correct |
800 ms |
51872 KB |
Output is correct |
173 |
Correct |
1037 ms |
62736 KB |
Output is correct |
174 |
Correct |
1288 ms |
70844 KB |
Output is correct |
175 |
Correct |
1485 ms |
82828 KB |
Output is correct |
176 |
Correct |
1846 ms |
94516 KB |
Output is correct |
177 |
Correct |
2013 ms |
104560 KB |
Output is correct |