#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
int dsu[200010],L,R;
vector <int> g[200010],match1,match2,dist;
int prt(int n){
if (dsu[n]==n) return n;
return dsu[n]=prt(dsu[n]);
}
void unn(int u,int v){
dsu[prt(u)]=dsu[prt(v)];
}
map <pair <int,int>,int> mp;
vector <pair <int,int> > vmp;
int gt(int u,int v){
if (mp.find({u,v})==mp.end()){
mp[{u,v}]=mp.size()+1;
vmp.push_back({u,v});
}
return mp[{u,v}];
}
void bfs(){
dist.clear();
for (int i=0; i<L; i++) dist.push_back(-1);
queue <int> q;
for (int i=0; i<L; i++){
if (match1[i]==-1){
dist[i]=0;
q.push(i);
}
}
while (!q.empty()){
int tp=q.front(); q.pop();
for (int i:g[tp]){
if (match2[i]!=-1&&dist[match2[i]]==-1){
dist[match2[i]]=dist[tp]+1;
q.push(match2[i]);
}
}
}
}
int dfs(int cur){
for (int i:g[cur]){
if (match2[i]==-1){
match1[cur]=i;
match2[i]=cur;
return 1;
}
}
for (int i:g[cur]){
if (dist[match2[i]]==dist[cur]+1&&dfs(match2[i])){
match1[cur]=i;
match2[i]=cur;
return 1;
}
}
return 0;
}
bool cmp(pair <pair <int,int>,int> u,pair <pair <int,int>,int> v){
if (u.first.second!=v.first.second) return u.first.second<v.first.second;
return u.first.first<v.first.first;
}
int construct_roads(vector <int> x,vector <int> y){
int n=x.size();
pair <pair <int,int>,int> a[n];
for (int i=0; i<n; i++) a[i]={{x[i],y[i]},i};
sort(a,a+n);
for (int i=0; i<n; i++) dsu[i]=i;
vector <int> u,v,A,B;
int cnt=0;
vmp.push_back({-1,-1});
for (int i=1; i<n; i++){
if (a[i-1].first.first==a[i].first.first&&a[i-1].first.second+2==a[i].first.second&&prt(a[i-1].second)!=prt(a[i].second)){
u.push_back(a[i-1].second);
v.push_back(a[i].second);
unn(a[i-1].second,a[i].second);
int tp=gt(a[i].first.first-1,a[i].first.second-1);
g[cnt].push_back(tp);
tp=gt(a[i].first.first+1,a[i].first.second-1);
g[cnt].push_back(tp);
cnt++;
}
}
sort(a,a+n,cmp);
for (int i=1; i<n; i++){
if (a[i-1].first.first+2==a[i].first.first&&a[i-1].first.second==a[i].first.second&&prt(a[i-1].second)!=prt(a[i].second)){
u.push_back(a[i-1].second);
v.push_back(a[i].second);
unn(a[i-1].second,a[i].second);
int tp=gt(a[i].first.first-1,a[i].first.second-1);
g[cnt].push_back(tp);
tp=gt(a[i].first.first-1,a[i].first.second+1);
g[cnt].push_back(tp);
cnt++;
}
}
for (int i=1; i<n; i++){
if (prt(a[i].second)!=prt(a[0].second)) return 0;
}
for (int i=0; i<n-1; i++) match1.push_back(-1);
for (int i=0; i<=vmp.size(); i++) match2.push_back(-1);
L=match1.size(); R=match2.size();
int flo=0;
while (1){
bfs();
int aug=0;
for (int i=0; i<L; i++){
if (match1[i]==-1) aug+=dfs(i);
}
if (!aug) break;
flo+=aug;
}
if (flo!=L) return 0;
for (int i=0; i<L; i++){
int tp=match1[i];
A.push_back(vmp[tp].first);
B.push_back(vmp[tp].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:101:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
101 | for (int i=0; i<=vmp.size(); i++) match2.push_back(-1);
| ~^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
17 |
Correct |
1 ms |
4952 KB |
Output is correct |
18 |
Correct |
1 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
4952 KB |
Output is correct |
23 |
Correct |
305 ms |
56852 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
3 ms |
5468 KB |
Output is correct |
27 |
Correct |
4 ms |
5724 KB |
Output is correct |
28 |
Correct |
116 ms |
25164 KB |
Output is correct |
29 |
Correct |
180 ms |
35128 KB |
Output is correct |
30 |
Correct |
240 ms |
45752 KB |
Output is correct |
31 |
Correct |
307 ms |
55920 KB |
Output is correct |
32 |
Correct |
1 ms |
4952 KB |
Output is correct |
33 |
Correct |
1 ms |
4956 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4944 KB |
Output is correct |
36 |
Correct |
1 ms |
4956 KB |
Output is correct |
37 |
Correct |
1 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4956 KB |
Output is correct |
40 |
Correct |
1 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5468 KB |
Output is correct |
45 |
Correct |
138 ms |
29108 KB |
Output is correct |
46 |
Correct |
213 ms |
40112 KB |
Output is correct |
47 |
Correct |
220 ms |
40276 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
17 |
Correct |
1 ms |
4952 KB |
Output is correct |
18 |
Correct |
1 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
4952 KB |
Output is correct |
23 |
Correct |
305 ms |
56852 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
3 ms |
5468 KB |
Output is correct |
27 |
Correct |
4 ms |
5724 KB |
Output is correct |
28 |
Correct |
116 ms |
25164 KB |
Output is correct |
29 |
Correct |
180 ms |
35128 KB |
Output is correct |
30 |
Correct |
240 ms |
45752 KB |
Output is correct |
31 |
Correct |
307 ms |
55920 KB |
Output is correct |
32 |
Correct |
1 ms |
4952 KB |
Output is correct |
33 |
Correct |
1 ms |
4956 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4944 KB |
Output is correct |
36 |
Correct |
1 ms |
4956 KB |
Output is correct |
37 |
Correct |
1 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4956 KB |
Output is correct |
40 |
Correct |
1 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5468 KB |
Output is correct |
45 |
Correct |
138 ms |
29108 KB |
Output is correct |
46 |
Correct |
213 ms |
40112 KB |
Output is correct |
47 |
Correct |
220 ms |
40276 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
1 ms |
4952 KB |
Output is correct |
52 |
Correct |
1 ms |
4956 KB |
Output is correct |
53 |
Correct |
1 ms |
4956 KB |
Output is correct |
54 |
Correct |
1 ms |
4956 KB |
Output is correct |
55 |
Correct |
274 ms |
54272 KB |
Output is correct |
56 |
Correct |
2 ms |
4952 KB |
Output is correct |
57 |
Correct |
3 ms |
5468 KB |
Output is correct |
58 |
Correct |
7 ms |
6492 KB |
Output is correct |
59 |
Correct |
8 ms |
6748 KB |
Output is correct |
60 |
Correct |
127 ms |
28912 KB |
Output is correct |
61 |
Correct |
179 ms |
37660 KB |
Output is correct |
62 |
Correct |
221 ms |
44716 KB |
Output is correct |
63 |
Correct |
294 ms |
52884 KB |
Output is correct |
64 |
Correct |
1 ms |
4956 KB |
Output is correct |
65 |
Correct |
1 ms |
4956 KB |
Output is correct |
66 |
Correct |
1 ms |
4956 KB |
Output is correct |
67 |
Correct |
335 ms |
63352 KB |
Output is correct |
68 |
Correct |
357 ms |
63912 KB |
Output is correct |
69 |
Correct |
331 ms |
62368 KB |
Output is correct |
70 |
Correct |
4 ms |
5724 KB |
Output is correct |
71 |
Correct |
8 ms |
6236 KB |
Output is correct |
72 |
Correct |
133 ms |
28596 KB |
Output is correct |
73 |
Correct |
212 ms |
40464 KB |
Output is correct |
74 |
Correct |
298 ms |
53500 KB |
Output is correct |
75 |
Correct |
297 ms |
57752 KB |
Output is correct |
76 |
Correct |
353 ms |
63424 KB |
Output is correct |
77 |
Correct |
5 ms |
5976 KB |
Output is correct |
78 |
Correct |
8 ms |
6492 KB |
Output is correct |
79 |
Correct |
148 ms |
29236 KB |
Output is correct |
80 |
Correct |
211 ms |
41764 KB |
Output is correct |
81 |
Correct |
309 ms |
55412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
17 |
Correct |
1 ms |
4956 KB |
Output is correct |
18 |
Correct |
2 ms |
4956 KB |
Output is correct |
19 |
Correct |
2 ms |
4956 KB |
Output is correct |
20 |
Correct |
245 ms |
47848 KB |
Output is correct |
21 |
Correct |
253 ms |
48720 KB |
Output is correct |
22 |
Correct |
260 ms |
47608 KB |
Output is correct |
23 |
Correct |
247 ms |
56260 KB |
Output is correct |
24 |
Correct |
81 ms |
11348 KB |
Output is correct |
25 |
Correct |
229 ms |
47088 KB |
Output is correct |
26 |
Correct |
208 ms |
47908 KB |
Output is correct |
27 |
Correct |
257 ms |
62088 KB |
Output is correct |
28 |
Correct |
263 ms |
61804 KB |
Output is correct |
29 |
Correct |
308 ms |
62224 KB |
Output is correct |
30 |
Correct |
306 ms |
62360 KB |
Output is correct |
31 |
Correct |
1 ms |
4952 KB |
Output is correct |
32 |
Correct |
19 ms |
8404 KB |
Output is correct |
33 |
Correct |
30 ms |
8028 KB |
Output is correct |
34 |
Correct |
252 ms |
49056 KB |
Output is correct |
35 |
Correct |
14 ms |
6492 KB |
Output is correct |
36 |
Correct |
49 ms |
12808 KB |
Output is correct |
37 |
Correct |
105 ms |
20420 KB |
Output is correct |
38 |
Correct |
139 ms |
23376 KB |
Output is correct |
39 |
Correct |
193 ms |
29800 KB |
Output is correct |
40 |
Correct |
264 ms |
38000 KB |
Output is correct |
41 |
Correct |
292 ms |
44012 KB |
Output is correct |
42 |
Correct |
362 ms |
50636 KB |
Output is correct |
43 |
Correct |
1 ms |
4956 KB |
Output is correct |
44 |
Correct |
1 ms |
4956 KB |
Output is correct |
45 |
Correct |
1 ms |
4956 KB |
Output is correct |
46 |
Correct |
1 ms |
4956 KB |
Output is correct |
47 |
Correct |
1 ms |
4956 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
1 ms |
4956 KB |
Output is correct |
52 |
Correct |
1 ms |
4956 KB |
Output is correct |
53 |
Correct |
2 ms |
4956 KB |
Output is correct |
54 |
Correct |
3 ms |
5468 KB |
Output is correct |
55 |
Correct |
4 ms |
5468 KB |
Output is correct |
56 |
Correct |
147 ms |
29032 KB |
Output is correct |
57 |
Correct |
228 ms |
40260 KB |
Output is correct |
58 |
Correct |
234 ms |
40276 KB |
Output is correct |
59 |
Correct |
2 ms |
5108 KB |
Output is correct |
60 |
Correct |
2 ms |
4956 KB |
Output is correct |
61 |
Correct |
2 ms |
4952 KB |
Output is correct |
62 |
Correct |
347 ms |
63876 KB |
Output is correct |
63 |
Correct |
348 ms |
63852 KB |
Output is correct |
64 |
Correct |
353 ms |
63060 KB |
Output is correct |
65 |
Correct |
4 ms |
5720 KB |
Output is correct |
66 |
Correct |
7 ms |
6232 KB |
Output is correct |
67 |
Correct |
138 ms |
28588 KB |
Output is correct |
68 |
Correct |
222 ms |
40448 KB |
Output is correct |
69 |
Correct |
295 ms |
53912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
17 |
Correct |
342 ms |
62996 KB |
Output is correct |
18 |
Correct |
306 ms |
63204 KB |
Output is correct |
19 |
Correct |
270 ms |
55428 KB |
Output is correct |
20 |
Correct |
258 ms |
51064 KB |
Output is correct |
21 |
Correct |
252 ms |
52828 KB |
Output is correct |
22 |
Correct |
1 ms |
4956 KB |
Output is correct |
23 |
Correct |
41 ms |
12760 KB |
Output is correct |
24 |
Correct |
20 ms |
8152 KB |
Output is correct |
25 |
Correct |
73 ms |
16584 KB |
Output is correct |
26 |
Correct |
126 ms |
24256 KB |
Output is correct |
27 |
Correct |
155 ms |
28504 KB |
Output is correct |
28 |
Correct |
223 ms |
34236 KB |
Output is correct |
29 |
Correct |
250 ms |
40904 KB |
Output is correct |
30 |
Correct |
298 ms |
46252 KB |
Output is correct |
31 |
Correct |
334 ms |
52128 KB |
Output is correct |
32 |
Correct |
308 ms |
59332 KB |
Output is correct |
33 |
Correct |
349 ms |
63644 KB |
Output is correct |
34 |
Correct |
5 ms |
5980 KB |
Output is correct |
35 |
Correct |
8 ms |
6492 KB |
Output is correct |
36 |
Correct |
150 ms |
29132 KB |
Output is correct |
37 |
Correct |
219 ms |
41956 KB |
Output is correct |
38 |
Correct |
318 ms |
55488 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4952 KB |
Output is correct |
2 |
Correct |
1 ms |
4956 KB |
Output is correct |
3 |
Correct |
2 ms |
4956 KB |
Output is correct |
4 |
Correct |
1 ms |
4956 KB |
Output is correct |
5 |
Correct |
1 ms |
4956 KB |
Output is correct |
6 |
Correct |
1 ms |
4956 KB |
Output is correct |
7 |
Correct |
1 ms |
4956 KB |
Output is correct |
8 |
Correct |
1 ms |
4956 KB |
Output is correct |
9 |
Correct |
152 ms |
34672 KB |
Output is correct |
10 |
Correct |
12 ms |
8148 KB |
Output is correct |
11 |
Correct |
77 ms |
20816 KB |
Output is correct |
12 |
Correct |
18 ms |
9684 KB |
Output is correct |
13 |
Correct |
44 ms |
14792 KB |
Output is correct |
14 |
Correct |
2 ms |
5212 KB |
Output is correct |
15 |
Correct |
3 ms |
5468 KB |
Output is correct |
16 |
Correct |
167 ms |
35096 KB |
Output is correct |
17 |
Correct |
1 ms |
4952 KB |
Output is correct |
18 |
Correct |
1 ms |
4952 KB |
Output is correct |
19 |
Correct |
2 ms |
4952 KB |
Output is correct |
20 |
Correct |
2 ms |
4956 KB |
Output is correct |
21 |
Correct |
2 ms |
4956 KB |
Output is correct |
22 |
Correct |
1 ms |
4952 KB |
Output is correct |
23 |
Correct |
305 ms |
56852 KB |
Output is correct |
24 |
Correct |
2 ms |
4956 KB |
Output is correct |
25 |
Correct |
2 ms |
5212 KB |
Output is correct |
26 |
Correct |
3 ms |
5468 KB |
Output is correct |
27 |
Correct |
4 ms |
5724 KB |
Output is correct |
28 |
Correct |
116 ms |
25164 KB |
Output is correct |
29 |
Correct |
180 ms |
35128 KB |
Output is correct |
30 |
Correct |
240 ms |
45752 KB |
Output is correct |
31 |
Correct |
307 ms |
55920 KB |
Output is correct |
32 |
Correct |
1 ms |
4952 KB |
Output is correct |
33 |
Correct |
1 ms |
4956 KB |
Output is correct |
34 |
Correct |
1 ms |
4956 KB |
Output is correct |
35 |
Correct |
2 ms |
4944 KB |
Output is correct |
36 |
Correct |
1 ms |
4956 KB |
Output is correct |
37 |
Correct |
1 ms |
4956 KB |
Output is correct |
38 |
Correct |
2 ms |
4956 KB |
Output is correct |
39 |
Correct |
1 ms |
4956 KB |
Output is correct |
40 |
Correct |
1 ms |
4952 KB |
Output is correct |
41 |
Correct |
2 ms |
4956 KB |
Output is correct |
42 |
Correct |
1 ms |
4956 KB |
Output is correct |
43 |
Correct |
3 ms |
5468 KB |
Output is correct |
44 |
Correct |
4 ms |
5468 KB |
Output is correct |
45 |
Correct |
138 ms |
29108 KB |
Output is correct |
46 |
Correct |
213 ms |
40112 KB |
Output is correct |
47 |
Correct |
220 ms |
40276 KB |
Output is correct |
48 |
Correct |
1 ms |
4956 KB |
Output is correct |
49 |
Correct |
1 ms |
4956 KB |
Output is correct |
50 |
Correct |
1 ms |
4956 KB |
Output is correct |
51 |
Correct |
1 ms |
4952 KB |
Output is correct |
52 |
Correct |
1 ms |
4956 KB |
Output is correct |
53 |
Correct |
1 ms |
4956 KB |
Output is correct |
54 |
Correct |
1 ms |
4956 KB |
Output is correct |
55 |
Correct |
274 ms |
54272 KB |
Output is correct |
56 |
Correct |
2 ms |
4952 KB |
Output is correct |
57 |
Correct |
3 ms |
5468 KB |
Output is correct |
58 |
Correct |
7 ms |
6492 KB |
Output is correct |
59 |
Correct |
8 ms |
6748 KB |
Output is correct |
60 |
Correct |
127 ms |
28912 KB |
Output is correct |
61 |
Correct |
179 ms |
37660 KB |
Output is correct |
62 |
Correct |
221 ms |
44716 KB |
Output is correct |
63 |
Correct |
294 ms |
52884 KB |
Output is correct |
64 |
Correct |
1 ms |
4956 KB |
Output is correct |
65 |
Correct |
1 ms |
4956 KB |
Output is correct |
66 |
Correct |
1 ms |
4956 KB |
Output is correct |
67 |
Correct |
335 ms |
63352 KB |
Output is correct |
68 |
Correct |
357 ms |
63912 KB |
Output is correct |
69 |
Correct |
331 ms |
62368 KB |
Output is correct |
70 |
Correct |
4 ms |
5724 KB |
Output is correct |
71 |
Correct |
8 ms |
6236 KB |
Output is correct |
72 |
Correct |
133 ms |
28596 KB |
Output is correct |
73 |
Correct |
212 ms |
40464 KB |
Output is correct |
74 |
Correct |
298 ms |
53500 KB |
Output is correct |
75 |
Correct |
297 ms |
57752 KB |
Output is correct |
76 |
Correct |
353 ms |
63424 KB |
Output is correct |
77 |
Correct |
5 ms |
5976 KB |
Output is correct |
78 |
Correct |
8 ms |
6492 KB |
Output is correct |
79 |
Correct |
148 ms |
29236 KB |
Output is correct |
80 |
Correct |
211 ms |
41764 KB |
Output is correct |
81 |
Correct |
309 ms |
55412 KB |
Output is correct |
82 |
Correct |
1 ms |
4956 KB |
Output is correct |
83 |
Correct |
2 ms |
4956 KB |
Output is correct |
84 |
Correct |
2 ms |
4956 KB |
Output is correct |
85 |
Correct |
245 ms |
47848 KB |
Output is correct |
86 |
Correct |
253 ms |
48720 KB |
Output is correct |
87 |
Correct |
260 ms |
47608 KB |
Output is correct |
88 |
Correct |
247 ms |
56260 KB |
Output is correct |
89 |
Correct |
81 ms |
11348 KB |
Output is correct |
90 |
Correct |
229 ms |
47088 KB |
Output is correct |
91 |
Correct |
208 ms |
47908 KB |
Output is correct |
92 |
Correct |
257 ms |
62088 KB |
Output is correct |
93 |
Correct |
263 ms |
61804 KB |
Output is correct |
94 |
Correct |
308 ms |
62224 KB |
Output is correct |
95 |
Correct |
306 ms |
62360 KB |
Output is correct |
96 |
Correct |
1 ms |
4952 KB |
Output is correct |
97 |
Correct |
19 ms |
8404 KB |
Output is correct |
98 |
Correct |
30 ms |
8028 KB |
Output is correct |
99 |
Correct |
252 ms |
49056 KB |
Output is correct |
100 |
Correct |
14 ms |
6492 KB |
Output is correct |
101 |
Correct |
49 ms |
12808 KB |
Output is correct |
102 |
Correct |
105 ms |
20420 KB |
Output is correct |
103 |
Correct |
139 ms |
23376 KB |
Output is correct |
104 |
Correct |
193 ms |
29800 KB |
Output is correct |
105 |
Correct |
264 ms |
38000 KB |
Output is correct |
106 |
Correct |
292 ms |
44012 KB |
Output is correct |
107 |
Correct |
362 ms |
50636 KB |
Output is correct |
108 |
Correct |
1 ms |
4956 KB |
Output is correct |
109 |
Correct |
1 ms |
4956 KB |
Output is correct |
110 |
Correct |
1 ms |
4956 KB |
Output is correct |
111 |
Correct |
1 ms |
4956 KB |
Output is correct |
112 |
Correct |
1 ms |
4956 KB |
Output is correct |
113 |
Correct |
1 ms |
4956 KB |
Output is correct |
114 |
Correct |
1 ms |
4956 KB |
Output is correct |
115 |
Correct |
1 ms |
4956 KB |
Output is correct |
116 |
Correct |
1 ms |
4956 KB |
Output is correct |
117 |
Correct |
1 ms |
4956 KB |
Output is correct |
118 |
Correct |
2 ms |
4956 KB |
Output is correct |
119 |
Correct |
3 ms |
5468 KB |
Output is correct |
120 |
Correct |
4 ms |
5468 KB |
Output is correct |
121 |
Correct |
147 ms |
29032 KB |
Output is correct |
122 |
Correct |
228 ms |
40260 KB |
Output is correct |
123 |
Correct |
234 ms |
40276 KB |
Output is correct |
124 |
Correct |
2 ms |
5108 KB |
Output is correct |
125 |
Correct |
2 ms |
4956 KB |
Output is correct |
126 |
Correct |
2 ms |
4952 KB |
Output is correct |
127 |
Correct |
347 ms |
63876 KB |
Output is correct |
128 |
Correct |
348 ms |
63852 KB |
Output is correct |
129 |
Correct |
353 ms |
63060 KB |
Output is correct |
130 |
Correct |
4 ms |
5720 KB |
Output is correct |
131 |
Correct |
7 ms |
6232 KB |
Output is correct |
132 |
Correct |
138 ms |
28588 KB |
Output is correct |
133 |
Correct |
222 ms |
40448 KB |
Output is correct |
134 |
Correct |
295 ms |
53912 KB |
Output is correct |
135 |
Correct |
342 ms |
62996 KB |
Output is correct |
136 |
Correct |
306 ms |
63204 KB |
Output is correct |
137 |
Correct |
270 ms |
55428 KB |
Output is correct |
138 |
Correct |
258 ms |
51064 KB |
Output is correct |
139 |
Correct |
252 ms |
52828 KB |
Output is correct |
140 |
Correct |
1 ms |
4956 KB |
Output is correct |
141 |
Correct |
41 ms |
12760 KB |
Output is correct |
142 |
Correct |
20 ms |
8152 KB |
Output is correct |
143 |
Correct |
73 ms |
16584 KB |
Output is correct |
144 |
Correct |
126 ms |
24256 KB |
Output is correct |
145 |
Correct |
155 ms |
28504 KB |
Output is correct |
146 |
Correct |
223 ms |
34236 KB |
Output is correct |
147 |
Correct |
250 ms |
40904 KB |
Output is correct |
148 |
Correct |
298 ms |
46252 KB |
Output is correct |
149 |
Correct |
334 ms |
52128 KB |
Output is correct |
150 |
Correct |
308 ms |
59332 KB |
Output is correct |
151 |
Correct |
349 ms |
63644 KB |
Output is correct |
152 |
Correct |
5 ms |
5980 KB |
Output is correct |
153 |
Correct |
8 ms |
6492 KB |
Output is correct |
154 |
Correct |
150 ms |
29132 KB |
Output is correct |
155 |
Correct |
219 ms |
41956 KB |
Output is correct |
156 |
Correct |
318 ms |
55488 KB |
Output is correct |
157 |
Correct |
1 ms |
4952 KB |
Output is correct |
158 |
Correct |
1 ms |
4956 KB |
Output is correct |
159 |
Correct |
1 ms |
4956 KB |
Output is correct |
160 |
Correct |
3 ms |
5156 KB |
Output is correct |
161 |
Correct |
267 ms |
47224 KB |
Output is correct |
162 |
Correct |
241 ms |
49092 KB |
Output is correct |
163 |
Correct |
228 ms |
48628 KB |
Output is correct |
164 |
Correct |
227 ms |
48544 KB |
Output is correct |
165 |
Correct |
238 ms |
47572 KB |
Output is correct |
166 |
Correct |
251 ms |
47264 KB |
Output is correct |
167 |
Incorrect |
52 ms |
12744 KB |
Solution announced impossible, but it is possible. |
168 |
Halted |
0 ms |
0 KB |
- |