#include <bits/stdc++.h>
#include "parks.h"
using namespace std;
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define ll long long
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;
const int N=200007;
map<int,int>id[N];
map<int,int>id1[N];
vector<int>G[3*N];
bool odw[3*N];
int Pair[3*N];
int r[N];
int Find(int v)
{
if(r[v]==v) return v;
return r[v]=Find(r[v]);
}
int dx[4]={2,-2,0,0};
int dy[4]={0,0,2,-2};
void edge(int u,int v)
{
G[u].pb(v);
G[v].pb(u);
}
bool match(int v)
{
if(odw[v]) return 0;
odw[v]=1;
for(auto u:G[v])
{
if(!Pair[u]&&!odw[u])
{
Pair[u]=v;
Pair[v]=u;
return 1;
}
}
for(auto u:G[v])
{
if(!odw[u]&&match(Pair[u]))
{
Pair[u]=v;
Pair[v]=u;
return 1;
}
}
return 0;
}
vector<int>x,y,U,V,A,B;
vector<pair<int,int>>Q;
int cnt,it;
void Union(int u,int v)
{
r[Find(u)]=Find(v);
cnt++;
U.pb(u-1);
V.pb(v-1);
int X=min(x[u-1],x[v-1]),Y=min(y[u-1],y[v-1]);
if(x[u-1]==x[v-1])
{
if(id1[X+1][Y+1]==0)
{
id1[X+1][Y+1]=++it;
Q.pb({X+1,Y+1});
}
if(id1[X-1][Y+1]==0)
{
id1[X-1][Y+1]=++it;
Q.pb({X-1,Y+1});
}
edge(id1[X+1][Y+1],cnt);
edge(id1[X-1][Y+1],cnt);
}
else
{
if(id1[X+1][Y+1]==0)
{
id1[X+1][Y+1]=++it;
Q.pb({X+1,Y+1});
}
if(id1[X+1][Y-1]==0)
{
id1[X+1][Y-1]=++it;
Q.pb({X+1,Y-1});
}
edge(id1[X+1][Y+1],cnt);
edge(id1[X+1][Y-1],cnt);
}
}
/*void build(vector<int>u,vector<int>v,vector<int>a,vector<int>b)
{
for(int i=0;i<sz(u);i++)
{
cout<<u[i]<<" "<<v[i]<<" "<<a[i]<<" "<<b[i]<<endl;
}
}*/
int construct_roads(vector<int>xx,vector<int>yy)
{
x=xx;
y=yy;
int n=sz(x);
for(int i=0;i<n;i++)
{
id[x[i]][y[i]]=i+1;
r[i+1]=i+1;
}
it=n-1;
for(int i=0;i<n;i++)
{
for(int j=0;j<4;j++)
{
int nx=x[i]+dx[j],ny=y[i]+dy[j];
if(id[nx][ny]>0&&Find(id[nx][ny])!=Find(i+1))
{
int u=id[nx][ny],v=i+1,c=0;
int X=min(x[u-1],x[v-1]),Y=min(y[u-1],y[v-1]);
if(x[u-1]==x[v-1])
{
if(id[X-2][Y]>0&&id[X-2][Y+2]>0) c++;
if(id[X+2][Y]>0&&id[X+2][Y+2]>0) c++;
}
else
{
if(id[X][Y-2]>0&&id[X+2][Y-2]>0) c++;
if(id[X][Y+2]>0&&id[X+2][Y+2]>0) c++;
}
if(c==1) Union(u,v);
}
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<4;j++)
{
int nx=x[i]+dx[j],ny=y[i]+dy[j];
if(id[nx][ny]>0&&Find(id[nx][ny])!=Find(i+1))
{
Union(id[nx][ny],i+1);
}
}
}
if(cnt!=n-1) return 0;
while(true)
{
memset(odw,0,sizeof odw);
bool xd=0;
for(int i=1;i<=it;i++) if(!Pair[i]) xd|=match(i);
if(!xd) break;
}
for(int i=1;i<=n-1;i++)
{
if(Pair[i]==0) return 0;
A.pb(Q[Pair[i]-n].st);
B.pb(Q[Pair[i]-n].nd);
}
build(U,V,A,B);
return 1;
}
/*
int main()
{
construct_roads({2, 2, 4, 4}, {2, 4, 2, 4});
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
17 |
Correct |
16 ms |
33748 KB |
Output is correct |
18 |
Correct |
17 ms |
33728 KB |
Output is correct |
19 |
Correct |
17 ms |
33700 KB |
Output is correct |
20 |
Correct |
16 ms |
33724 KB |
Output is correct |
21 |
Correct |
17 ms |
33108 KB |
Output is correct |
22 |
Correct |
17 ms |
33696 KB |
Output is correct |
23 |
Correct |
2001 ms |
104844 KB |
Output is correct |
24 |
Correct |
17 ms |
33748 KB |
Output is correct |
25 |
Correct |
22 ms |
34164 KB |
Output is correct |
26 |
Correct |
30 ms |
33956 KB |
Output is correct |
27 |
Correct |
31 ms |
34312 KB |
Output is correct |
28 |
Correct |
623 ms |
62124 KB |
Output is correct |
29 |
Correct |
1104 ms |
76532 KB |
Output is correct |
30 |
Correct |
1521 ms |
90292 KB |
Output is correct |
31 |
Correct |
2052 ms |
104804 KB |
Output is correct |
32 |
Correct |
18 ms |
33748 KB |
Output is correct |
33 |
Correct |
19 ms |
33820 KB |
Output is correct |
34 |
Correct |
18 ms |
33688 KB |
Output is correct |
35 |
Correct |
16 ms |
33108 KB |
Output is correct |
36 |
Correct |
16 ms |
33184 KB |
Output is correct |
37 |
Correct |
16 ms |
33748 KB |
Output is correct |
38 |
Correct |
18 ms |
33788 KB |
Output is correct |
39 |
Correct |
16 ms |
33748 KB |
Output is correct |
40 |
Correct |
19 ms |
33748 KB |
Output is correct |
41 |
Correct |
17 ms |
33108 KB |
Output is correct |
42 |
Correct |
17 ms |
33748 KB |
Output is correct |
43 |
Correct |
23 ms |
33748 KB |
Output is correct |
44 |
Correct |
26 ms |
34004 KB |
Output is correct |
45 |
Correct |
847 ms |
70044 KB |
Output is correct |
46 |
Correct |
1272 ms |
86048 KB |
Output is correct |
47 |
Correct |
1361 ms |
85996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
17 |
Correct |
16 ms |
33748 KB |
Output is correct |
18 |
Correct |
17 ms |
33728 KB |
Output is correct |
19 |
Correct |
17 ms |
33700 KB |
Output is correct |
20 |
Correct |
16 ms |
33724 KB |
Output is correct |
21 |
Correct |
17 ms |
33108 KB |
Output is correct |
22 |
Correct |
17 ms |
33696 KB |
Output is correct |
23 |
Correct |
2001 ms |
104844 KB |
Output is correct |
24 |
Correct |
17 ms |
33748 KB |
Output is correct |
25 |
Correct |
22 ms |
34164 KB |
Output is correct |
26 |
Correct |
30 ms |
33956 KB |
Output is correct |
27 |
Correct |
31 ms |
34312 KB |
Output is correct |
28 |
Correct |
623 ms |
62124 KB |
Output is correct |
29 |
Correct |
1104 ms |
76532 KB |
Output is correct |
30 |
Correct |
1521 ms |
90292 KB |
Output is correct |
31 |
Correct |
2052 ms |
104804 KB |
Output is correct |
32 |
Correct |
18 ms |
33748 KB |
Output is correct |
33 |
Correct |
19 ms |
33820 KB |
Output is correct |
34 |
Correct |
18 ms |
33688 KB |
Output is correct |
35 |
Correct |
16 ms |
33108 KB |
Output is correct |
36 |
Correct |
16 ms |
33184 KB |
Output is correct |
37 |
Correct |
16 ms |
33748 KB |
Output is correct |
38 |
Correct |
18 ms |
33788 KB |
Output is correct |
39 |
Correct |
16 ms |
33748 KB |
Output is correct |
40 |
Correct |
19 ms |
33748 KB |
Output is correct |
41 |
Correct |
17 ms |
33108 KB |
Output is correct |
42 |
Correct |
17 ms |
33748 KB |
Output is correct |
43 |
Correct |
23 ms |
33748 KB |
Output is correct |
44 |
Correct |
26 ms |
34004 KB |
Output is correct |
45 |
Correct |
847 ms |
70044 KB |
Output is correct |
46 |
Correct |
1272 ms |
86048 KB |
Output is correct |
47 |
Correct |
1361 ms |
85996 KB |
Output is correct |
48 |
Correct |
17 ms |
33720 KB |
Output is correct |
49 |
Correct |
17 ms |
33748 KB |
Output is correct |
50 |
Correct |
19 ms |
33692 KB |
Output is correct |
51 |
Correct |
17 ms |
33740 KB |
Output is correct |
52 |
Correct |
17 ms |
33732 KB |
Output is correct |
53 |
Correct |
19 ms |
33760 KB |
Output is correct |
54 |
Correct |
16 ms |
33748 KB |
Output is correct |
55 |
Correct |
2029 ms |
98624 KB |
Output is correct |
56 |
Correct |
18 ms |
33748 KB |
Output is correct |
57 |
Correct |
22 ms |
34340 KB |
Output is correct |
58 |
Correct |
41 ms |
35728 KB |
Output is correct |
59 |
Correct |
60 ms |
35876 KB |
Output is correct |
60 |
Correct |
794 ms |
66944 KB |
Output is correct |
61 |
Correct |
1152 ms |
79104 KB |
Output is correct |
62 |
Correct |
1533 ms |
88352 KB |
Output is correct |
63 |
Correct |
2000 ms |
100436 KB |
Output is correct |
64 |
Correct |
17 ms |
33108 KB |
Output is correct |
65 |
Correct |
16 ms |
33696 KB |
Output is correct |
66 |
Correct |
16 ms |
33164 KB |
Output is correct |
67 |
Correct |
1743 ms |
120172 KB |
Output is correct |
68 |
Correct |
1868 ms |
120184 KB |
Output is correct |
69 |
Correct |
1803 ms |
119836 KB |
Output is correct |
70 |
Correct |
31 ms |
34312 KB |
Output is correct |
71 |
Correct |
48 ms |
35400 KB |
Output is correct |
72 |
Correct |
770 ms |
69296 KB |
Output is correct |
73 |
Correct |
1310 ms |
86896 KB |
Output is correct |
74 |
Correct |
1887 ms |
104860 KB |
Output is correct |
75 |
Correct |
1967 ms |
105456 KB |
Output is correct |
76 |
Correct |
1759 ms |
120272 KB |
Output is correct |
77 |
Correct |
33 ms |
34644 KB |
Output is correct |
78 |
Correct |
50 ms |
35768 KB |
Output is correct |
79 |
Correct |
780 ms |
68896 KB |
Output is correct |
80 |
Correct |
1389 ms |
86460 KB |
Output is correct |
81 |
Correct |
1888 ms |
104212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
17 |
Correct |
17 ms |
33784 KB |
Output is correct |
18 |
Correct |
16 ms |
33664 KB |
Output is correct |
19 |
Correct |
17 ms |
33096 KB |
Output is correct |
20 |
Correct |
863 ms |
112496 KB |
Output is correct |
21 |
Correct |
769 ms |
104256 KB |
Output is correct |
22 |
Correct |
873 ms |
104188 KB |
Output is correct |
23 |
Correct |
875 ms |
109612 KB |
Output is correct |
24 |
Correct |
668 ms |
66996 KB |
Output is correct |
25 |
Correct |
1337 ms |
99756 KB |
Output is correct |
26 |
Correct |
1434 ms |
99692 KB |
Output is correct |
27 |
Correct |
1483 ms |
113672 KB |
Output is correct |
28 |
Correct |
1329 ms |
113724 KB |
Output is correct |
29 |
Correct |
1401 ms |
113636 KB |
Output is correct |
30 |
Correct |
1311 ms |
113768 KB |
Output is correct |
31 |
Correct |
18 ms |
33708 KB |
Output is correct |
32 |
Correct |
66 ms |
38580 KB |
Output is correct |
33 |
Correct |
126 ms |
50008 KB |
Output is correct |
34 |
Correct |
665 ms |
112420 KB |
Output is correct |
35 |
Correct |
50 ms |
35660 KB |
Output is correct |
36 |
Correct |
190 ms |
45648 KB |
Output is correct |
37 |
Correct |
478 ms |
58068 KB |
Output is correct |
38 |
Correct |
422 ms |
58996 KB |
Output is correct |
39 |
Correct |
645 ms |
68528 KB |
Output is correct |
40 |
Correct |
965 ms |
78824 KB |
Output is correct |
41 |
Correct |
1235 ms |
87096 KB |
Output is correct |
42 |
Correct |
1483 ms |
97124 KB |
Output is correct |
43 |
Correct |
18 ms |
33748 KB |
Output is correct |
44 |
Correct |
20 ms |
33676 KB |
Output is correct |
45 |
Correct |
18 ms |
33668 KB |
Output is correct |
46 |
Correct |
20 ms |
33108 KB |
Output is correct |
47 |
Correct |
17 ms |
33108 KB |
Output is correct |
48 |
Correct |
17 ms |
33772 KB |
Output is correct |
49 |
Correct |
16 ms |
33748 KB |
Output is correct |
50 |
Correct |
16 ms |
33728 KB |
Output is correct |
51 |
Correct |
21 ms |
33748 KB |
Output is correct |
52 |
Correct |
17 ms |
33152 KB |
Output is correct |
53 |
Correct |
19 ms |
33708 KB |
Output is correct |
54 |
Correct |
23 ms |
33676 KB |
Output is correct |
55 |
Correct |
26 ms |
34016 KB |
Output is correct |
56 |
Correct |
828 ms |
70088 KB |
Output is correct |
57 |
Correct |
1365 ms |
86040 KB |
Output is correct |
58 |
Correct |
1311 ms |
86128 KB |
Output is correct |
59 |
Correct |
18 ms |
33108 KB |
Output is correct |
60 |
Correct |
17 ms |
33696 KB |
Output is correct |
61 |
Correct |
18 ms |
33128 KB |
Output is correct |
62 |
Correct |
1832 ms |
118564 KB |
Output is correct |
63 |
Correct |
1806 ms |
118520 KB |
Output is correct |
64 |
Correct |
1803 ms |
118064 KB |
Output is correct |
65 |
Correct |
30 ms |
34272 KB |
Output is correct |
66 |
Correct |
46 ms |
35352 KB |
Output is correct |
67 |
Correct |
743 ms |
68476 KB |
Output is correct |
68 |
Correct |
1321 ms |
85660 KB |
Output is correct |
69 |
Correct |
1923 ms |
103512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
17 |
Correct |
1221 ms |
123676 KB |
Output is correct |
18 |
Correct |
1178 ms |
123740 KB |
Output is correct |
19 |
Correct |
950 ms |
107572 KB |
Output is correct |
20 |
Correct |
1469 ms |
92340 KB |
Output is correct |
21 |
Correct |
1331 ms |
101220 KB |
Output is correct |
22 |
Correct |
16 ms |
33748 KB |
Output is correct |
23 |
Correct |
137 ms |
44216 KB |
Output is correct |
24 |
Correct |
75 ms |
38068 KB |
Output is correct |
25 |
Correct |
304 ms |
50368 KB |
Output is correct |
26 |
Correct |
624 ms |
62652 KB |
Output is correct |
27 |
Correct |
629 ms |
65072 KB |
Output is correct |
28 |
Correct |
822 ms |
72932 KB |
Output is correct |
29 |
Correct |
1106 ms |
80272 KB |
Output is correct |
30 |
Correct |
1229 ms |
88396 KB |
Output is correct |
31 |
Correct |
1468 ms |
96232 KB |
Output is correct |
32 |
Correct |
1855 ms |
103940 KB |
Output is correct |
33 |
Correct |
1727 ms |
118460 KB |
Output is correct |
34 |
Correct |
34 ms |
34500 KB |
Output is correct |
35 |
Correct |
53 ms |
35792 KB |
Output is correct |
36 |
Correct |
794 ms |
68168 KB |
Output is correct |
37 |
Correct |
1292 ms |
85364 KB |
Output is correct |
38 |
Correct |
1792 ms |
102764 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
33696 KB |
Output is correct |
2 |
Correct |
16 ms |
33748 KB |
Output is correct |
3 |
Correct |
15 ms |
33108 KB |
Output is correct |
4 |
Correct |
15 ms |
33656 KB |
Output is correct |
5 |
Correct |
16 ms |
33760 KB |
Output is correct |
6 |
Correct |
17 ms |
33108 KB |
Output is correct |
7 |
Correct |
16 ms |
33156 KB |
Output is correct |
8 |
Correct |
17 ms |
33108 KB |
Output is correct |
9 |
Correct |
723 ms |
78464 KB |
Output is correct |
10 |
Correct |
43 ms |
38340 KB |
Output is correct |
11 |
Correct |
201 ms |
57752 KB |
Output is correct |
12 |
Correct |
58 ms |
40520 KB |
Output is correct |
13 |
Correct |
152 ms |
49952 KB |
Output is correct |
14 |
Correct |
22 ms |
33532 KB |
Output is correct |
15 |
Correct |
27 ms |
33932 KB |
Output is correct |
16 |
Correct |
702 ms |
78644 KB |
Output is correct |
17 |
Correct |
16 ms |
33748 KB |
Output is correct |
18 |
Correct |
17 ms |
33728 KB |
Output is correct |
19 |
Correct |
17 ms |
33700 KB |
Output is correct |
20 |
Correct |
16 ms |
33724 KB |
Output is correct |
21 |
Correct |
17 ms |
33108 KB |
Output is correct |
22 |
Correct |
17 ms |
33696 KB |
Output is correct |
23 |
Correct |
2001 ms |
104844 KB |
Output is correct |
24 |
Correct |
17 ms |
33748 KB |
Output is correct |
25 |
Correct |
22 ms |
34164 KB |
Output is correct |
26 |
Correct |
30 ms |
33956 KB |
Output is correct |
27 |
Correct |
31 ms |
34312 KB |
Output is correct |
28 |
Correct |
623 ms |
62124 KB |
Output is correct |
29 |
Correct |
1104 ms |
76532 KB |
Output is correct |
30 |
Correct |
1521 ms |
90292 KB |
Output is correct |
31 |
Correct |
2052 ms |
104804 KB |
Output is correct |
32 |
Correct |
18 ms |
33748 KB |
Output is correct |
33 |
Correct |
19 ms |
33820 KB |
Output is correct |
34 |
Correct |
18 ms |
33688 KB |
Output is correct |
35 |
Correct |
16 ms |
33108 KB |
Output is correct |
36 |
Correct |
16 ms |
33184 KB |
Output is correct |
37 |
Correct |
16 ms |
33748 KB |
Output is correct |
38 |
Correct |
18 ms |
33788 KB |
Output is correct |
39 |
Correct |
16 ms |
33748 KB |
Output is correct |
40 |
Correct |
19 ms |
33748 KB |
Output is correct |
41 |
Correct |
17 ms |
33108 KB |
Output is correct |
42 |
Correct |
17 ms |
33748 KB |
Output is correct |
43 |
Correct |
23 ms |
33748 KB |
Output is correct |
44 |
Correct |
26 ms |
34004 KB |
Output is correct |
45 |
Correct |
847 ms |
70044 KB |
Output is correct |
46 |
Correct |
1272 ms |
86048 KB |
Output is correct |
47 |
Correct |
1361 ms |
85996 KB |
Output is correct |
48 |
Correct |
17 ms |
33720 KB |
Output is correct |
49 |
Correct |
17 ms |
33748 KB |
Output is correct |
50 |
Correct |
19 ms |
33692 KB |
Output is correct |
51 |
Correct |
17 ms |
33740 KB |
Output is correct |
52 |
Correct |
17 ms |
33732 KB |
Output is correct |
53 |
Correct |
19 ms |
33760 KB |
Output is correct |
54 |
Correct |
16 ms |
33748 KB |
Output is correct |
55 |
Correct |
2029 ms |
98624 KB |
Output is correct |
56 |
Correct |
18 ms |
33748 KB |
Output is correct |
57 |
Correct |
22 ms |
34340 KB |
Output is correct |
58 |
Correct |
41 ms |
35728 KB |
Output is correct |
59 |
Correct |
60 ms |
35876 KB |
Output is correct |
60 |
Correct |
794 ms |
66944 KB |
Output is correct |
61 |
Correct |
1152 ms |
79104 KB |
Output is correct |
62 |
Correct |
1533 ms |
88352 KB |
Output is correct |
63 |
Correct |
2000 ms |
100436 KB |
Output is correct |
64 |
Correct |
17 ms |
33108 KB |
Output is correct |
65 |
Correct |
16 ms |
33696 KB |
Output is correct |
66 |
Correct |
16 ms |
33164 KB |
Output is correct |
67 |
Correct |
1743 ms |
120172 KB |
Output is correct |
68 |
Correct |
1868 ms |
120184 KB |
Output is correct |
69 |
Correct |
1803 ms |
119836 KB |
Output is correct |
70 |
Correct |
31 ms |
34312 KB |
Output is correct |
71 |
Correct |
48 ms |
35400 KB |
Output is correct |
72 |
Correct |
770 ms |
69296 KB |
Output is correct |
73 |
Correct |
1310 ms |
86896 KB |
Output is correct |
74 |
Correct |
1887 ms |
104860 KB |
Output is correct |
75 |
Correct |
1967 ms |
105456 KB |
Output is correct |
76 |
Correct |
1759 ms |
120272 KB |
Output is correct |
77 |
Correct |
33 ms |
34644 KB |
Output is correct |
78 |
Correct |
50 ms |
35768 KB |
Output is correct |
79 |
Correct |
780 ms |
68896 KB |
Output is correct |
80 |
Correct |
1389 ms |
86460 KB |
Output is correct |
81 |
Correct |
1888 ms |
104212 KB |
Output is correct |
82 |
Correct |
17 ms |
33784 KB |
Output is correct |
83 |
Correct |
16 ms |
33664 KB |
Output is correct |
84 |
Correct |
17 ms |
33096 KB |
Output is correct |
85 |
Correct |
863 ms |
112496 KB |
Output is correct |
86 |
Correct |
769 ms |
104256 KB |
Output is correct |
87 |
Correct |
873 ms |
104188 KB |
Output is correct |
88 |
Correct |
875 ms |
109612 KB |
Output is correct |
89 |
Correct |
668 ms |
66996 KB |
Output is correct |
90 |
Correct |
1337 ms |
99756 KB |
Output is correct |
91 |
Correct |
1434 ms |
99692 KB |
Output is correct |
92 |
Correct |
1483 ms |
113672 KB |
Output is correct |
93 |
Correct |
1329 ms |
113724 KB |
Output is correct |
94 |
Correct |
1401 ms |
113636 KB |
Output is correct |
95 |
Correct |
1311 ms |
113768 KB |
Output is correct |
96 |
Correct |
18 ms |
33708 KB |
Output is correct |
97 |
Correct |
66 ms |
38580 KB |
Output is correct |
98 |
Correct |
126 ms |
50008 KB |
Output is correct |
99 |
Correct |
665 ms |
112420 KB |
Output is correct |
100 |
Correct |
50 ms |
35660 KB |
Output is correct |
101 |
Correct |
190 ms |
45648 KB |
Output is correct |
102 |
Correct |
478 ms |
58068 KB |
Output is correct |
103 |
Correct |
422 ms |
58996 KB |
Output is correct |
104 |
Correct |
645 ms |
68528 KB |
Output is correct |
105 |
Correct |
965 ms |
78824 KB |
Output is correct |
106 |
Correct |
1235 ms |
87096 KB |
Output is correct |
107 |
Correct |
1483 ms |
97124 KB |
Output is correct |
108 |
Correct |
18 ms |
33748 KB |
Output is correct |
109 |
Correct |
20 ms |
33676 KB |
Output is correct |
110 |
Correct |
18 ms |
33668 KB |
Output is correct |
111 |
Correct |
20 ms |
33108 KB |
Output is correct |
112 |
Correct |
17 ms |
33108 KB |
Output is correct |
113 |
Correct |
17 ms |
33772 KB |
Output is correct |
114 |
Correct |
16 ms |
33748 KB |
Output is correct |
115 |
Correct |
16 ms |
33728 KB |
Output is correct |
116 |
Correct |
21 ms |
33748 KB |
Output is correct |
117 |
Correct |
17 ms |
33152 KB |
Output is correct |
118 |
Correct |
19 ms |
33708 KB |
Output is correct |
119 |
Correct |
23 ms |
33676 KB |
Output is correct |
120 |
Correct |
26 ms |
34016 KB |
Output is correct |
121 |
Correct |
828 ms |
70088 KB |
Output is correct |
122 |
Correct |
1365 ms |
86040 KB |
Output is correct |
123 |
Correct |
1311 ms |
86128 KB |
Output is correct |
124 |
Correct |
18 ms |
33108 KB |
Output is correct |
125 |
Correct |
17 ms |
33696 KB |
Output is correct |
126 |
Correct |
18 ms |
33128 KB |
Output is correct |
127 |
Correct |
1832 ms |
118564 KB |
Output is correct |
128 |
Correct |
1806 ms |
118520 KB |
Output is correct |
129 |
Correct |
1803 ms |
118064 KB |
Output is correct |
130 |
Correct |
30 ms |
34272 KB |
Output is correct |
131 |
Correct |
46 ms |
35352 KB |
Output is correct |
132 |
Correct |
743 ms |
68476 KB |
Output is correct |
133 |
Correct |
1321 ms |
85660 KB |
Output is correct |
134 |
Correct |
1923 ms |
103512 KB |
Output is correct |
135 |
Correct |
1221 ms |
123676 KB |
Output is correct |
136 |
Correct |
1178 ms |
123740 KB |
Output is correct |
137 |
Correct |
950 ms |
107572 KB |
Output is correct |
138 |
Correct |
1469 ms |
92340 KB |
Output is correct |
139 |
Correct |
1331 ms |
101220 KB |
Output is correct |
140 |
Correct |
16 ms |
33748 KB |
Output is correct |
141 |
Correct |
137 ms |
44216 KB |
Output is correct |
142 |
Correct |
75 ms |
38068 KB |
Output is correct |
143 |
Correct |
304 ms |
50368 KB |
Output is correct |
144 |
Correct |
624 ms |
62652 KB |
Output is correct |
145 |
Correct |
629 ms |
65072 KB |
Output is correct |
146 |
Correct |
822 ms |
72932 KB |
Output is correct |
147 |
Correct |
1106 ms |
80272 KB |
Output is correct |
148 |
Correct |
1229 ms |
88396 KB |
Output is correct |
149 |
Correct |
1468 ms |
96232 KB |
Output is correct |
150 |
Correct |
1855 ms |
103940 KB |
Output is correct |
151 |
Correct |
1727 ms |
118460 KB |
Output is correct |
152 |
Correct |
34 ms |
34500 KB |
Output is correct |
153 |
Correct |
53 ms |
35792 KB |
Output is correct |
154 |
Correct |
794 ms |
68168 KB |
Output is correct |
155 |
Correct |
1292 ms |
85364 KB |
Output is correct |
156 |
Correct |
1792 ms |
102764 KB |
Output is correct |
157 |
Correct |
17 ms |
33740 KB |
Output is correct |
158 |
Correct |
16 ms |
33184 KB |
Output is correct |
159 |
Correct |
16 ms |
33696 KB |
Output is correct |
160 |
Correct |
19 ms |
33696 KB |
Output is correct |
161 |
Incorrect |
1352 ms |
75888 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |