#include "parks.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
typedef pair<int,int> pii;
map<pii,int> ind;
map<pii,int> ocup;
map<pii,int> match;
struct point
{
int x,y;
} v[200005];
int k;
vector<int> myy[200005];
vector<int> muchii[200005];
vector<pii> edges;
bool have[11][200005];
bool use[200005];
void dfs(int nod)
{
use[nod]=1;
for(int i:muchii[nod])
if(!use[i])
dfs(i);
}
int c[11][200005];
vector<int> U,V,A,B;
void addedge(int xa,int ya,int xb,int yb,int xc,int yc)
{
int a=ind[{xa,ya}];
int b=ind[{xb,yb}];
U.push_back(a);
V.push_back(b);
muchii[a].push_back(b);
muchii[b].push_back(a);
A.push_back(xc);
B.push_back(yc);
}
int diri[5]={-2,2,0,0};
int dirj[5]={0,0,-2,2};
int nr;
vector<int> cedge[800005];
int l[800005],r[800005];
vector<pii> who;
bool pairup(int nod)
{
if(use[nod])
return 0;
use[nod]=1;
for(int i:cedge[nod])
if(r[i]==0)
{
l[nod]=i;
r[i]=nod;
return 1;
}
for(int i:cedge[nod])
if(pairup(r[i]))
{
l[nod]=i;
r[i]=nod;
return 1;
}
return 0;
}
int comp[700005];
vector<int> dsu[700005];
void dsu_merge(int c1,int c2)
{
if(dsu[c1].size()<dsu[c2].size())
swap(c1,c2);
for(int i:dsu[c2])
{
comp[i]=c1;
dsu[c1].push_back(i);
}
dsu[c2].clear();
}
int construct_roads(std::vector<int> X, std::vector<int> Y)
{
k=X.size();
int xmax=0;
for(int i=0;i<k;i++)
{
v[i]={X[i],Y[i]};
ind[{X[i],Y[i]}]=i;
xmax=max(xmax,X[i]);
if(X[i]<=6)
{
myy[X[i]].push_back(Y[i]);
have[X[i]][Y[i]]=1;
}
}
if(xmax<=2)
{
sort(myy[2].begin(),myy[2].end());
vector<int> U,V,a,b;
for(int i=1;i<myy[2].size();i++)
{
if(myy[2][i]-myy[2][i-1]!=2)
return 0;
int x=2;
int yu=myy[2][i-1];
int yv=myy[2][i];
U.push_back(ind[{x,yu}]);
V.push_back(ind[{x,yv}]);
a.push_back(x-1);
b.push_back(yv-1);
}
build(U,V,a,b);
return 1;
}
if(xmax<=4)
{
sort(myy[2].begin(),myy[2].end());
sort(myy[4].begin(),myy[4].end());
vector<int> U,V,A,B;
for(int i=2;i<=200000;i+=2)
if(have[2][i]&&have[2][i-2])
{
int a=ind[{2,i}];
int b=ind[{2,i-2}];
U.push_back(a);
V.push_back(b);
muchii[a].push_back(b);
muchii[b].push_back(a);
A.push_back(1);
B.push_back(i-1);
}
for(int i=2;i<=200000;i+=2)
if(have[4][i]&&have[4][i-2])
{
int a=ind[{4,i}];
int b=ind[{4,i-2}];
U.push_back(a);
V.push_back(b);
muchii[a].push_back(b);
muchii[b].push_back(a);
A.push_back(5);
B.push_back(i-1);
}
for(int i=2;i<=200000;i+=2)
if(have[2][i]&&have[4][i])
{
int a=ind[{2,i}];
int b=ind[{4,i}];
U.push_back(a);
V.push_back(b);
muchii[a].push_back(b);
muchii[b].push_back(a);
A.push_back(3);
B.push_back(i+1);
}
dfs(0);
for(int i=0;i<k;i++)
if(!use[i])
return 0;
build(U,V,A,B);
return 1;
}
if(xmax<=6)
{
sort(myy[2].begin(),myy[2].end());
sort(myy[4].begin(),myy[4].end());
sort(myy[6].begin(),myy[6].end());
int nr=0;
for(int i=2;i<=200000;i+=2)
if(have[2][i])
{
if(have[2][i-2])
{
addedge(2,i,2,i-2,1,i-1);
c[2][i]=c[2][i-2];
}
else
{
nr++;
c[2][i]=nr;
}
}
for(int i=2;i<=200000;i+=2)
if(have[6][i])
{
if(have[6][i-2])
{
addedge(6,i,6,i-2,7,i-1);
c[6][i]=c[6][i-2];
}
else
{
nr++;
c[6][i]=nr;
}
}
int lft=1;
for(int i=2;i<=200000;i+=2)
if(have[4][i])
{
if(have[4][i-2])
{
if(lft==1)
{
addedge(4,i,4,i-2,3,i-1);
ocup[{3,i-1}]=1;
}
else
{
addedge(4,i,4,i-2,5,i-1);
ocup[{5,i-1}]=1;
}
lft^=1;
c[4][i]=c[4][i-2];
}
else
{
lft=1;
nr++;
c[4][i]=nr;
}
}
for(int i=2;i<=200000;i+=2)
if(have[2][i]&&have[4][i])
{
int a=c[2][i];
int b=c[4][i];
if(match[{a,b}]==0)
{
match[{a,b}]=1;
if(!ocup[{3,i-1}])
{
addedge(2,i,4,i,3,i-1);
ocup[{3,i-1}]=1;
}
else
{
addedge(2,i,4,i,3,i+1);
ocup[{3,i+1}]=1;
}
}
}
for(int i=2;i<=200000;i+=2)
if(have[4][i]&&have[6][i])
{
int a=c[4][i];
int b=c[6][i];
if(match[{a,b}]==0)
{
match[{a,b}]=1;
if(!ocup[{5,i-1}])
{
addedge(4,i,6,i,5,i-1);
ocup[{5,i-1}]=1;
}
else
{
addedge(4,i,6,i,5,i+1);
ocup[{5,i+1}]=1;
}
}
}
dfs(0);
for(int i=0;i<k;i++)
if(!use[i])
return 0;
build(U,V,A,B);
return 1;
}
vector<int> nodes;
for(int i=0;i<k;i++)
nodes.push_back(i);
for(int i=0;i<k;i++)
{
comp[i]=i;
dsu[i].push_back(i);
}
for(auto p:nodes)
{
int nod=p;
int x=X[nod];
int y=Y[nod];
for(int z=0;z<4;z++)
{
int lin=x+diri[z];
int col=y+dirj[z];
if(ind.count({lin,col})!=0)
{
int w=ind[{lin,col}];
if(comp[nod]!=comp[w])
{
dsu_merge(comp[nod],comp[w]);
muchii[nod].push_back(w);
muchii[w].push_back(nod);
edges.push_back({nod,w});
}
}
}
}
dfs(0);
for(int i=0;i<k;i++)
if(!use[i])
return 0;
nr=0;
who.push_back({0,0});
for(int i=0;i<edges.size();i++)
{
int a=edges[i].first;
int b=edges[i].second;
int xa=X[a],ya=Y[a],xb=X[b],yb=Y[b];
if(xa==xb)
{
int x=xa+1;
int y=(ya+yb)/2;
if(ind[{x,y}]==0)
{
nr++;
ind[{x,y}]=nr;
who.push_back({x,y});
}
int nrm=ind[{x,y}];
cedge[i+1].push_back(nrm);
x=xa-1;
y=(ya+yb)/2;
if(ind[{x,y}]==0)
{
nr++;
ind[{x,y}]=nr;
who.push_back({x,y});
}
nrm=ind[{x,y}];
cedge[i+1].push_back(nrm);
}
else
{
int x=(xa+xb)/2;
int y=ya-1;
if(ind[{x,y}]==0)
{
nr++;
ind[{x,y}]=nr;
who.push_back({x,y});
}
int nrm=ind[{x,y}];
cedge[i+1].push_back(nrm);
x=(xa+xb)/2;
y=ya+1;
if(ind[{x,y}]==0)
{
nr++;
ind[{x,y}]=nr;
who.push_back({x,y});
}
nrm=ind[{x,y}];
cedge[i+1].push_back(nrm);
}
}
bool ok=0;
do
{
ok=0;
for(int i=1;i<=edges.size();i++)
use[i]=0;
for(int i=1;i<=edges.size();i++)
if(l[i]==0)
ok|=pairup(i);
}while(ok);
for(int i=1;i<=edges.size();i++)
if(l[i]==0)
return 0;
for(int i=1;i<=edges.size();i++)
{
U.push_back(edges[i-1].first);
V.push_back(edges[i-1].second);
A.push_back(who[l[i]].first);
B.push_back(who[l[i]].second);
}
build(U,V,A,B);
return 1;
}
Compilation message
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:99:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
99 | for(int i=1;i<myy[2].size();i++)
| ~^~~~~~~~~~~~~~
parks.cpp:305:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
305 | for(int i=0;i<edges.size();i++)
| ~^~~~~~~~~~~~~
parks.cpp:363:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
363 | for(int i=1;i<=edges.size();i++)
| ~^~~~~~~~~~~~~~
parks.cpp:365:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
365 | for(int i=1;i<=edges.size();i++)
| ~^~~~~~~~~~~~~~
parks.cpp:369:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
369 | for(int i=1;i<=edges.size();i++)
| ~^~~~~~~~~~~~~~
parks.cpp:372:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
372 | for(int i=1;i<=edges.size();i++)
| ~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
17 |
Correct |
26 ms |
44984 KB |
Output is correct |
18 |
Correct |
23 ms |
44860 KB |
Output is correct |
19 |
Correct |
23 ms |
44880 KB |
Output is correct |
20 |
Correct |
22 ms |
44832 KB |
Output is correct |
21 |
Correct |
22 ms |
44956 KB |
Output is correct |
22 |
Correct |
22 ms |
44884 KB |
Output is correct |
23 |
Correct |
319 ms |
87288 KB |
Output is correct |
24 |
Correct |
28 ms |
44884 KB |
Output is correct |
25 |
Correct |
24 ms |
45212 KB |
Output is correct |
26 |
Correct |
29 ms |
45396 KB |
Output is correct |
27 |
Correct |
26 ms |
45524 KB |
Output is correct |
28 |
Correct |
120 ms |
61952 KB |
Output is correct |
29 |
Correct |
182 ms |
70312 KB |
Output is correct |
30 |
Correct |
255 ms |
78896 KB |
Output is correct |
31 |
Correct |
343 ms |
87344 KB |
Output is correct |
32 |
Correct |
19 ms |
44836 KB |
Output is correct |
33 |
Correct |
19 ms |
44884 KB |
Output is correct |
34 |
Correct |
21 ms |
44956 KB |
Output is correct |
35 |
Correct |
19 ms |
44884 KB |
Output is correct |
36 |
Correct |
18 ms |
44884 KB |
Output is correct |
37 |
Correct |
19 ms |
44884 KB |
Output is correct |
38 |
Correct |
18 ms |
44876 KB |
Output is correct |
39 |
Correct |
21 ms |
44876 KB |
Output is correct |
40 |
Correct |
18 ms |
44884 KB |
Output is correct |
41 |
Correct |
19 ms |
44936 KB |
Output is correct |
42 |
Correct |
27 ms |
44880 KB |
Output is correct |
43 |
Correct |
22 ms |
45140 KB |
Output is correct |
44 |
Correct |
29 ms |
45356 KB |
Output is correct |
45 |
Correct |
143 ms |
63212 KB |
Output is correct |
46 |
Correct |
220 ms |
71704 KB |
Output is correct |
47 |
Correct |
188 ms |
71692 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
17 |
Correct |
26 ms |
44984 KB |
Output is correct |
18 |
Correct |
23 ms |
44860 KB |
Output is correct |
19 |
Correct |
23 ms |
44880 KB |
Output is correct |
20 |
Correct |
22 ms |
44832 KB |
Output is correct |
21 |
Correct |
22 ms |
44956 KB |
Output is correct |
22 |
Correct |
22 ms |
44884 KB |
Output is correct |
23 |
Correct |
319 ms |
87288 KB |
Output is correct |
24 |
Correct |
28 ms |
44884 KB |
Output is correct |
25 |
Correct |
24 ms |
45212 KB |
Output is correct |
26 |
Correct |
29 ms |
45396 KB |
Output is correct |
27 |
Correct |
26 ms |
45524 KB |
Output is correct |
28 |
Correct |
120 ms |
61952 KB |
Output is correct |
29 |
Correct |
182 ms |
70312 KB |
Output is correct |
30 |
Correct |
255 ms |
78896 KB |
Output is correct |
31 |
Correct |
343 ms |
87344 KB |
Output is correct |
32 |
Correct |
19 ms |
44836 KB |
Output is correct |
33 |
Correct |
19 ms |
44884 KB |
Output is correct |
34 |
Correct |
21 ms |
44956 KB |
Output is correct |
35 |
Correct |
19 ms |
44884 KB |
Output is correct |
36 |
Correct |
18 ms |
44884 KB |
Output is correct |
37 |
Correct |
19 ms |
44884 KB |
Output is correct |
38 |
Correct |
18 ms |
44876 KB |
Output is correct |
39 |
Correct |
21 ms |
44876 KB |
Output is correct |
40 |
Correct |
18 ms |
44884 KB |
Output is correct |
41 |
Correct |
19 ms |
44936 KB |
Output is correct |
42 |
Correct |
27 ms |
44880 KB |
Output is correct |
43 |
Correct |
22 ms |
45140 KB |
Output is correct |
44 |
Correct |
29 ms |
45356 KB |
Output is correct |
45 |
Correct |
143 ms |
63212 KB |
Output is correct |
46 |
Correct |
220 ms |
71704 KB |
Output is correct |
47 |
Correct |
188 ms |
71692 KB |
Output is correct |
48 |
Correct |
23 ms |
44888 KB |
Output is correct |
49 |
Correct |
22 ms |
44884 KB |
Output is correct |
50 |
Correct |
24 ms |
44996 KB |
Output is correct |
51 |
Correct |
21 ms |
44932 KB |
Output is correct |
52 |
Correct |
22 ms |
44876 KB |
Output is correct |
53 |
Correct |
25 ms |
44920 KB |
Output is correct |
54 |
Correct |
21 ms |
44884 KB |
Output is correct |
55 |
Correct |
318 ms |
86912 KB |
Output is correct |
56 |
Correct |
22 ms |
44884 KB |
Output is correct |
57 |
Correct |
25 ms |
45352 KB |
Output is correct |
58 |
Correct |
29 ms |
46360 KB |
Output is correct |
59 |
Correct |
28 ms |
46804 KB |
Output is correct |
60 |
Correct |
144 ms |
65592 KB |
Output is correct |
61 |
Correct |
199 ms |
74204 KB |
Output is correct |
62 |
Correct |
258 ms |
79600 KB |
Output is correct |
63 |
Correct |
310 ms |
86552 KB |
Output is correct |
64 |
Correct |
22 ms |
44864 KB |
Output is correct |
65 |
Correct |
22 ms |
44884 KB |
Output is correct |
66 |
Correct |
26 ms |
44848 KB |
Output is correct |
67 |
Correct |
290 ms |
83292 KB |
Output is correct |
68 |
Correct |
314 ms |
83232 KB |
Output is correct |
69 |
Correct |
262 ms |
83504 KB |
Output is correct |
70 |
Correct |
31 ms |
45752 KB |
Output is correct |
71 |
Correct |
34 ms |
46724 KB |
Output is correct |
72 |
Correct |
185 ms |
69260 KB |
Output is correct |
73 |
Correct |
276 ms |
81960 KB |
Output is correct |
74 |
Correct |
407 ms |
93736 KB |
Output is correct |
75 |
Correct |
413 ms |
95808 KB |
Output is correct |
76 |
Correct |
318 ms |
84212 KB |
Output is correct |
77 |
Correct |
30 ms |
46036 KB |
Output is correct |
78 |
Correct |
31 ms |
46932 KB |
Output is correct |
79 |
Correct |
185 ms |
70228 KB |
Output is correct |
80 |
Correct |
292 ms |
82948 KB |
Output is correct |
81 |
Correct |
363 ms |
95624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
17 |
Correct |
21 ms |
44928 KB |
Output is correct |
18 |
Correct |
23 ms |
44856 KB |
Output is correct |
19 |
Correct |
21 ms |
44880 KB |
Output is correct |
20 |
Correct |
878 ms |
121944 KB |
Output is correct |
21 |
Correct |
1012 ms |
121036 KB |
Output is correct |
22 |
Correct |
973 ms |
120792 KB |
Output is correct |
23 |
Correct |
791 ms |
122208 KB |
Output is correct |
24 |
Correct |
318 ms |
70032 KB |
Output is correct |
25 |
Correct |
657 ms |
81088 KB |
Output is correct |
26 |
Correct |
577 ms |
80908 KB |
Output is correct |
27 |
Correct |
982 ms |
130668 KB |
Output is correct |
28 |
Correct |
915 ms |
130536 KB |
Output is correct |
29 |
Correct |
958 ms |
130428 KB |
Output is correct |
30 |
Correct |
965 ms |
130352 KB |
Output is correct |
31 |
Correct |
27 ms |
44860 KB |
Output is correct |
32 |
Correct |
64 ms |
50548 KB |
Output is correct |
33 |
Correct |
117 ms |
57464 KB |
Output is correct |
34 |
Correct |
871 ms |
121392 KB |
Output is correct |
35 |
Correct |
35 ms |
46668 KB |
Output is correct |
36 |
Correct |
103 ms |
54000 KB |
Output is correct |
37 |
Correct |
224 ms |
63244 KB |
Output is correct |
38 |
Correct |
271 ms |
75000 KB |
Output is correct |
39 |
Correct |
411 ms |
85824 KB |
Output is correct |
40 |
Correct |
548 ms |
98044 KB |
Output is correct |
41 |
Correct |
724 ms |
109008 KB |
Output is correct |
42 |
Correct |
900 ms |
119728 KB |
Output is correct |
43 |
Correct |
23 ms |
44884 KB |
Output is correct |
44 |
Correct |
22 ms |
44884 KB |
Output is correct |
45 |
Correct |
23 ms |
44884 KB |
Output is correct |
46 |
Correct |
23 ms |
44840 KB |
Output is correct |
47 |
Correct |
25 ms |
44856 KB |
Output is correct |
48 |
Correct |
23 ms |
44936 KB |
Output is correct |
49 |
Correct |
23 ms |
44936 KB |
Output is correct |
50 |
Correct |
23 ms |
44896 KB |
Output is correct |
51 |
Correct |
22 ms |
44884 KB |
Output is correct |
52 |
Correct |
22 ms |
44956 KB |
Output is correct |
53 |
Correct |
23 ms |
44888 KB |
Output is correct |
54 |
Correct |
23 ms |
45208 KB |
Output is correct |
55 |
Correct |
24 ms |
45332 KB |
Output is correct |
56 |
Correct |
128 ms |
63160 KB |
Output is correct |
57 |
Correct |
208 ms |
71880 KB |
Output is correct |
58 |
Correct |
193 ms |
71656 KB |
Output is correct |
59 |
Correct |
23 ms |
44884 KB |
Output is correct |
60 |
Correct |
24 ms |
45028 KB |
Output is correct |
61 |
Correct |
23 ms |
44884 KB |
Output is correct |
62 |
Correct |
259 ms |
83300 KB |
Output is correct |
63 |
Correct |
259 ms |
83280 KB |
Output is correct |
64 |
Correct |
246 ms |
83504 KB |
Output is correct |
65 |
Correct |
30 ms |
45772 KB |
Output is correct |
66 |
Correct |
35 ms |
46716 KB |
Output is correct |
67 |
Correct |
148 ms |
69304 KB |
Output is correct |
68 |
Correct |
266 ms |
82016 KB |
Output is correct |
69 |
Correct |
354 ms |
93720 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
17 |
Correct |
954 ms |
136232 KB |
Output is correct |
18 |
Correct |
858 ms |
135144 KB |
Output is correct |
19 |
Correct |
916 ms |
122780 KB |
Output is correct |
20 |
Correct |
852 ms |
116828 KB |
Output is correct |
21 |
Correct |
788 ms |
115628 KB |
Output is correct |
22 |
Correct |
22 ms |
44884 KB |
Output is correct |
23 |
Correct |
108 ms |
56816 KB |
Output is correct |
24 |
Correct |
51 ms |
48464 KB |
Output is correct |
25 |
Correct |
143 ms |
57724 KB |
Output is correct |
26 |
Correct |
272 ms |
66452 KB |
Output is correct |
27 |
Correct |
391 ms |
82396 KB |
Output is correct |
28 |
Correct |
468 ms |
91256 KB |
Output is correct |
29 |
Correct |
622 ms |
101868 KB |
Output is correct |
30 |
Correct |
745 ms |
110480 KB |
Output is correct |
31 |
Correct |
874 ms |
119716 KB |
Output is correct |
32 |
Correct |
346 ms |
95892 KB |
Output is correct |
33 |
Correct |
264 ms |
84272 KB |
Output is correct |
34 |
Correct |
27 ms |
46036 KB |
Output is correct |
35 |
Correct |
31 ms |
46932 KB |
Output is correct |
36 |
Correct |
175 ms |
70204 KB |
Output is correct |
37 |
Correct |
254 ms |
82948 KB |
Output is correct |
38 |
Correct |
376 ms |
95784 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
44884 KB |
Output is correct |
2 |
Correct |
20 ms |
44832 KB |
Output is correct |
3 |
Correct |
21 ms |
44932 KB |
Output is correct |
4 |
Correct |
20 ms |
44936 KB |
Output is correct |
5 |
Correct |
23 ms |
44892 KB |
Output is correct |
6 |
Correct |
20 ms |
44884 KB |
Output is correct |
7 |
Correct |
21 ms |
44884 KB |
Output is correct |
8 |
Correct |
19 ms |
44848 KB |
Output is correct |
9 |
Correct |
109 ms |
59204 KB |
Output is correct |
10 |
Correct |
25 ms |
46548 KB |
Output is correct |
11 |
Correct |
57 ms |
52552 KB |
Output is correct |
12 |
Correct |
28 ms |
47316 KB |
Output is correct |
13 |
Correct |
46 ms |
49684 KB |
Output is correct |
14 |
Correct |
19 ms |
45012 KB |
Output is correct |
15 |
Correct |
19 ms |
45072 KB |
Output is correct |
16 |
Correct |
107 ms |
59160 KB |
Output is correct |
17 |
Correct |
26 ms |
44984 KB |
Output is correct |
18 |
Correct |
23 ms |
44860 KB |
Output is correct |
19 |
Correct |
23 ms |
44880 KB |
Output is correct |
20 |
Correct |
22 ms |
44832 KB |
Output is correct |
21 |
Correct |
22 ms |
44956 KB |
Output is correct |
22 |
Correct |
22 ms |
44884 KB |
Output is correct |
23 |
Correct |
319 ms |
87288 KB |
Output is correct |
24 |
Correct |
28 ms |
44884 KB |
Output is correct |
25 |
Correct |
24 ms |
45212 KB |
Output is correct |
26 |
Correct |
29 ms |
45396 KB |
Output is correct |
27 |
Correct |
26 ms |
45524 KB |
Output is correct |
28 |
Correct |
120 ms |
61952 KB |
Output is correct |
29 |
Correct |
182 ms |
70312 KB |
Output is correct |
30 |
Correct |
255 ms |
78896 KB |
Output is correct |
31 |
Correct |
343 ms |
87344 KB |
Output is correct |
32 |
Correct |
19 ms |
44836 KB |
Output is correct |
33 |
Correct |
19 ms |
44884 KB |
Output is correct |
34 |
Correct |
21 ms |
44956 KB |
Output is correct |
35 |
Correct |
19 ms |
44884 KB |
Output is correct |
36 |
Correct |
18 ms |
44884 KB |
Output is correct |
37 |
Correct |
19 ms |
44884 KB |
Output is correct |
38 |
Correct |
18 ms |
44876 KB |
Output is correct |
39 |
Correct |
21 ms |
44876 KB |
Output is correct |
40 |
Correct |
18 ms |
44884 KB |
Output is correct |
41 |
Correct |
19 ms |
44936 KB |
Output is correct |
42 |
Correct |
27 ms |
44880 KB |
Output is correct |
43 |
Correct |
22 ms |
45140 KB |
Output is correct |
44 |
Correct |
29 ms |
45356 KB |
Output is correct |
45 |
Correct |
143 ms |
63212 KB |
Output is correct |
46 |
Correct |
220 ms |
71704 KB |
Output is correct |
47 |
Correct |
188 ms |
71692 KB |
Output is correct |
48 |
Correct |
23 ms |
44888 KB |
Output is correct |
49 |
Correct |
22 ms |
44884 KB |
Output is correct |
50 |
Correct |
24 ms |
44996 KB |
Output is correct |
51 |
Correct |
21 ms |
44932 KB |
Output is correct |
52 |
Correct |
22 ms |
44876 KB |
Output is correct |
53 |
Correct |
25 ms |
44920 KB |
Output is correct |
54 |
Correct |
21 ms |
44884 KB |
Output is correct |
55 |
Correct |
318 ms |
86912 KB |
Output is correct |
56 |
Correct |
22 ms |
44884 KB |
Output is correct |
57 |
Correct |
25 ms |
45352 KB |
Output is correct |
58 |
Correct |
29 ms |
46360 KB |
Output is correct |
59 |
Correct |
28 ms |
46804 KB |
Output is correct |
60 |
Correct |
144 ms |
65592 KB |
Output is correct |
61 |
Correct |
199 ms |
74204 KB |
Output is correct |
62 |
Correct |
258 ms |
79600 KB |
Output is correct |
63 |
Correct |
310 ms |
86552 KB |
Output is correct |
64 |
Correct |
22 ms |
44864 KB |
Output is correct |
65 |
Correct |
22 ms |
44884 KB |
Output is correct |
66 |
Correct |
26 ms |
44848 KB |
Output is correct |
67 |
Correct |
290 ms |
83292 KB |
Output is correct |
68 |
Correct |
314 ms |
83232 KB |
Output is correct |
69 |
Correct |
262 ms |
83504 KB |
Output is correct |
70 |
Correct |
31 ms |
45752 KB |
Output is correct |
71 |
Correct |
34 ms |
46724 KB |
Output is correct |
72 |
Correct |
185 ms |
69260 KB |
Output is correct |
73 |
Correct |
276 ms |
81960 KB |
Output is correct |
74 |
Correct |
407 ms |
93736 KB |
Output is correct |
75 |
Correct |
413 ms |
95808 KB |
Output is correct |
76 |
Correct |
318 ms |
84212 KB |
Output is correct |
77 |
Correct |
30 ms |
46036 KB |
Output is correct |
78 |
Correct |
31 ms |
46932 KB |
Output is correct |
79 |
Correct |
185 ms |
70228 KB |
Output is correct |
80 |
Correct |
292 ms |
82948 KB |
Output is correct |
81 |
Correct |
363 ms |
95624 KB |
Output is correct |
82 |
Correct |
21 ms |
44928 KB |
Output is correct |
83 |
Correct |
23 ms |
44856 KB |
Output is correct |
84 |
Correct |
21 ms |
44880 KB |
Output is correct |
85 |
Correct |
878 ms |
121944 KB |
Output is correct |
86 |
Correct |
1012 ms |
121036 KB |
Output is correct |
87 |
Correct |
973 ms |
120792 KB |
Output is correct |
88 |
Correct |
791 ms |
122208 KB |
Output is correct |
89 |
Correct |
318 ms |
70032 KB |
Output is correct |
90 |
Correct |
657 ms |
81088 KB |
Output is correct |
91 |
Correct |
577 ms |
80908 KB |
Output is correct |
92 |
Correct |
982 ms |
130668 KB |
Output is correct |
93 |
Correct |
915 ms |
130536 KB |
Output is correct |
94 |
Correct |
958 ms |
130428 KB |
Output is correct |
95 |
Correct |
965 ms |
130352 KB |
Output is correct |
96 |
Correct |
27 ms |
44860 KB |
Output is correct |
97 |
Correct |
64 ms |
50548 KB |
Output is correct |
98 |
Correct |
117 ms |
57464 KB |
Output is correct |
99 |
Correct |
871 ms |
121392 KB |
Output is correct |
100 |
Correct |
35 ms |
46668 KB |
Output is correct |
101 |
Correct |
103 ms |
54000 KB |
Output is correct |
102 |
Correct |
224 ms |
63244 KB |
Output is correct |
103 |
Correct |
271 ms |
75000 KB |
Output is correct |
104 |
Correct |
411 ms |
85824 KB |
Output is correct |
105 |
Correct |
548 ms |
98044 KB |
Output is correct |
106 |
Correct |
724 ms |
109008 KB |
Output is correct |
107 |
Correct |
900 ms |
119728 KB |
Output is correct |
108 |
Correct |
23 ms |
44884 KB |
Output is correct |
109 |
Correct |
22 ms |
44884 KB |
Output is correct |
110 |
Correct |
23 ms |
44884 KB |
Output is correct |
111 |
Correct |
23 ms |
44840 KB |
Output is correct |
112 |
Correct |
25 ms |
44856 KB |
Output is correct |
113 |
Correct |
23 ms |
44936 KB |
Output is correct |
114 |
Correct |
23 ms |
44936 KB |
Output is correct |
115 |
Correct |
23 ms |
44896 KB |
Output is correct |
116 |
Correct |
22 ms |
44884 KB |
Output is correct |
117 |
Correct |
22 ms |
44956 KB |
Output is correct |
118 |
Correct |
23 ms |
44888 KB |
Output is correct |
119 |
Correct |
23 ms |
45208 KB |
Output is correct |
120 |
Correct |
24 ms |
45332 KB |
Output is correct |
121 |
Correct |
128 ms |
63160 KB |
Output is correct |
122 |
Correct |
208 ms |
71880 KB |
Output is correct |
123 |
Correct |
193 ms |
71656 KB |
Output is correct |
124 |
Correct |
23 ms |
44884 KB |
Output is correct |
125 |
Correct |
24 ms |
45028 KB |
Output is correct |
126 |
Correct |
23 ms |
44884 KB |
Output is correct |
127 |
Correct |
259 ms |
83300 KB |
Output is correct |
128 |
Correct |
259 ms |
83280 KB |
Output is correct |
129 |
Correct |
246 ms |
83504 KB |
Output is correct |
130 |
Correct |
30 ms |
45772 KB |
Output is correct |
131 |
Correct |
35 ms |
46716 KB |
Output is correct |
132 |
Correct |
148 ms |
69304 KB |
Output is correct |
133 |
Correct |
266 ms |
82016 KB |
Output is correct |
134 |
Correct |
354 ms |
93720 KB |
Output is correct |
135 |
Correct |
954 ms |
136232 KB |
Output is correct |
136 |
Correct |
858 ms |
135144 KB |
Output is correct |
137 |
Correct |
916 ms |
122780 KB |
Output is correct |
138 |
Correct |
852 ms |
116828 KB |
Output is correct |
139 |
Correct |
788 ms |
115628 KB |
Output is correct |
140 |
Correct |
22 ms |
44884 KB |
Output is correct |
141 |
Correct |
108 ms |
56816 KB |
Output is correct |
142 |
Correct |
51 ms |
48464 KB |
Output is correct |
143 |
Correct |
143 ms |
57724 KB |
Output is correct |
144 |
Correct |
272 ms |
66452 KB |
Output is correct |
145 |
Correct |
391 ms |
82396 KB |
Output is correct |
146 |
Correct |
468 ms |
91256 KB |
Output is correct |
147 |
Correct |
622 ms |
101868 KB |
Output is correct |
148 |
Correct |
745 ms |
110480 KB |
Output is correct |
149 |
Correct |
874 ms |
119716 KB |
Output is correct |
150 |
Correct |
346 ms |
95892 KB |
Output is correct |
151 |
Correct |
264 ms |
84272 KB |
Output is correct |
152 |
Correct |
27 ms |
46036 KB |
Output is correct |
153 |
Correct |
31 ms |
46932 KB |
Output is correct |
154 |
Correct |
175 ms |
70204 KB |
Output is correct |
155 |
Correct |
254 ms |
82948 KB |
Output is correct |
156 |
Correct |
376 ms |
95784 KB |
Output is correct |
157 |
Correct |
23 ms |
44876 KB |
Output is correct |
158 |
Correct |
23 ms |
44948 KB |
Output is correct |
159 |
Correct |
23 ms |
44884 KB |
Output is correct |
160 |
Correct |
24 ms |
44912 KB |
Output is correct |
161 |
Incorrect |
809 ms |
101864 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |