#include<bits/stdc++.h>
#include "parks.h"
using namespace std;
struct Edge
{
int som,ind;
};
map<pair<int,int>,int>M,M2;
vector<Edge>Graf[200009];
vector<int>D[1000009];
pair<int,int>KimJest[1000009];
bool zaj[1000009];
vector<int>Sprz;
int g[1000009];
int match[1000009];
int n,m=0,k=0,N,IleVert=0;
int f[200009],ilosc[200009];
int F(int v)
{
if(f[v]==v){return v;}
return f[v]=F(f[v]);
}
void Polacz(int a, int b)
{
a=F(a);
b=F(b);
if(a==b){return;}
if(ilosc[a]<ilosc[b]){swap(a,b);}
ilosc[a]+=ilosc[b];
f[b]=a;
}
bool DFS(int v)
{
if(zaj[v]){return 0;}
zaj[v]=1;
Sprz.push_back(v);
for(int som : D[v])
{
if(match[som]==-1||DFS(match[som]))
{
match[v]=som;
match[som]=v;
return 1;
}
}
return 0;
}
void SKOJ()
{
random_shuffle(g,g+N);
for(int i=0;i<N;i++)
{
match[i]=-1;
zaj[i]=0;
}
for(int i=0;i<N;i++)
{
int a=g[i];
for(int b : D[a])
{
if(match[a]==-1&&match[b]==-1)
{
match[a]=b;
match[b]=a;
}
}
}
random_shuffle(g,g+N);
for(int i=0;i<N;i++)
{
int u=g[i];
if(match[u]==-1)
{
DFS(u);
}
for(int temp : Sprz)
{
zaj[temp]=0;
}
Sprz.clear();
}
}
void Upgrade(int v)
{
zaj[v]=1;
Sprz.push_back(v);
for(int som : D[v])
{
if(zaj[match[som]]==0)
{
Upgrade(match[som]);
match[v]=som;
match[som]=v;
return;
}
else if(match[som]!=v)
{
break;
}
}
for(int u : Sprz){zaj[u]=0;}
Sprz.clear();
match[v]=-1;
}
void CzySpojna(int v)
{
zaj[v]=1;
IleVert++;
for(auto[som,ind] : Graf[v])
{
if(zaj[som]){continue;}
CzySpojna(som);
}
}
int construct_roads(vector<int>X, vector<int>Y)
{
srand(2137);
n=(int)X.size();
for(int i=0;i<n;i++)
{
M[{X[i],Y[i]}]=i;
}
for(int i=0;i<n;i++)
{
if(M.find({X[i]-2,Y[i]})!=M.end())
{
Graf[i].push_back({M[{X[i]-2,Y[i]}],m});
Graf[M[{X[i]-2,Y[i]}]].push_back({i,m});
m++;
}
if(M.find({X[i],Y[i]-2})!=M.end())
{
Graf[i].push_back({M[{X[i],Y[i]-2}],m});
Graf[M[{X[i],Y[i]-2}]].push_back({i,m});
m++;
}
}
CzySpojna(0);
if(IleVert!=n){return 0;}
vector<pair<int,int>>E(m);
for(int i=0;i<n;i++)
{
for(auto[som,ind] : Graf[i])
{
int a=i,b=som;
if(pair<int,int>{X[a],Y[a]}>pair<int,int>{X[b],Y[b]}){continue;}
E[ind]={a,b};
}
}
for(int i=0;i<(int)E.size();i++)
{
const int a=E[i].first,b=E[i].second;
vector<pair<int,int>>Som;
if(Y[a]+2==Y[b])
{
Som.push_back({X[a]-1,Y[a]+1});
Som.push_back({X[a]+1,Y[a]+1});
}
else if(X[a]+2==X[b])
{
Som.push_back({X[a]+1,Y[a]+1});
Som.push_back({X[a]+1,Y[a]-1});
}
for(pair<int,int>som : Som)
{
if(M2.find(som)==M2.end())
{
KimJest[k]=som;
M2[som]=k++;
}
int u=m+M2[som];
D[i].push_back(u);
D[u].push_back(i);
}
}
N=m+k;
for(int i=0;i<N;i++){g[i]=i;}
SKOJ();
for(int I=1;I<=10;I++)
{
for(int i=0;i<n;i++)
{
f[i]=i;
ilosc[i]=1;
}
for(int i=0;i<n;i++)
{
for(auto[som,ind] : Graf[i])
{
if(match[ind]==-1){continue;}
Polacz(i,som);
}
}
if(ilosc[F(0)]==n)
{
vector<int>O1,O2,O3,O4;
for(int j=0;j<m;j++)
{
const int a=E[j].first,b=E[j].second;
if(match[j]!=-1)
{
pair<int,int>xd=KimJest[match[j]-m];
O1.push_back(a);
O2.push_back(b);
O3.push_back(xd.first);
O4.push_back(xd.second);
}
}
build(O1,O2,O3,O4);
return 1;
}
vector<int>U;
for(int i=0;i<n;i++){g[i]=i;}
random_shuffle(g,g+n);
for(int i=0;i<n;i++)
{
const int u=g[i];
for(auto[som,ind] : Graf[u])
{
if(match[ind]==-1&&F(u)!=F(som))
{
U.push_back(ind);
Polacz(u,som);
}
}
}
for(int u : U)
{
if(match[u]!=-1){continue;}
Upgrade(u);
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
17 |
Correct |
10 ms |
30040 KB |
Output is correct |
18 |
Correct |
11 ms |
30040 KB |
Output is correct |
19 |
Correct |
10 ms |
30044 KB |
Output is correct |
20 |
Correct |
9 ms |
30044 KB |
Output is correct |
21 |
Correct |
10 ms |
30044 KB |
Output is correct |
22 |
Correct |
10 ms |
30044 KB |
Output is correct |
23 |
Correct |
1010 ms |
127812 KB |
Output is correct |
24 |
Correct |
11 ms |
30040 KB |
Output is correct |
25 |
Correct |
15 ms |
30808 KB |
Output is correct |
26 |
Correct |
12 ms |
30556 KB |
Output is correct |
27 |
Correct |
13 ms |
30828 KB |
Output is correct |
28 |
Correct |
313 ms |
68944 KB |
Output is correct |
29 |
Correct |
508 ms |
89008 KB |
Output is correct |
30 |
Correct |
713 ms |
108488 KB |
Output is correct |
31 |
Correct |
919 ms |
127340 KB |
Output is correct |
32 |
Correct |
9 ms |
30044 KB |
Output is correct |
33 |
Correct |
9 ms |
30044 KB |
Output is correct |
34 |
Correct |
10 ms |
30160 KB |
Output is correct |
35 |
Correct |
9 ms |
30044 KB |
Output is correct |
36 |
Correct |
9 ms |
30196 KB |
Output is correct |
37 |
Correct |
9 ms |
30044 KB |
Output is correct |
38 |
Correct |
9 ms |
30040 KB |
Output is correct |
39 |
Correct |
9 ms |
30044 KB |
Output is correct |
40 |
Correct |
9 ms |
30044 KB |
Output is correct |
41 |
Correct |
9 ms |
30044 KB |
Output is correct |
42 |
Correct |
9 ms |
30128 KB |
Output is correct |
43 |
Correct |
12 ms |
30556 KB |
Output is correct |
44 |
Correct |
11 ms |
30556 KB |
Output is correct |
45 |
Correct |
285 ms |
69836 KB |
Output is correct |
46 |
Correct |
470 ms |
87976 KB |
Output is correct |
47 |
Correct |
458 ms |
87652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
17 |
Correct |
10 ms |
30040 KB |
Output is correct |
18 |
Correct |
11 ms |
30040 KB |
Output is correct |
19 |
Correct |
10 ms |
30044 KB |
Output is correct |
20 |
Correct |
9 ms |
30044 KB |
Output is correct |
21 |
Correct |
10 ms |
30044 KB |
Output is correct |
22 |
Correct |
10 ms |
30044 KB |
Output is correct |
23 |
Correct |
1010 ms |
127812 KB |
Output is correct |
24 |
Correct |
11 ms |
30040 KB |
Output is correct |
25 |
Correct |
15 ms |
30808 KB |
Output is correct |
26 |
Correct |
12 ms |
30556 KB |
Output is correct |
27 |
Correct |
13 ms |
30828 KB |
Output is correct |
28 |
Correct |
313 ms |
68944 KB |
Output is correct |
29 |
Correct |
508 ms |
89008 KB |
Output is correct |
30 |
Correct |
713 ms |
108488 KB |
Output is correct |
31 |
Correct |
919 ms |
127340 KB |
Output is correct |
32 |
Correct |
9 ms |
30044 KB |
Output is correct |
33 |
Correct |
9 ms |
30044 KB |
Output is correct |
34 |
Correct |
10 ms |
30160 KB |
Output is correct |
35 |
Correct |
9 ms |
30044 KB |
Output is correct |
36 |
Correct |
9 ms |
30196 KB |
Output is correct |
37 |
Correct |
9 ms |
30044 KB |
Output is correct |
38 |
Correct |
9 ms |
30040 KB |
Output is correct |
39 |
Correct |
9 ms |
30044 KB |
Output is correct |
40 |
Correct |
9 ms |
30044 KB |
Output is correct |
41 |
Correct |
9 ms |
30044 KB |
Output is correct |
42 |
Correct |
9 ms |
30128 KB |
Output is correct |
43 |
Correct |
12 ms |
30556 KB |
Output is correct |
44 |
Correct |
11 ms |
30556 KB |
Output is correct |
45 |
Correct |
285 ms |
69836 KB |
Output is correct |
46 |
Correct |
470 ms |
87976 KB |
Output is correct |
47 |
Correct |
458 ms |
87652 KB |
Output is correct |
48 |
Correct |
9 ms |
30044 KB |
Output is correct |
49 |
Correct |
11 ms |
30044 KB |
Output is correct |
50 |
Correct |
9 ms |
30044 KB |
Output is correct |
51 |
Correct |
10 ms |
30040 KB |
Output is correct |
52 |
Correct |
10 ms |
30044 KB |
Output is correct |
53 |
Correct |
10 ms |
30040 KB |
Output is correct |
54 |
Correct |
10 ms |
30044 KB |
Output is correct |
55 |
Correct |
1012 ms |
120096 KB |
Output is correct |
56 |
Correct |
10 ms |
30040 KB |
Output is correct |
57 |
Correct |
15 ms |
31032 KB |
Output is correct |
58 |
Correct |
26 ms |
33116 KB |
Output is correct |
59 |
Correct |
20 ms |
31576 KB |
Output is correct |
60 |
Correct |
412 ms |
75440 KB |
Output is correct |
61 |
Correct |
609 ms |
91284 KB |
Output is correct |
62 |
Correct |
816 ms |
104620 KB |
Output is correct |
63 |
Correct |
986 ms |
119816 KB |
Output is correct |
64 |
Correct |
10 ms |
30040 KB |
Output is correct |
65 |
Correct |
10 ms |
30076 KB |
Output is correct |
66 |
Correct |
10 ms |
30044 KB |
Output is correct |
67 |
Correct |
781 ms |
123048 KB |
Output is correct |
68 |
Correct |
784 ms |
123092 KB |
Output is correct |
69 |
Correct |
760 ms |
124592 KB |
Output is correct |
70 |
Correct |
19 ms |
30556 KB |
Output is correct |
71 |
Correct |
16 ms |
29532 KB |
Output is correct |
72 |
Correct |
305 ms |
68464 KB |
Output is correct |
73 |
Correct |
515 ms |
86588 KB |
Output is correct |
74 |
Correct |
844 ms |
106664 KB |
Output is correct |
75 |
Correct |
911 ms |
118600 KB |
Output is correct |
76 |
Correct |
838 ms |
123164 KB |
Output is correct |
77 |
Correct |
15 ms |
29276 KB |
Output is correct |
78 |
Correct |
17 ms |
29748 KB |
Output is correct |
79 |
Correct |
346 ms |
70932 KB |
Output is correct |
80 |
Correct |
565 ms |
90536 KB |
Output is correct |
81 |
Correct |
806 ms |
112044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
17 |
Correct |
10 ms |
28508 KB |
Output is correct |
18 |
Correct |
13 ms |
28508 KB |
Output is correct |
19 |
Correct |
10 ms |
28456 KB |
Output is correct |
20 |
Correct |
814 ms |
110924 KB |
Output is correct |
21 |
Correct |
910 ms |
103444 KB |
Output is correct |
22 |
Correct |
676 ms |
103096 KB |
Output is correct |
23 |
Correct |
593 ms |
109224 KB |
Output is correct |
24 |
Correct |
165 ms |
47444 KB |
Output is correct |
25 |
Correct |
294 ms |
53844 KB |
Output is correct |
26 |
Correct |
285 ms |
53944 KB |
Output is correct |
27 |
Correct |
716 ms |
118444 KB |
Output is correct |
28 |
Correct |
705 ms |
118444 KB |
Output is correct |
29 |
Correct |
703 ms |
118444 KB |
Output is correct |
30 |
Correct |
715 ms |
118452 KB |
Output is correct |
31 |
Correct |
11 ms |
30044 KB |
Output is correct |
32 |
Correct |
46 ms |
35924 KB |
Output is correct |
33 |
Correct |
83 ms |
39252 KB |
Output is correct |
34 |
Correct |
786 ms |
108380 KB |
Output is correct |
35 |
Correct |
22 ms |
31324 KB |
Output is correct |
36 |
Correct |
67 ms |
36384 KB |
Output is correct |
37 |
Correct |
146 ms |
42836 KB |
Output is correct |
38 |
Correct |
236 ms |
59320 KB |
Output is correct |
39 |
Correct |
335 ms |
70016 KB |
Output is correct |
40 |
Correct |
445 ms |
80904 KB |
Output is correct |
41 |
Correct |
562 ms |
91268 KB |
Output is correct |
42 |
Correct |
724 ms |
102216 KB |
Output is correct |
43 |
Correct |
11 ms |
30040 KB |
Output is correct |
44 |
Correct |
10 ms |
30044 KB |
Output is correct |
45 |
Correct |
10 ms |
30044 KB |
Output is correct |
46 |
Correct |
9 ms |
30044 KB |
Output is correct |
47 |
Correct |
10 ms |
30044 KB |
Output is correct |
48 |
Correct |
11 ms |
28504 KB |
Output is correct |
49 |
Correct |
10 ms |
28632 KB |
Output is correct |
50 |
Correct |
10 ms |
28508 KB |
Output is correct |
51 |
Correct |
11 ms |
28508 KB |
Output is correct |
52 |
Correct |
14 ms |
28764 KB |
Output is correct |
53 |
Correct |
16 ms |
28508 KB |
Output is correct |
54 |
Correct |
21 ms |
28760 KB |
Output is correct |
55 |
Correct |
12 ms |
30552 KB |
Output is correct |
56 |
Correct |
311 ms |
69908 KB |
Output is correct |
57 |
Correct |
526 ms |
87944 KB |
Output is correct |
58 |
Correct |
567 ms |
88172 KB |
Output is correct |
59 |
Correct |
11 ms |
30044 KB |
Output is correct |
60 |
Correct |
11 ms |
30240 KB |
Output is correct |
61 |
Correct |
10 ms |
30044 KB |
Output is correct |
62 |
Correct |
781 ms |
123076 KB |
Output is correct |
63 |
Correct |
746 ms |
123844 KB |
Output is correct |
64 |
Correct |
722 ms |
123424 KB |
Output is correct |
65 |
Correct |
14 ms |
30556 KB |
Output is correct |
66 |
Correct |
17 ms |
31068 KB |
Output is correct |
67 |
Correct |
291 ms |
68536 KB |
Output is correct |
68 |
Correct |
475 ms |
88388 KB |
Output is correct |
69 |
Correct |
681 ms |
106668 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
17 |
Correct |
712 ms |
125100 KB |
Output is correct |
18 |
Correct |
791 ms |
124080 KB |
Output is correct |
19 |
Correct |
872 ms |
105044 KB |
Output is correct |
20 |
Correct |
884 ms |
112820 KB |
Output is correct |
21 |
Correct |
762 ms |
107072 KB |
Output is correct |
22 |
Correct |
11 ms |
30040 KB |
Output is correct |
23 |
Correct |
103 ms |
42336 KB |
Output is correct |
24 |
Correct |
35 ms |
32824 KB |
Output is correct |
25 |
Correct |
97 ms |
39620 KB |
Output is correct |
26 |
Correct |
180 ms |
45980 KB |
Output is correct |
27 |
Correct |
351 ms |
70664 KB |
Output is correct |
28 |
Correct |
473 ms |
81228 KB |
Output is correct |
29 |
Correct |
645 ms |
90672 KB |
Output is correct |
30 |
Correct |
770 ms |
101808 KB |
Output is correct |
31 |
Correct |
859 ms |
110976 KB |
Output is correct |
32 |
Correct |
813 ms |
118448 KB |
Output is correct |
33 |
Correct |
714 ms |
124852 KB |
Output is correct |
34 |
Correct |
14 ms |
30812 KB |
Output is correct |
35 |
Correct |
17 ms |
31416 KB |
Output is correct |
36 |
Correct |
322 ms |
71068 KB |
Output is correct |
37 |
Correct |
511 ms |
91820 KB |
Output is correct |
38 |
Correct |
779 ms |
112044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
30040 KB |
Output is correct |
2 |
Correct |
10 ms |
30044 KB |
Output is correct |
3 |
Correct |
10 ms |
30044 KB |
Output is correct |
4 |
Correct |
9 ms |
30044 KB |
Output is correct |
5 |
Correct |
11 ms |
30044 KB |
Output is correct |
6 |
Correct |
10 ms |
30044 KB |
Output is correct |
7 |
Correct |
10 ms |
30044 KB |
Output is correct |
8 |
Correct |
11 ms |
30044 KB |
Output is correct |
9 |
Correct |
298 ms |
77496 KB |
Output is correct |
10 |
Correct |
26 ms |
35164 KB |
Output is correct |
11 |
Correct |
110 ms |
55852 KB |
Output is correct |
12 |
Correct |
34 ms |
37612 KB |
Output is correct |
13 |
Correct |
38 ms |
36180 KB |
Output is correct |
14 |
Correct |
14 ms |
30304 KB |
Output is correct |
15 |
Correct |
11 ms |
30300 KB |
Output is correct |
16 |
Correct |
306 ms |
76096 KB |
Output is correct |
17 |
Correct |
10 ms |
30040 KB |
Output is correct |
18 |
Correct |
11 ms |
30040 KB |
Output is correct |
19 |
Correct |
10 ms |
30044 KB |
Output is correct |
20 |
Correct |
9 ms |
30044 KB |
Output is correct |
21 |
Correct |
10 ms |
30044 KB |
Output is correct |
22 |
Correct |
10 ms |
30044 KB |
Output is correct |
23 |
Correct |
1010 ms |
127812 KB |
Output is correct |
24 |
Correct |
11 ms |
30040 KB |
Output is correct |
25 |
Correct |
15 ms |
30808 KB |
Output is correct |
26 |
Correct |
12 ms |
30556 KB |
Output is correct |
27 |
Correct |
13 ms |
30828 KB |
Output is correct |
28 |
Correct |
313 ms |
68944 KB |
Output is correct |
29 |
Correct |
508 ms |
89008 KB |
Output is correct |
30 |
Correct |
713 ms |
108488 KB |
Output is correct |
31 |
Correct |
919 ms |
127340 KB |
Output is correct |
32 |
Correct |
9 ms |
30044 KB |
Output is correct |
33 |
Correct |
9 ms |
30044 KB |
Output is correct |
34 |
Correct |
10 ms |
30160 KB |
Output is correct |
35 |
Correct |
9 ms |
30044 KB |
Output is correct |
36 |
Correct |
9 ms |
30196 KB |
Output is correct |
37 |
Correct |
9 ms |
30044 KB |
Output is correct |
38 |
Correct |
9 ms |
30040 KB |
Output is correct |
39 |
Correct |
9 ms |
30044 KB |
Output is correct |
40 |
Correct |
9 ms |
30044 KB |
Output is correct |
41 |
Correct |
9 ms |
30044 KB |
Output is correct |
42 |
Correct |
9 ms |
30128 KB |
Output is correct |
43 |
Correct |
12 ms |
30556 KB |
Output is correct |
44 |
Correct |
11 ms |
30556 KB |
Output is correct |
45 |
Correct |
285 ms |
69836 KB |
Output is correct |
46 |
Correct |
470 ms |
87976 KB |
Output is correct |
47 |
Correct |
458 ms |
87652 KB |
Output is correct |
48 |
Correct |
9 ms |
30044 KB |
Output is correct |
49 |
Correct |
11 ms |
30044 KB |
Output is correct |
50 |
Correct |
9 ms |
30044 KB |
Output is correct |
51 |
Correct |
10 ms |
30040 KB |
Output is correct |
52 |
Correct |
10 ms |
30044 KB |
Output is correct |
53 |
Correct |
10 ms |
30040 KB |
Output is correct |
54 |
Correct |
10 ms |
30044 KB |
Output is correct |
55 |
Correct |
1012 ms |
120096 KB |
Output is correct |
56 |
Correct |
10 ms |
30040 KB |
Output is correct |
57 |
Correct |
15 ms |
31032 KB |
Output is correct |
58 |
Correct |
26 ms |
33116 KB |
Output is correct |
59 |
Correct |
20 ms |
31576 KB |
Output is correct |
60 |
Correct |
412 ms |
75440 KB |
Output is correct |
61 |
Correct |
609 ms |
91284 KB |
Output is correct |
62 |
Correct |
816 ms |
104620 KB |
Output is correct |
63 |
Correct |
986 ms |
119816 KB |
Output is correct |
64 |
Correct |
10 ms |
30040 KB |
Output is correct |
65 |
Correct |
10 ms |
30076 KB |
Output is correct |
66 |
Correct |
10 ms |
30044 KB |
Output is correct |
67 |
Correct |
781 ms |
123048 KB |
Output is correct |
68 |
Correct |
784 ms |
123092 KB |
Output is correct |
69 |
Correct |
760 ms |
124592 KB |
Output is correct |
70 |
Correct |
19 ms |
30556 KB |
Output is correct |
71 |
Correct |
16 ms |
29532 KB |
Output is correct |
72 |
Correct |
305 ms |
68464 KB |
Output is correct |
73 |
Correct |
515 ms |
86588 KB |
Output is correct |
74 |
Correct |
844 ms |
106664 KB |
Output is correct |
75 |
Correct |
911 ms |
118600 KB |
Output is correct |
76 |
Correct |
838 ms |
123164 KB |
Output is correct |
77 |
Correct |
15 ms |
29276 KB |
Output is correct |
78 |
Correct |
17 ms |
29748 KB |
Output is correct |
79 |
Correct |
346 ms |
70932 KB |
Output is correct |
80 |
Correct |
565 ms |
90536 KB |
Output is correct |
81 |
Correct |
806 ms |
112044 KB |
Output is correct |
82 |
Correct |
10 ms |
28508 KB |
Output is correct |
83 |
Correct |
13 ms |
28508 KB |
Output is correct |
84 |
Correct |
10 ms |
28456 KB |
Output is correct |
85 |
Correct |
814 ms |
110924 KB |
Output is correct |
86 |
Correct |
910 ms |
103444 KB |
Output is correct |
87 |
Correct |
676 ms |
103096 KB |
Output is correct |
88 |
Correct |
593 ms |
109224 KB |
Output is correct |
89 |
Correct |
165 ms |
47444 KB |
Output is correct |
90 |
Correct |
294 ms |
53844 KB |
Output is correct |
91 |
Correct |
285 ms |
53944 KB |
Output is correct |
92 |
Correct |
716 ms |
118444 KB |
Output is correct |
93 |
Correct |
705 ms |
118444 KB |
Output is correct |
94 |
Correct |
703 ms |
118444 KB |
Output is correct |
95 |
Correct |
715 ms |
118452 KB |
Output is correct |
96 |
Correct |
11 ms |
30044 KB |
Output is correct |
97 |
Correct |
46 ms |
35924 KB |
Output is correct |
98 |
Correct |
83 ms |
39252 KB |
Output is correct |
99 |
Correct |
786 ms |
108380 KB |
Output is correct |
100 |
Correct |
22 ms |
31324 KB |
Output is correct |
101 |
Correct |
67 ms |
36384 KB |
Output is correct |
102 |
Correct |
146 ms |
42836 KB |
Output is correct |
103 |
Correct |
236 ms |
59320 KB |
Output is correct |
104 |
Correct |
335 ms |
70016 KB |
Output is correct |
105 |
Correct |
445 ms |
80904 KB |
Output is correct |
106 |
Correct |
562 ms |
91268 KB |
Output is correct |
107 |
Correct |
724 ms |
102216 KB |
Output is correct |
108 |
Correct |
11 ms |
30040 KB |
Output is correct |
109 |
Correct |
10 ms |
30044 KB |
Output is correct |
110 |
Correct |
10 ms |
30044 KB |
Output is correct |
111 |
Correct |
9 ms |
30044 KB |
Output is correct |
112 |
Correct |
10 ms |
30044 KB |
Output is correct |
113 |
Correct |
11 ms |
28504 KB |
Output is correct |
114 |
Correct |
10 ms |
28632 KB |
Output is correct |
115 |
Correct |
10 ms |
28508 KB |
Output is correct |
116 |
Correct |
11 ms |
28508 KB |
Output is correct |
117 |
Correct |
14 ms |
28764 KB |
Output is correct |
118 |
Correct |
16 ms |
28508 KB |
Output is correct |
119 |
Correct |
21 ms |
28760 KB |
Output is correct |
120 |
Correct |
12 ms |
30552 KB |
Output is correct |
121 |
Correct |
311 ms |
69908 KB |
Output is correct |
122 |
Correct |
526 ms |
87944 KB |
Output is correct |
123 |
Correct |
567 ms |
88172 KB |
Output is correct |
124 |
Correct |
11 ms |
30044 KB |
Output is correct |
125 |
Correct |
11 ms |
30240 KB |
Output is correct |
126 |
Correct |
10 ms |
30044 KB |
Output is correct |
127 |
Correct |
781 ms |
123076 KB |
Output is correct |
128 |
Correct |
746 ms |
123844 KB |
Output is correct |
129 |
Correct |
722 ms |
123424 KB |
Output is correct |
130 |
Correct |
14 ms |
30556 KB |
Output is correct |
131 |
Correct |
17 ms |
31068 KB |
Output is correct |
132 |
Correct |
291 ms |
68536 KB |
Output is correct |
133 |
Correct |
475 ms |
88388 KB |
Output is correct |
134 |
Correct |
681 ms |
106668 KB |
Output is correct |
135 |
Correct |
712 ms |
125100 KB |
Output is correct |
136 |
Correct |
791 ms |
124080 KB |
Output is correct |
137 |
Correct |
872 ms |
105044 KB |
Output is correct |
138 |
Correct |
884 ms |
112820 KB |
Output is correct |
139 |
Correct |
762 ms |
107072 KB |
Output is correct |
140 |
Correct |
11 ms |
30040 KB |
Output is correct |
141 |
Correct |
103 ms |
42336 KB |
Output is correct |
142 |
Correct |
35 ms |
32824 KB |
Output is correct |
143 |
Correct |
97 ms |
39620 KB |
Output is correct |
144 |
Correct |
180 ms |
45980 KB |
Output is correct |
145 |
Correct |
351 ms |
70664 KB |
Output is correct |
146 |
Correct |
473 ms |
81228 KB |
Output is correct |
147 |
Correct |
645 ms |
90672 KB |
Output is correct |
148 |
Correct |
770 ms |
101808 KB |
Output is correct |
149 |
Correct |
859 ms |
110976 KB |
Output is correct |
150 |
Correct |
813 ms |
118448 KB |
Output is correct |
151 |
Correct |
714 ms |
124852 KB |
Output is correct |
152 |
Correct |
14 ms |
30812 KB |
Output is correct |
153 |
Correct |
17 ms |
31416 KB |
Output is correct |
154 |
Correct |
322 ms |
71068 KB |
Output is correct |
155 |
Correct |
511 ms |
91820 KB |
Output is correct |
156 |
Correct |
779 ms |
112044 KB |
Output is correct |
157 |
Correct |
10 ms |
30248 KB |
Output is correct |
158 |
Correct |
10 ms |
30044 KB |
Output is correct |
159 |
Correct |
10 ms |
30040 KB |
Output is correct |
160 |
Correct |
10 ms |
30248 KB |
Output is correct |
161 |
Execution timed out |
3601 ms |
102828 KB |
Time limit exceeded |
162 |
Halted |
0 ms |
0 KB |
- |