#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using vi = vector<int>;
using ll = long long;
using ar2 = array<int,2>;
using ar3 = array<int,3>;
const int mxN = (int)2e5+10;
int n;
struct Edge{
int fa, fb, x, y;
Edge(int a=0, int b=0, int _x=-1, int _y=-1){
fa=a, fb=b, x=_x, y=_y;
}
};
vector<Edge> edges;
vector<ar3> fountains, origFountains;
vector<int> adj[mxN];
set<ar2> usedB, S[mxN];
template<int SZ> struct DSU{
int p[SZ];
vector<int> comp[SZ];
void init(int n){
for(int i = 0; i < n; i++){
p[i]=i; comp[i].clear();
comp[i].pb(i);
}
}
int findSet(int i){return p[i]==i?i:p[i]=findSet(p[i]);}
bool isSameSet(int i, int j) {return findSet(i)==findSet(j);}
void unionSet(int i, int j){
adj[i].pb(j); adj[j].pb(i);
int x = findSet(i), y = findSet(j);
if(x==y) return;
if(sz(comp[x]) < sz(comp[y])) swap(x,y);
p[y]=x; for(auto u : comp[y]) comp[x].pb(u);
}
int findSz(int i) { return sz(comp[findSet(i)]); }
};
DSU<mxN> dsu;
int construct_roads(vi x, vi y) {
n = sz(x); dsu.init(n);
if (n==1){ build({}, {}, {}, {}); return 1; }
for(int i = 0; i < n; i++){
fountains.pb({x[i],y[i],i});
origFountains.pb({x[i],y[i],i});
}
sort(all(fountains),[&](ar3 a, ar3 b){
if(a[0]!=b[0]) return a[0]<b[0];
return a[1]<b[1];
});
for(int i = sz(fountains)-1; i>=0; i--)
S[fountains[i][0]].insert({fountains[i][1], fountains[i][2]});
for(int i = 1; i < sz(fountains); i++){
if(fountains[i][0]!=fountains[i-1][0]) continue;
if(fountains[i][1]-fountains[i-1][1]==2){
auto [x1,y1,a] = fountains[i-1];
auto [x2,y2,b] = fountains[i];
dsu.unionSet(a,b);
}
}
for(int i = 0; i < sz(fountains); i++){
auto [x1,y1,a] = fountains[i];
auto itr = S[x1+2].lower_bound({y1,-1});
if(itr==end(S[x1+2]) or (*itr)[0]!=y1) continue;
int b = (*itr)[1]; dsu.unionSet(a,b);
}
if(dsu.findSz(0)!=n) return 0;
for(auto [x1,y1,i] : fountains){
int choice = ((x1+y1)%4==0);
for(auto j : adj[i]){
auto [x2,y2,_] = origFountains[j];
int ver = 0;
if(x1==x2){
if(y1>y2) continue;
ver = 1;
}
else if(x1>x2) continue;
if(choice){
if(ver){
if(!usedB.count({x1+1,y1+1})){
usedB.insert({x1+1,y1+1});
edges.pb(Edge(i,j,x1+1,y1+1));
}
}
else{
if(!usedB.count({x1+1,y1-1})){
usedB.insert({x1+1,y1-1});
edges.pb(Edge(i,j,x1+1,y1-1));
}
}
}
else{
if(ver){
if(!usedB.count({x1-1,y1+1})){
usedB.insert({x1-1,y1+1});
edges.pb(Edge(i,j,x1-1,y1+1));
}
}
else{
if(!usedB.count({x1+1,y1+1})){
usedB.insert({x1+1,y1+1});
edges.pb(Edge(i,j,x1+1,y1+1));
}
}
}
}
}
vi U, V, A, B;
for(auto edge : edges){
U.pb(edge.fa), V.pb(edge.fb);
A.pb(edge.x), B.pb(edge.y);
}
build(U,V,A,B); return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
17 |
Correct |
3 ms |
19804 KB |
Output is correct |
18 |
Correct |
3 ms |
19804 KB |
Output is correct |
19 |
Correct |
3 ms |
19804 KB |
Output is correct |
20 |
Correct |
3 ms |
19804 KB |
Output is correct |
21 |
Correct |
3 ms |
19804 KB |
Output is correct |
22 |
Correct |
3 ms |
19804 KB |
Output is correct |
23 |
Correct |
213 ms |
78284 KB |
Output is correct |
24 |
Correct |
3 ms |
20056 KB |
Output is correct |
25 |
Correct |
4 ms |
20060 KB |
Output is correct |
26 |
Correct |
4 ms |
20316 KB |
Output is correct |
27 |
Correct |
5 ms |
20316 KB |
Output is correct |
28 |
Correct |
81 ms |
43024 KB |
Output is correct |
29 |
Correct |
127 ms |
54152 KB |
Output is correct |
30 |
Correct |
168 ms |
67396 KB |
Output is correct |
31 |
Correct |
219 ms |
77820 KB |
Output is correct |
32 |
Correct |
3 ms |
19804 KB |
Output is correct |
33 |
Correct |
3 ms |
19852 KB |
Output is correct |
34 |
Correct |
3 ms |
19804 KB |
Output is correct |
35 |
Correct |
3 ms |
19800 KB |
Output is correct |
36 |
Correct |
3 ms |
19804 KB |
Output is correct |
37 |
Correct |
3 ms |
19804 KB |
Output is correct |
38 |
Correct |
2 ms |
19816 KB |
Output is correct |
39 |
Correct |
3 ms |
19800 KB |
Output is correct |
40 |
Correct |
3 ms |
19804 KB |
Output is correct |
41 |
Correct |
3 ms |
19800 KB |
Output is correct |
42 |
Correct |
3 ms |
19804 KB |
Output is correct |
43 |
Correct |
3 ms |
20060 KB |
Output is correct |
44 |
Correct |
5 ms |
20312 KB |
Output is correct |
45 |
Correct |
94 ms |
48680 KB |
Output is correct |
46 |
Correct |
139 ms |
63932 KB |
Output is correct |
47 |
Correct |
150 ms |
63932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
17 |
Correct |
3 ms |
19804 KB |
Output is correct |
18 |
Correct |
3 ms |
19804 KB |
Output is correct |
19 |
Correct |
3 ms |
19804 KB |
Output is correct |
20 |
Correct |
3 ms |
19804 KB |
Output is correct |
21 |
Correct |
3 ms |
19804 KB |
Output is correct |
22 |
Correct |
3 ms |
19804 KB |
Output is correct |
23 |
Correct |
213 ms |
78284 KB |
Output is correct |
24 |
Correct |
3 ms |
20056 KB |
Output is correct |
25 |
Correct |
4 ms |
20060 KB |
Output is correct |
26 |
Correct |
4 ms |
20316 KB |
Output is correct |
27 |
Correct |
5 ms |
20316 KB |
Output is correct |
28 |
Correct |
81 ms |
43024 KB |
Output is correct |
29 |
Correct |
127 ms |
54152 KB |
Output is correct |
30 |
Correct |
168 ms |
67396 KB |
Output is correct |
31 |
Correct |
219 ms |
77820 KB |
Output is correct |
32 |
Correct |
3 ms |
19804 KB |
Output is correct |
33 |
Correct |
3 ms |
19852 KB |
Output is correct |
34 |
Correct |
3 ms |
19804 KB |
Output is correct |
35 |
Correct |
3 ms |
19800 KB |
Output is correct |
36 |
Correct |
3 ms |
19804 KB |
Output is correct |
37 |
Correct |
3 ms |
19804 KB |
Output is correct |
38 |
Correct |
2 ms |
19816 KB |
Output is correct |
39 |
Correct |
3 ms |
19800 KB |
Output is correct |
40 |
Correct |
3 ms |
19804 KB |
Output is correct |
41 |
Correct |
3 ms |
19800 KB |
Output is correct |
42 |
Correct |
3 ms |
19804 KB |
Output is correct |
43 |
Correct |
3 ms |
20060 KB |
Output is correct |
44 |
Correct |
5 ms |
20312 KB |
Output is correct |
45 |
Correct |
94 ms |
48680 KB |
Output is correct |
46 |
Correct |
139 ms |
63932 KB |
Output is correct |
47 |
Correct |
150 ms |
63932 KB |
Output is correct |
48 |
Correct |
3 ms |
19800 KB |
Output is correct |
49 |
Correct |
4 ms |
19800 KB |
Output is correct |
50 |
Correct |
3 ms |
19832 KB |
Output is correct |
51 |
Correct |
3 ms |
19800 KB |
Output is correct |
52 |
Correct |
3 ms |
19812 KB |
Output is correct |
53 |
Correct |
3 ms |
19804 KB |
Output is correct |
54 |
Correct |
3 ms |
19804 KB |
Output is correct |
55 |
Correct |
218 ms |
77200 KB |
Output is correct |
56 |
Correct |
3 ms |
19800 KB |
Output is correct |
57 |
Correct |
4 ms |
20316 KB |
Output is correct |
58 |
Correct |
7 ms |
21656 KB |
Output is correct |
59 |
Correct |
7 ms |
21468 KB |
Output is correct |
60 |
Correct |
101 ms |
48472 KB |
Output is correct |
61 |
Correct |
144 ms |
62992 KB |
Output is correct |
62 |
Correct |
179 ms |
69300 KB |
Output is correct |
63 |
Correct |
212 ms |
78088 KB |
Output is correct |
64 |
Correct |
3 ms |
19800 KB |
Output is correct |
65 |
Correct |
4 ms |
19804 KB |
Output is correct |
66 |
Correct |
2 ms |
19804 KB |
Output is correct |
67 |
Correct |
207 ms |
77660 KB |
Output is correct |
68 |
Correct |
199 ms |
77576 KB |
Output is correct |
69 |
Correct |
192 ms |
77844 KB |
Output is correct |
70 |
Correct |
5 ms |
20316 KB |
Output is correct |
71 |
Correct |
6 ms |
21084 KB |
Output is correct |
72 |
Correct |
105 ms |
48832 KB |
Output is correct |
73 |
Correct |
152 ms |
66708 KB |
Output is correct |
74 |
Correct |
215 ms |
77576 KB |
Output is correct |
75 |
Correct |
228 ms |
82188 KB |
Output is correct |
76 |
Correct |
185 ms |
77328 KB |
Output is correct |
77 |
Correct |
5 ms |
20568 KB |
Output is correct |
78 |
Correct |
6 ms |
21212 KB |
Output is correct |
79 |
Correct |
99 ms |
50268 KB |
Output is correct |
80 |
Correct |
157 ms |
68248 KB |
Output is correct |
81 |
Correct |
215 ms |
80396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
17 |
Correct |
3 ms |
19800 KB |
Output is correct |
18 |
Correct |
3 ms |
19804 KB |
Output is correct |
19 |
Correct |
3 ms |
19804 KB |
Output is correct |
20 |
Correct |
183 ms |
78436 KB |
Output is correct |
21 |
Correct |
204 ms |
78700 KB |
Output is correct |
22 |
Correct |
195 ms |
78572 KB |
Output is correct |
23 |
Correct |
154 ms |
70388 KB |
Output is correct |
24 |
Correct |
71 ms |
44420 KB |
Output is correct |
25 |
Correct |
106 ms |
51740 KB |
Output is correct |
26 |
Correct |
92 ms |
52012 KB |
Output is correct |
27 |
Correct |
179 ms |
77836 KB |
Output is correct |
28 |
Correct |
171 ms |
77668 KB |
Output is correct |
29 |
Correct |
201 ms |
76812 KB |
Output is correct |
30 |
Correct |
185 ms |
77716 KB |
Output is correct |
31 |
Correct |
3 ms |
19800 KB |
Output is correct |
32 |
Correct |
13 ms |
24148 KB |
Output is correct |
33 |
Correct |
30 ms |
32316 KB |
Output is correct |
34 |
Correct |
187 ms |
79056 KB |
Output is correct |
35 |
Correct |
8 ms |
21464 KB |
Output is correct |
36 |
Correct |
27 ms |
28224 KB |
Output is correct |
37 |
Correct |
52 ms |
36500 KB |
Output is correct |
38 |
Correct |
82 ms |
44220 KB |
Output is correct |
39 |
Correct |
101 ms |
52876 KB |
Output is correct |
40 |
Correct |
140 ms |
64740 KB |
Output is correct |
41 |
Correct |
175 ms |
71924 KB |
Output is correct |
42 |
Correct |
198 ms |
79972 KB |
Output is correct |
43 |
Correct |
4 ms |
19800 KB |
Output is correct |
44 |
Correct |
3 ms |
19804 KB |
Output is correct |
45 |
Correct |
3 ms |
19804 KB |
Output is correct |
46 |
Correct |
3 ms |
19804 KB |
Output is correct |
47 |
Correct |
3 ms |
19800 KB |
Output is correct |
48 |
Correct |
3 ms |
19804 KB |
Output is correct |
49 |
Correct |
3 ms |
19804 KB |
Output is correct |
50 |
Correct |
3 ms |
19804 KB |
Output is correct |
51 |
Correct |
2 ms |
19804 KB |
Output is correct |
52 |
Correct |
3 ms |
19848 KB |
Output is correct |
53 |
Correct |
3 ms |
19804 KB |
Output is correct |
54 |
Correct |
4 ms |
20056 KB |
Output is correct |
55 |
Correct |
4 ms |
20316 KB |
Output is correct |
56 |
Correct |
99 ms |
48664 KB |
Output is correct |
57 |
Correct |
144 ms |
65020 KB |
Output is correct |
58 |
Correct |
140 ms |
64096 KB |
Output is correct |
59 |
Correct |
3 ms |
19852 KB |
Output is correct |
60 |
Correct |
3 ms |
19804 KB |
Output is correct |
61 |
Correct |
3 ms |
19824 KB |
Output is correct |
62 |
Correct |
195 ms |
77880 KB |
Output is correct |
63 |
Correct |
204 ms |
77452 KB |
Output is correct |
64 |
Correct |
194 ms |
77084 KB |
Output is correct |
65 |
Correct |
5 ms |
20316 KB |
Output is correct |
66 |
Correct |
7 ms |
21140 KB |
Output is correct |
67 |
Correct |
107 ms |
48944 KB |
Output is correct |
68 |
Correct |
162 ms |
65684 KB |
Output is correct |
69 |
Correct |
210 ms |
77836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
17 |
Correct |
181 ms |
78088 KB |
Output is correct |
18 |
Correct |
213 ms |
78344 KB |
Output is correct |
19 |
Correct |
179 ms |
79108 KB |
Output is correct |
20 |
Correct |
190 ms |
84308 KB |
Output is correct |
21 |
Correct |
163 ms |
73568 KB |
Output is correct |
22 |
Correct |
3 ms |
19804 KB |
Output is correct |
23 |
Correct |
29 ms |
30116 KB |
Output is correct |
24 |
Correct |
11 ms |
23256 KB |
Output is correct |
25 |
Correct |
36 ms |
31472 KB |
Output is correct |
26 |
Correct |
67 ms |
39484 KB |
Output is correct |
27 |
Correct |
100 ms |
51488 KB |
Output is correct |
28 |
Correct |
131 ms |
61020 KB |
Output is correct |
29 |
Correct |
169 ms |
70292 KB |
Output is correct |
30 |
Correct |
189 ms |
76756 KB |
Output is correct |
31 |
Correct |
236 ms |
83720 KB |
Output is correct |
32 |
Correct |
222 ms |
82324 KB |
Output is correct |
33 |
Correct |
204 ms |
78348 KB |
Output is correct |
34 |
Correct |
5 ms |
20572 KB |
Output is correct |
35 |
Correct |
6 ms |
21284 KB |
Output is correct |
36 |
Correct |
102 ms |
50176 KB |
Output is correct |
37 |
Correct |
157 ms |
68244 KB |
Output is correct |
38 |
Correct |
240 ms |
81184 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
19804 KB |
Output is correct |
2 |
Correct |
3 ms |
19844 KB |
Output is correct |
3 |
Correct |
3 ms |
19804 KB |
Output is correct |
4 |
Correct |
3 ms |
19824 KB |
Output is correct |
5 |
Correct |
3 ms |
19800 KB |
Output is correct |
6 |
Correct |
3 ms |
19804 KB |
Output is correct |
7 |
Correct |
4 ms |
19816 KB |
Output is correct |
8 |
Correct |
3 ms |
19804 KB |
Output is correct |
9 |
Correct |
87 ms |
48496 KB |
Output is correct |
10 |
Correct |
9 ms |
22616 KB |
Output is correct |
11 |
Correct |
40 ms |
35116 KB |
Output is correct |
12 |
Correct |
12 ms |
24152 KB |
Output is correct |
13 |
Correct |
17 ms |
27008 KB |
Output is correct |
14 |
Correct |
3 ms |
19976 KB |
Output is correct |
15 |
Correct |
4 ms |
20060 KB |
Output is correct |
16 |
Correct |
91 ms |
48480 KB |
Output is correct |
17 |
Correct |
3 ms |
19804 KB |
Output is correct |
18 |
Correct |
3 ms |
19804 KB |
Output is correct |
19 |
Correct |
3 ms |
19804 KB |
Output is correct |
20 |
Correct |
3 ms |
19804 KB |
Output is correct |
21 |
Correct |
3 ms |
19804 KB |
Output is correct |
22 |
Correct |
3 ms |
19804 KB |
Output is correct |
23 |
Correct |
213 ms |
78284 KB |
Output is correct |
24 |
Correct |
3 ms |
20056 KB |
Output is correct |
25 |
Correct |
4 ms |
20060 KB |
Output is correct |
26 |
Correct |
4 ms |
20316 KB |
Output is correct |
27 |
Correct |
5 ms |
20316 KB |
Output is correct |
28 |
Correct |
81 ms |
43024 KB |
Output is correct |
29 |
Correct |
127 ms |
54152 KB |
Output is correct |
30 |
Correct |
168 ms |
67396 KB |
Output is correct |
31 |
Correct |
219 ms |
77820 KB |
Output is correct |
32 |
Correct |
3 ms |
19804 KB |
Output is correct |
33 |
Correct |
3 ms |
19852 KB |
Output is correct |
34 |
Correct |
3 ms |
19804 KB |
Output is correct |
35 |
Correct |
3 ms |
19800 KB |
Output is correct |
36 |
Correct |
3 ms |
19804 KB |
Output is correct |
37 |
Correct |
3 ms |
19804 KB |
Output is correct |
38 |
Correct |
2 ms |
19816 KB |
Output is correct |
39 |
Correct |
3 ms |
19800 KB |
Output is correct |
40 |
Correct |
3 ms |
19804 KB |
Output is correct |
41 |
Correct |
3 ms |
19800 KB |
Output is correct |
42 |
Correct |
3 ms |
19804 KB |
Output is correct |
43 |
Correct |
3 ms |
20060 KB |
Output is correct |
44 |
Correct |
5 ms |
20312 KB |
Output is correct |
45 |
Correct |
94 ms |
48680 KB |
Output is correct |
46 |
Correct |
139 ms |
63932 KB |
Output is correct |
47 |
Correct |
150 ms |
63932 KB |
Output is correct |
48 |
Correct |
3 ms |
19800 KB |
Output is correct |
49 |
Correct |
4 ms |
19800 KB |
Output is correct |
50 |
Correct |
3 ms |
19832 KB |
Output is correct |
51 |
Correct |
3 ms |
19800 KB |
Output is correct |
52 |
Correct |
3 ms |
19812 KB |
Output is correct |
53 |
Correct |
3 ms |
19804 KB |
Output is correct |
54 |
Correct |
3 ms |
19804 KB |
Output is correct |
55 |
Correct |
218 ms |
77200 KB |
Output is correct |
56 |
Correct |
3 ms |
19800 KB |
Output is correct |
57 |
Correct |
4 ms |
20316 KB |
Output is correct |
58 |
Correct |
7 ms |
21656 KB |
Output is correct |
59 |
Correct |
7 ms |
21468 KB |
Output is correct |
60 |
Correct |
101 ms |
48472 KB |
Output is correct |
61 |
Correct |
144 ms |
62992 KB |
Output is correct |
62 |
Correct |
179 ms |
69300 KB |
Output is correct |
63 |
Correct |
212 ms |
78088 KB |
Output is correct |
64 |
Correct |
3 ms |
19800 KB |
Output is correct |
65 |
Correct |
4 ms |
19804 KB |
Output is correct |
66 |
Correct |
2 ms |
19804 KB |
Output is correct |
67 |
Correct |
207 ms |
77660 KB |
Output is correct |
68 |
Correct |
199 ms |
77576 KB |
Output is correct |
69 |
Correct |
192 ms |
77844 KB |
Output is correct |
70 |
Correct |
5 ms |
20316 KB |
Output is correct |
71 |
Correct |
6 ms |
21084 KB |
Output is correct |
72 |
Correct |
105 ms |
48832 KB |
Output is correct |
73 |
Correct |
152 ms |
66708 KB |
Output is correct |
74 |
Correct |
215 ms |
77576 KB |
Output is correct |
75 |
Correct |
228 ms |
82188 KB |
Output is correct |
76 |
Correct |
185 ms |
77328 KB |
Output is correct |
77 |
Correct |
5 ms |
20568 KB |
Output is correct |
78 |
Correct |
6 ms |
21212 KB |
Output is correct |
79 |
Correct |
99 ms |
50268 KB |
Output is correct |
80 |
Correct |
157 ms |
68248 KB |
Output is correct |
81 |
Correct |
215 ms |
80396 KB |
Output is correct |
82 |
Correct |
3 ms |
19800 KB |
Output is correct |
83 |
Correct |
3 ms |
19804 KB |
Output is correct |
84 |
Correct |
3 ms |
19804 KB |
Output is correct |
85 |
Correct |
183 ms |
78436 KB |
Output is correct |
86 |
Correct |
204 ms |
78700 KB |
Output is correct |
87 |
Correct |
195 ms |
78572 KB |
Output is correct |
88 |
Correct |
154 ms |
70388 KB |
Output is correct |
89 |
Correct |
71 ms |
44420 KB |
Output is correct |
90 |
Correct |
106 ms |
51740 KB |
Output is correct |
91 |
Correct |
92 ms |
52012 KB |
Output is correct |
92 |
Correct |
179 ms |
77836 KB |
Output is correct |
93 |
Correct |
171 ms |
77668 KB |
Output is correct |
94 |
Correct |
201 ms |
76812 KB |
Output is correct |
95 |
Correct |
185 ms |
77716 KB |
Output is correct |
96 |
Correct |
3 ms |
19800 KB |
Output is correct |
97 |
Correct |
13 ms |
24148 KB |
Output is correct |
98 |
Correct |
30 ms |
32316 KB |
Output is correct |
99 |
Correct |
187 ms |
79056 KB |
Output is correct |
100 |
Correct |
8 ms |
21464 KB |
Output is correct |
101 |
Correct |
27 ms |
28224 KB |
Output is correct |
102 |
Correct |
52 ms |
36500 KB |
Output is correct |
103 |
Correct |
82 ms |
44220 KB |
Output is correct |
104 |
Correct |
101 ms |
52876 KB |
Output is correct |
105 |
Correct |
140 ms |
64740 KB |
Output is correct |
106 |
Correct |
175 ms |
71924 KB |
Output is correct |
107 |
Correct |
198 ms |
79972 KB |
Output is correct |
108 |
Correct |
4 ms |
19800 KB |
Output is correct |
109 |
Correct |
3 ms |
19804 KB |
Output is correct |
110 |
Correct |
3 ms |
19804 KB |
Output is correct |
111 |
Correct |
3 ms |
19804 KB |
Output is correct |
112 |
Correct |
3 ms |
19800 KB |
Output is correct |
113 |
Correct |
3 ms |
19804 KB |
Output is correct |
114 |
Correct |
3 ms |
19804 KB |
Output is correct |
115 |
Correct |
3 ms |
19804 KB |
Output is correct |
116 |
Correct |
2 ms |
19804 KB |
Output is correct |
117 |
Correct |
3 ms |
19848 KB |
Output is correct |
118 |
Correct |
3 ms |
19804 KB |
Output is correct |
119 |
Correct |
4 ms |
20056 KB |
Output is correct |
120 |
Correct |
4 ms |
20316 KB |
Output is correct |
121 |
Correct |
99 ms |
48664 KB |
Output is correct |
122 |
Correct |
144 ms |
65020 KB |
Output is correct |
123 |
Correct |
140 ms |
64096 KB |
Output is correct |
124 |
Correct |
3 ms |
19852 KB |
Output is correct |
125 |
Correct |
3 ms |
19804 KB |
Output is correct |
126 |
Correct |
3 ms |
19824 KB |
Output is correct |
127 |
Correct |
195 ms |
77880 KB |
Output is correct |
128 |
Correct |
204 ms |
77452 KB |
Output is correct |
129 |
Correct |
194 ms |
77084 KB |
Output is correct |
130 |
Correct |
5 ms |
20316 KB |
Output is correct |
131 |
Correct |
7 ms |
21140 KB |
Output is correct |
132 |
Correct |
107 ms |
48944 KB |
Output is correct |
133 |
Correct |
162 ms |
65684 KB |
Output is correct |
134 |
Correct |
210 ms |
77836 KB |
Output is correct |
135 |
Correct |
181 ms |
78088 KB |
Output is correct |
136 |
Correct |
213 ms |
78344 KB |
Output is correct |
137 |
Correct |
179 ms |
79108 KB |
Output is correct |
138 |
Correct |
190 ms |
84308 KB |
Output is correct |
139 |
Correct |
163 ms |
73568 KB |
Output is correct |
140 |
Correct |
3 ms |
19804 KB |
Output is correct |
141 |
Correct |
29 ms |
30116 KB |
Output is correct |
142 |
Correct |
11 ms |
23256 KB |
Output is correct |
143 |
Correct |
36 ms |
31472 KB |
Output is correct |
144 |
Correct |
67 ms |
39484 KB |
Output is correct |
145 |
Correct |
100 ms |
51488 KB |
Output is correct |
146 |
Correct |
131 ms |
61020 KB |
Output is correct |
147 |
Correct |
169 ms |
70292 KB |
Output is correct |
148 |
Correct |
189 ms |
76756 KB |
Output is correct |
149 |
Correct |
236 ms |
83720 KB |
Output is correct |
150 |
Correct |
222 ms |
82324 KB |
Output is correct |
151 |
Correct |
204 ms |
78348 KB |
Output is correct |
152 |
Correct |
5 ms |
20572 KB |
Output is correct |
153 |
Correct |
6 ms |
21284 KB |
Output is correct |
154 |
Correct |
102 ms |
50176 KB |
Output is correct |
155 |
Correct |
157 ms |
68244 KB |
Output is correct |
156 |
Correct |
240 ms |
81184 KB |
Output is correct |
157 |
Correct |
3 ms |
19804 KB |
Output is correct |
158 |
Correct |
3 ms |
19804 KB |
Output is correct |
159 |
Correct |
3 ms |
19844 KB |
Output is correct |
160 |
Correct |
3 ms |
19804 KB |
Output is correct |
161 |
Correct |
234 ms |
78272 KB |
Output is correct |
162 |
Correct |
196 ms |
79536 KB |
Output is correct |
163 |
Correct |
185 ms |
78348 KB |
Output is correct |
164 |
Correct |
195 ms |
78676 KB |
Output is correct |
165 |
Correct |
190 ms |
78864 KB |
Output is correct |
166 |
Correct |
188 ms |
79720 KB |
Output is correct |
167 |
Correct |
71 ms |
34000 KB |
Output is correct |
168 |
Correct |
16 ms |
24968 KB |
Output is correct |
169 |
Correct |
40 ms |
33592 KB |
Output is correct |
170 |
Correct |
85 ms |
46132 KB |
Output is correct |
171 |
Correct |
117 ms |
54144 KB |
Output is correct |
172 |
Correct |
94 ms |
49956 KB |
Output is correct |
173 |
Correct |
110 ms |
55688 KB |
Output is correct |
174 |
Correct |
135 ms |
65512 KB |
Output is correct |
175 |
Correct |
154 ms |
70724 KB |
Output is correct |
176 |
Correct |
196 ms |
75092 KB |
Output is correct |
177 |
Correct |
213 ms |
81416 KB |
Output is correct |