#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<P> vp;
typedef vector<vp> vvp;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define fi first
#define se second
#define pb emplace_back
#define all(a) a.begin(),a.end()
template<class T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
vi dx={2,0,-2,0},dy={0,2,0,-2};
ll mx=200005;
int construct_roads(std::vector<int> X, std::vector<int> Y) {
if (X.size() == 1) {
build({}, {}, {}, {});
return 1;
}
ll n=X.size();
map<P,ll> mp;
rep(i,n)mp[P(X[i],Y[i])]=i;
vp edge;
rep(i,n)rep(j,2){
ll nx=X[i]+dx[j],ny=Y[i]+dy[j];
if(mp.count(P(nx,ny)))edge.pb(i,mp[P(nx,ny)]);
}
{
vvi g(n);
for(auto x:edge){
g[x.fi].pb(x.se);
g[x.se].pb(x.fi);
}
queue<ll> que;
vb done(n,false);
done[0]=true;
que.push(0);
while(!que.empty()){
ll t=que.front();que.pop();
for(ll x:g[t])if(!done[x]){
done[x]=true;que.push(x);
}
}
rep(i,n)if(!done[i])return 0;
}
vvp al(mx);
rep(i,n)al[Y[i]].pb(X[i],i);
rep(i,mx)sort(all(al[i]));
vector<int> u, v, a, b;
auto add=[&](ll i,ll j,ll t){
u.pb(i);v.pb(j);
if(t==0||t==1){
assert(Y[i]==Y[j]);
a.pb((X[i]+X[j])/2);
if(t==0)b.pb(Y[i]-1);
else b.pb(Y[i]+1);
}
else{
assert(X[i]==X[j]);
b.pb((Y[i]+Y[j])/2);
if(t==2)a.pb(X[i]-1);
else a.pb(X[i]+1);
}
};
bool small=true;
rep(i,n)if(X[i]>6)small=false;
if(small){
vb tmp(2,false);
rep(i,mx)if(al[i].size()){
vb ntmp(2,false);
if(!al[i-2].size()){
rep(j,al[i].size()-1)if(al[i][j+1].fi-al[i][j].fi==2)add(al[i][j].se,al[i][j+1].se,0);
}
else{
if(al[i].back().fi==6&&al[i-2].back().fi==6)add(al[i].back().se,al[i-2].back().se,3);
if(al[i][0].fi==2&&al[i-2][0].fi==2)add(al[i][0].se,al[i-2][0].se,2);
if(al[i][0].fi==4&&al[i-2].back().fi==4){
add(al[i][0].se,al[i-2].back().se,3);
if(al[i].size()>1){
add(al[i][0].se,al[i][1].se,1);
ntmp[1]=true;
}
}
else if(al[i].back().fi==4&&al[i-2][0].fi==4){
add(al[i].back().se,al[i-2][0].se,2);
if(al[i].size()>1){
add(al[i][0].se,al[i][1].se,1);
ntmp[0]=true;
}
}
else if(al[i-2].size()==3&&al[i].size()==1&&al[i][0].fi==4){
if(tmp[1])add(al[i-2][1].se,al[i][0].se,2);
else add(al[i-2][1].se,al[i][0].se,3);
}
else if(al[i-2].size()==1&&al[i-2][0].fi==4&&al[i].size()==3){
add(al[i-2][0].se,al[i][1].se,3);
add(al[i][0].se,al[i][1].se,0);
add(al[i][1].se,al[i][2].se,1);
ntmp[1]=true;
}
else{
rep(j,al[i].size()-1)if(al[i][j+1].fi-al[i][j].fi==2){
ll t=al[i][j].fi/2-1;
if(tmp[t]){
ntmp[t]=true;add(al[i][j].se,al[i][j+1].se,1);
}
else add(al[i][j].se,al[i][j+1].se,0);
}
}
}
tmp=ntmp;
}
build(u, v, a, b);
return 1;
}
for(auto x:edge){
u.pb(x.fi);v.pb(x.se);
P p((X[x.fi]+X[x.se])/2,(Y[x.fi]+Y[x.se])/2);
if(X[x.fi]==X[x.se]){
p.fi++;
if((p.fi+p.se)%4==2)p.fi-=2;
}
else{
p.se++;
if((p.fi+p.se)%4==0)p.se-=2;
}
a.pb(p.fi);b.pb(p.se);
}
build(u,v,a,b);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
559 ms |
42224 KB |
Output is correct |
24 |
Correct |
4 ms |
4948 KB |
Output is correct |
25 |
Correct |
6 ms |
5204 KB |
Output is correct |
26 |
Correct |
3 ms |
852 KB |
Output is correct |
27 |
Correct |
4 ms |
980 KB |
Output is correct |
28 |
Correct |
148 ms |
19856 KB |
Output is correct |
29 |
Correct |
337 ms |
26888 KB |
Output is correct |
30 |
Correct |
449 ms |
35396 KB |
Output is correct |
31 |
Correct |
592 ms |
42328 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
4 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
708 KB |
Output is correct |
45 |
Correct |
197 ms |
22580 KB |
Output is correct |
46 |
Correct |
357 ms |
30120 KB |
Output is correct |
47 |
Correct |
313 ms |
30844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
559 ms |
42224 KB |
Output is correct |
24 |
Correct |
4 ms |
4948 KB |
Output is correct |
25 |
Correct |
6 ms |
5204 KB |
Output is correct |
26 |
Correct |
3 ms |
852 KB |
Output is correct |
27 |
Correct |
4 ms |
980 KB |
Output is correct |
28 |
Correct |
148 ms |
19856 KB |
Output is correct |
29 |
Correct |
337 ms |
26888 KB |
Output is correct |
30 |
Correct |
449 ms |
35396 KB |
Output is correct |
31 |
Correct |
592 ms |
42328 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
4 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
708 KB |
Output is correct |
45 |
Correct |
197 ms |
22580 KB |
Output is correct |
46 |
Correct |
357 ms |
30120 KB |
Output is correct |
47 |
Correct |
313 ms |
30844 KB |
Output is correct |
48 |
Correct |
3 ms |
4948 KB |
Output is correct |
49 |
Correct |
3 ms |
4948 KB |
Output is correct |
50 |
Correct |
4 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
4948 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
3 ms |
4948 KB |
Output is correct |
55 |
Correct |
585 ms |
50008 KB |
Output is correct |
56 |
Correct |
3 ms |
4948 KB |
Output is correct |
57 |
Correct |
5 ms |
5332 KB |
Output is correct |
58 |
Correct |
11 ms |
6208 KB |
Output is correct |
59 |
Correct |
12 ms |
2036 KB |
Output is correct |
60 |
Correct |
253 ms |
26376 KB |
Output is correct |
61 |
Correct |
322 ms |
33624 KB |
Output is correct |
62 |
Correct |
428 ms |
39904 KB |
Output is correct |
63 |
Correct |
628 ms |
49000 KB |
Output is correct |
64 |
Correct |
0 ms |
212 KB |
Output is correct |
65 |
Correct |
3 ms |
4948 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
481 ms |
40148 KB |
Output is correct |
68 |
Correct |
463 ms |
40212 KB |
Output is correct |
69 |
Correct |
469 ms |
39908 KB |
Output is correct |
70 |
Correct |
3 ms |
852 KB |
Output is correct |
71 |
Correct |
7 ms |
1492 KB |
Output is correct |
72 |
Correct |
189 ms |
22432 KB |
Output is correct |
73 |
Correct |
350 ms |
31672 KB |
Output is correct |
74 |
Correct |
590 ms |
39924 KB |
Output is correct |
75 |
Correct |
556 ms |
43528 KB |
Output is correct |
76 |
Correct |
453 ms |
40016 KB |
Output is correct |
77 |
Correct |
6 ms |
980 KB |
Output is correct |
78 |
Correct |
9 ms |
1616 KB |
Output is correct |
79 |
Correct |
197 ms |
23348 KB |
Output is correct |
80 |
Correct |
442 ms |
32632 KB |
Output is correct |
81 |
Correct |
511 ms |
41320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4904 KB |
Output is correct |
19 |
Correct |
1 ms |
300 KB |
Output is correct |
20 |
Correct |
642 ms |
43116 KB |
Output is correct |
21 |
Correct |
557 ms |
41700 KB |
Output is correct |
22 |
Correct |
465 ms |
42240 KB |
Output is correct |
23 |
Correct |
401 ms |
36424 KB |
Output is correct |
24 |
Correct |
309 ms |
22268 KB |
Output is correct |
25 |
Correct |
408 ms |
31728 KB |
Output is correct |
26 |
Correct |
376 ms |
31600 KB |
Output is correct |
27 |
Correct |
505 ms |
40176 KB |
Output is correct |
28 |
Correct |
532 ms |
40272 KB |
Output is correct |
29 |
Correct |
563 ms |
39980 KB |
Output is correct |
30 |
Correct |
496 ms |
40036 KB |
Output is correct |
31 |
Correct |
3 ms |
4948 KB |
Output is correct |
32 |
Correct |
23 ms |
7544 KB |
Output is correct |
33 |
Correct |
95 ms |
11684 KB |
Output is correct |
34 |
Correct |
506 ms |
43364 KB |
Output is correct |
35 |
Correct |
11 ms |
1880 KB |
Output is correct |
36 |
Correct |
95 ms |
8520 KB |
Output is correct |
37 |
Correct |
164 ms |
16804 KB |
Output is correct |
38 |
Correct |
151 ms |
19828 KB |
Output is correct |
39 |
Correct |
261 ms |
25776 KB |
Output is correct |
40 |
Correct |
302 ms |
32208 KB |
Output is correct |
41 |
Correct |
383 ms |
37524 KB |
Output is correct |
42 |
Correct |
496 ms |
43008 KB |
Output is correct |
43 |
Correct |
3 ms |
4948 KB |
Output is correct |
44 |
Correct |
3 ms |
4948 KB |
Output is correct |
45 |
Correct |
3 ms |
4948 KB |
Output is correct |
46 |
Correct |
1 ms |
212 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
4 ms |
4948 KB |
Output is correct |
49 |
Correct |
3 ms |
4948 KB |
Output is correct |
50 |
Correct |
3 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
2 ms |
596 KB |
Output is correct |
55 |
Correct |
3 ms |
704 KB |
Output is correct |
56 |
Correct |
175 ms |
23412 KB |
Output is correct |
57 |
Correct |
413 ms |
31212 KB |
Output is correct |
58 |
Correct |
297 ms |
32132 KB |
Output is correct |
59 |
Correct |
0 ms |
212 KB |
Output is correct |
60 |
Correct |
3 ms |
4948 KB |
Output is correct |
61 |
Correct |
1 ms |
212 KB |
Output is correct |
62 |
Correct |
415 ms |
41692 KB |
Output is correct |
63 |
Correct |
452 ms |
41720 KB |
Output is correct |
64 |
Correct |
459 ms |
41584 KB |
Output is correct |
65 |
Correct |
3 ms |
852 KB |
Output is correct |
66 |
Correct |
7 ms |
1588 KB |
Output is correct |
67 |
Correct |
226 ms |
23200 KB |
Output is correct |
68 |
Correct |
318 ms |
33036 KB |
Output is correct |
69 |
Correct |
475 ms |
41572 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
17 |
Correct |
501 ms |
39144 KB |
Output is correct |
18 |
Correct |
504 ms |
41492 KB |
Output is correct |
19 |
Correct |
459 ms |
42444 KB |
Output is correct |
20 |
Correct |
546 ms |
42728 KB |
Output is correct |
21 |
Correct |
447 ms |
37908 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
63 ms |
11084 KB |
Output is correct |
24 |
Correct |
29 ms |
3684 KB |
Output is correct |
25 |
Correct |
120 ms |
12476 KB |
Output is correct |
26 |
Correct |
219 ms |
21140 KB |
Output is correct |
27 |
Correct |
251 ms |
24748 KB |
Output is correct |
28 |
Correct |
278 ms |
31320 KB |
Output is correct |
29 |
Correct |
352 ms |
35612 KB |
Output is correct |
30 |
Correct |
440 ms |
39352 KB |
Output is correct |
31 |
Correct |
542 ms |
45456 KB |
Output is correct |
32 |
Correct |
558 ms |
45176 KB |
Output is correct |
33 |
Correct |
418 ms |
41776 KB |
Output is correct |
34 |
Correct |
6 ms |
1108 KB |
Output is correct |
35 |
Correct |
9 ms |
1712 KB |
Output is correct |
36 |
Correct |
204 ms |
24152 KB |
Output is correct |
37 |
Correct |
403 ms |
33924 KB |
Output is correct |
38 |
Correct |
610 ms |
43056 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
5 ms |
4948 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
178 ms |
22564 KB |
Output is correct |
10 |
Correct |
13 ms |
6764 KB |
Output is correct |
11 |
Correct |
71 ms |
14420 KB |
Output is correct |
12 |
Correct |
23 ms |
7588 KB |
Output is correct |
13 |
Correct |
36 ms |
6812 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
2 ms |
468 KB |
Output is correct |
16 |
Correct |
163 ms |
22548 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
3 ms |
4948 KB |
Output is correct |
19 |
Correct |
3 ms |
4948 KB |
Output is correct |
20 |
Correct |
3 ms |
4948 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
3 ms |
4948 KB |
Output is correct |
23 |
Correct |
559 ms |
42224 KB |
Output is correct |
24 |
Correct |
4 ms |
4948 KB |
Output is correct |
25 |
Correct |
6 ms |
5204 KB |
Output is correct |
26 |
Correct |
3 ms |
852 KB |
Output is correct |
27 |
Correct |
4 ms |
980 KB |
Output is correct |
28 |
Correct |
148 ms |
19856 KB |
Output is correct |
29 |
Correct |
337 ms |
26888 KB |
Output is correct |
30 |
Correct |
449 ms |
35396 KB |
Output is correct |
31 |
Correct |
592 ms |
42328 KB |
Output is correct |
32 |
Correct |
3 ms |
4948 KB |
Output is correct |
33 |
Correct |
3 ms |
4948 KB |
Output is correct |
34 |
Correct |
3 ms |
4948 KB |
Output is correct |
35 |
Correct |
0 ms |
212 KB |
Output is correct |
36 |
Correct |
0 ms |
212 KB |
Output is correct |
37 |
Correct |
4 ms |
4948 KB |
Output is correct |
38 |
Correct |
3 ms |
4948 KB |
Output is correct |
39 |
Correct |
3 ms |
4948 KB |
Output is correct |
40 |
Correct |
3 ms |
4948 KB |
Output is correct |
41 |
Correct |
0 ms |
212 KB |
Output is correct |
42 |
Correct |
3 ms |
4948 KB |
Output is correct |
43 |
Correct |
3 ms |
596 KB |
Output is correct |
44 |
Correct |
3 ms |
708 KB |
Output is correct |
45 |
Correct |
197 ms |
22580 KB |
Output is correct |
46 |
Correct |
357 ms |
30120 KB |
Output is correct |
47 |
Correct |
313 ms |
30844 KB |
Output is correct |
48 |
Correct |
3 ms |
4948 KB |
Output is correct |
49 |
Correct |
3 ms |
4948 KB |
Output is correct |
50 |
Correct |
4 ms |
4948 KB |
Output is correct |
51 |
Correct |
3 ms |
4948 KB |
Output is correct |
52 |
Correct |
3 ms |
4948 KB |
Output is correct |
53 |
Correct |
3 ms |
4948 KB |
Output is correct |
54 |
Correct |
3 ms |
4948 KB |
Output is correct |
55 |
Correct |
585 ms |
50008 KB |
Output is correct |
56 |
Correct |
3 ms |
4948 KB |
Output is correct |
57 |
Correct |
5 ms |
5332 KB |
Output is correct |
58 |
Correct |
11 ms |
6208 KB |
Output is correct |
59 |
Correct |
12 ms |
2036 KB |
Output is correct |
60 |
Correct |
253 ms |
26376 KB |
Output is correct |
61 |
Correct |
322 ms |
33624 KB |
Output is correct |
62 |
Correct |
428 ms |
39904 KB |
Output is correct |
63 |
Correct |
628 ms |
49000 KB |
Output is correct |
64 |
Correct |
0 ms |
212 KB |
Output is correct |
65 |
Correct |
3 ms |
4948 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
481 ms |
40148 KB |
Output is correct |
68 |
Correct |
463 ms |
40212 KB |
Output is correct |
69 |
Correct |
469 ms |
39908 KB |
Output is correct |
70 |
Correct |
3 ms |
852 KB |
Output is correct |
71 |
Correct |
7 ms |
1492 KB |
Output is correct |
72 |
Correct |
189 ms |
22432 KB |
Output is correct |
73 |
Correct |
350 ms |
31672 KB |
Output is correct |
74 |
Correct |
590 ms |
39924 KB |
Output is correct |
75 |
Correct |
556 ms |
43528 KB |
Output is correct |
76 |
Correct |
453 ms |
40016 KB |
Output is correct |
77 |
Correct |
6 ms |
980 KB |
Output is correct |
78 |
Correct |
9 ms |
1616 KB |
Output is correct |
79 |
Correct |
197 ms |
23348 KB |
Output is correct |
80 |
Correct |
442 ms |
32632 KB |
Output is correct |
81 |
Correct |
511 ms |
41320 KB |
Output is correct |
82 |
Correct |
3 ms |
4948 KB |
Output is correct |
83 |
Correct |
3 ms |
4904 KB |
Output is correct |
84 |
Correct |
1 ms |
300 KB |
Output is correct |
85 |
Correct |
642 ms |
43116 KB |
Output is correct |
86 |
Correct |
557 ms |
41700 KB |
Output is correct |
87 |
Correct |
465 ms |
42240 KB |
Output is correct |
88 |
Correct |
401 ms |
36424 KB |
Output is correct |
89 |
Correct |
309 ms |
22268 KB |
Output is correct |
90 |
Correct |
408 ms |
31728 KB |
Output is correct |
91 |
Correct |
376 ms |
31600 KB |
Output is correct |
92 |
Correct |
505 ms |
40176 KB |
Output is correct |
93 |
Correct |
532 ms |
40272 KB |
Output is correct |
94 |
Correct |
563 ms |
39980 KB |
Output is correct |
95 |
Correct |
496 ms |
40036 KB |
Output is correct |
96 |
Correct |
3 ms |
4948 KB |
Output is correct |
97 |
Correct |
23 ms |
7544 KB |
Output is correct |
98 |
Correct |
95 ms |
11684 KB |
Output is correct |
99 |
Correct |
506 ms |
43364 KB |
Output is correct |
100 |
Correct |
11 ms |
1880 KB |
Output is correct |
101 |
Correct |
95 ms |
8520 KB |
Output is correct |
102 |
Correct |
164 ms |
16804 KB |
Output is correct |
103 |
Correct |
151 ms |
19828 KB |
Output is correct |
104 |
Correct |
261 ms |
25776 KB |
Output is correct |
105 |
Correct |
302 ms |
32208 KB |
Output is correct |
106 |
Correct |
383 ms |
37524 KB |
Output is correct |
107 |
Correct |
496 ms |
43008 KB |
Output is correct |
108 |
Correct |
3 ms |
4948 KB |
Output is correct |
109 |
Correct |
3 ms |
4948 KB |
Output is correct |
110 |
Correct |
3 ms |
4948 KB |
Output is correct |
111 |
Correct |
1 ms |
212 KB |
Output is correct |
112 |
Correct |
1 ms |
212 KB |
Output is correct |
113 |
Correct |
4 ms |
4948 KB |
Output is correct |
114 |
Correct |
3 ms |
4948 KB |
Output is correct |
115 |
Correct |
3 ms |
4948 KB |
Output is correct |
116 |
Correct |
3 ms |
4948 KB |
Output is correct |
117 |
Correct |
1 ms |
212 KB |
Output is correct |
118 |
Correct |
3 ms |
4948 KB |
Output is correct |
119 |
Correct |
2 ms |
596 KB |
Output is correct |
120 |
Correct |
3 ms |
704 KB |
Output is correct |
121 |
Correct |
175 ms |
23412 KB |
Output is correct |
122 |
Correct |
413 ms |
31212 KB |
Output is correct |
123 |
Correct |
297 ms |
32132 KB |
Output is correct |
124 |
Correct |
0 ms |
212 KB |
Output is correct |
125 |
Correct |
3 ms |
4948 KB |
Output is correct |
126 |
Correct |
1 ms |
212 KB |
Output is correct |
127 |
Correct |
415 ms |
41692 KB |
Output is correct |
128 |
Correct |
452 ms |
41720 KB |
Output is correct |
129 |
Correct |
459 ms |
41584 KB |
Output is correct |
130 |
Correct |
3 ms |
852 KB |
Output is correct |
131 |
Correct |
7 ms |
1588 KB |
Output is correct |
132 |
Correct |
226 ms |
23200 KB |
Output is correct |
133 |
Correct |
318 ms |
33036 KB |
Output is correct |
134 |
Correct |
475 ms |
41572 KB |
Output is correct |
135 |
Correct |
501 ms |
39144 KB |
Output is correct |
136 |
Correct |
504 ms |
41492 KB |
Output is correct |
137 |
Correct |
459 ms |
42444 KB |
Output is correct |
138 |
Correct |
546 ms |
42728 KB |
Output is correct |
139 |
Correct |
447 ms |
37908 KB |
Output is correct |
140 |
Correct |
3 ms |
4948 KB |
Output is correct |
141 |
Correct |
63 ms |
11084 KB |
Output is correct |
142 |
Correct |
29 ms |
3684 KB |
Output is correct |
143 |
Correct |
120 ms |
12476 KB |
Output is correct |
144 |
Correct |
219 ms |
21140 KB |
Output is correct |
145 |
Correct |
251 ms |
24748 KB |
Output is correct |
146 |
Correct |
278 ms |
31320 KB |
Output is correct |
147 |
Correct |
352 ms |
35612 KB |
Output is correct |
148 |
Correct |
440 ms |
39352 KB |
Output is correct |
149 |
Correct |
542 ms |
45456 KB |
Output is correct |
150 |
Correct |
558 ms |
45176 KB |
Output is correct |
151 |
Correct |
418 ms |
41776 KB |
Output is correct |
152 |
Correct |
6 ms |
1108 KB |
Output is correct |
153 |
Correct |
9 ms |
1712 KB |
Output is correct |
154 |
Correct |
204 ms |
24152 KB |
Output is correct |
155 |
Correct |
403 ms |
33924 KB |
Output is correct |
156 |
Correct |
610 ms |
43056 KB |
Output is correct |
157 |
Correct |
4 ms |
4948 KB |
Output is correct |
158 |
Correct |
1 ms |
212 KB |
Output is correct |
159 |
Incorrect |
3 ms |
4948 KB |
Tree @(199999, 3) appears more than once: for edges on positions 0 and 2 |
160 |
Halted |
0 ms |
0 KB |
- |