#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
//void build(std::vector<int> u, std::vector<int> v, std::vector<int> a, std::vector<int> b);
struct DSU{
vector<int> par;
int tot;
DSU(int n):tot(n){
par.resize(n);
iota(par.begin(), par.end(), 0);
}
int find(int node){
if (par[node]==node) return node;
return par[node]=find(par[node]);
}
bool merge(int a, int b){
a=find(a);
b=find(b);
if (a!=b) tot--;
else return false;
par[a]=b;
return true;
}
};
int construct_roads(vector<int> x, vector<int> y) {
int n = x.size();
//subtasks 4..5
DSU dsu(n);
map<pair<int,int>,int> mp;
for (int i = 0; i < n; ++i)
{
mp[{x[i],y[i]}]=i;
}
vector<int> u;
vector<int> v;
vector<int> xa(n-1,-1);
vector<int> ya(n-1,-1);
vector<set<pair<int,int>>> arr;
map<pair<int,int>,set<int>> qu;
for (int i = 0; i < n; ++i)
{
if (mp.count({x[i],y[i]-2})){
if (dsu.merge(mp[{x[i],y[i]-2}],i)){
u.push_back(mp[{x[i],y[i]-2}]);
v.push_back(i);
arr.push_back(set<pair<int,int>>());
arr.back().insert({x[i]-1,y[i]-1});
arr.back().insert({x[i]+1,y[i]-1});
qu[{x[i]-1,y[i]-1}].insert((int)u.size()-1);
qu[{x[i]+1,y[i]-1}].insert((int)u.size()-1);
}
}
}
for (int i = 0; i < n; ++i)
{
if (mp.count({x[i]-2,y[i]})){
if (dsu.merge(mp[{x[i]-2,y[i]}],i)){
u.push_back(mp[{x[i]-2,y[i]}]);
v.push_back(i);
arr.push_back(set<pair<int,int>>());
arr.back().insert({x[i]-1,y[i]-1});
arr.back().insert({x[i]-1,y[i]+1});
qu[{x[i]-1,y[i]-1}].insert((int)u.size()-1);
qu[{x[i]-1,y[i]+1}].insert((int)u.size()-1);
}
}
}
if (dsu.tot!=1) return 0;
vector<pair<int,int>> iki;
queue<pair<int,int>> que;
int kal = n-1;
for (auto it : qu){
if (it.second.size()==1) que.push(it.first);
else iki.push_back(it.first);
}
set<pair<int,int>> lmao;
while (kal>0){
while (que.size() && (qu[que.front()].size()<1 || lmao.find(que.front())!=lmao.end())) que.pop();
if (!que.size()){
while (iki.size() && qu[iki.back()].size()<2) iki.pop_back();
if (iki.size()){
int it = *qu[iki.back()].begin();
arr[it].erase(iki.back());
qu[iki.back()].erase(it);
que.push(iki.back());
iki.pop_back();
}
else return 0;
}
if (!que.size()) return 0;
pair<int,int> pr = que.front();
que.pop();
int it = *qu[pr].begin();
if (xa[it]!=-1) continue;
kal--;
lmao.insert(pr);
xa[it]=pr.first, ya[it]=pr.second;
for (auto it2 : arr[it]){
if (qu[it2].find(it)!=qu[it2].end()) qu[it2].erase(it);
if (qu[it2].size()==1) {
que.push(it2);
}
}
while (arr[it].size()) arr[it].erase(arr[it].begin());
}
build(u,v,xa,ya);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
929 ms |
104472 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
1628 KB |
Output is correct |
27 |
Correct |
5 ms |
2140 KB |
Output is correct |
28 |
Correct |
262 ms |
43276 KB |
Output is correct |
29 |
Correct |
500 ms |
62364 KB |
Output is correct |
30 |
Correct |
737 ms |
84400 KB |
Output is correct |
31 |
Correct |
890 ms |
104348 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
388 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
416 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
1628 KB |
Output is correct |
45 |
Correct |
388 ms |
50940 KB |
Output is correct |
46 |
Correct |
569 ms |
74480 KB |
Output is correct |
47 |
Correct |
569 ms |
75100 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
929 ms |
104472 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
1628 KB |
Output is correct |
27 |
Correct |
5 ms |
2140 KB |
Output is correct |
28 |
Correct |
262 ms |
43276 KB |
Output is correct |
29 |
Correct |
500 ms |
62364 KB |
Output is correct |
30 |
Correct |
737 ms |
84400 KB |
Output is correct |
31 |
Correct |
890 ms |
104348 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
388 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
416 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
1628 KB |
Output is correct |
45 |
Correct |
388 ms |
50940 KB |
Output is correct |
46 |
Correct |
569 ms |
74480 KB |
Output is correct |
47 |
Correct |
569 ms |
75100 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
915 ms |
101776 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1104 KB |
Output is correct |
58 |
Correct |
12 ms |
3288 KB |
Output is correct |
59 |
Correct |
14 ms |
4880 KB |
Output is correct |
60 |
Correct |
354 ms |
50956 KB |
Output is correct |
61 |
Correct |
607 ms |
68872 KB |
Output is correct |
62 |
Correct |
754 ms |
84484 KB |
Output is correct |
63 |
Correct |
923 ms |
101836 KB |
Output is correct |
64 |
Correct |
1 ms |
344 KB |
Output is correct |
65 |
Correct |
1 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
344 KB |
Output is correct |
67 |
Correct |
873 ms |
113544 KB |
Output is correct |
68 |
Correct |
853 ms |
113868 KB |
Output is correct |
69 |
Correct |
883 ms |
114128 KB |
Output is correct |
70 |
Correct |
5 ms |
2136 KB |
Output is correct |
71 |
Correct |
10 ms |
4044 KB |
Output is correct |
72 |
Correct |
399 ms |
51704 KB |
Output is correct |
73 |
Correct |
646 ms |
76908 KB |
Output is correct |
74 |
Correct |
1028 ms |
103228 KB |
Output is correct |
75 |
Correct |
914 ms |
107576 KB |
Output is correct |
76 |
Correct |
935 ms |
113928 KB |
Output is correct |
77 |
Correct |
6 ms |
2712 KB |
Output is correct |
78 |
Correct |
11 ms |
4760 KB |
Output is correct |
79 |
Correct |
420 ms |
52676 KB |
Output is correct |
80 |
Correct |
690 ms |
78320 KB |
Output is correct |
81 |
Correct |
951 ms |
102988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
751 ms |
95336 KB |
Output is correct |
21 |
Correct |
805 ms |
96652 KB |
Output is correct |
22 |
Correct |
818 ms |
97012 KB |
Output is correct |
23 |
Correct |
620 ms |
97272 KB |
Output is correct |
24 |
Correct |
143 ms |
18512 KB |
Output is correct |
25 |
Correct |
548 ms |
104556 KB |
Output is correct |
26 |
Correct |
628 ms |
104368 KB |
Output is correct |
27 |
Correct |
817 ms |
114704 KB |
Output is correct |
28 |
Correct |
815 ms |
114308 KB |
Output is correct |
29 |
Correct |
803 ms |
112880 KB |
Output is correct |
30 |
Correct |
778 ms |
113908 KB |
Output is correct |
31 |
Correct |
0 ms |
344 KB |
Output is correct |
32 |
Correct |
34 ms |
7328 KB |
Output is correct |
33 |
Correct |
67 ms |
9560 KB |
Output is correct |
34 |
Correct |
774 ms |
95232 KB |
Output is correct |
35 |
Correct |
13 ms |
4884 KB |
Output is correct |
36 |
Correct |
83 ms |
22684 KB |
Output is correct |
37 |
Correct |
212 ms |
45048 KB |
Output is correct |
38 |
Correct |
284 ms |
41204 KB |
Output is correct |
39 |
Correct |
429 ms |
54064 KB |
Output is correct |
40 |
Correct |
591 ms |
69008 KB |
Output is correct |
41 |
Correct |
814 ms |
87024 KB |
Output is correct |
42 |
Correct |
937 ms |
100648 KB |
Output is correct |
43 |
Correct |
1 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
0 ms |
348 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
344 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
2 ms |
1116 KB |
Output is correct |
55 |
Correct |
3 ms |
1628 KB |
Output is correct |
56 |
Correct |
350 ms |
51960 KB |
Output is correct |
57 |
Correct |
562 ms |
74228 KB |
Output is correct |
58 |
Correct |
561 ms |
74476 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
819 ms |
115164 KB |
Output is correct |
63 |
Correct |
872 ms |
114380 KB |
Output is correct |
64 |
Correct |
871 ms |
114164 KB |
Output is correct |
65 |
Correct |
5 ms |
2140 KB |
Output is correct |
66 |
Correct |
11 ms |
3948 KB |
Output is correct |
67 |
Correct |
414 ms |
51044 KB |
Output is correct |
68 |
Correct |
757 ms |
75904 KB |
Output is correct |
69 |
Correct |
1078 ms |
101596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
17 |
Correct |
858 ms |
114364 KB |
Output is correct |
18 |
Correct |
865 ms |
114160 KB |
Output is correct |
19 |
Correct |
905 ms |
96264 KB |
Output is correct |
20 |
Correct |
988 ms |
99056 KB |
Output is correct |
21 |
Correct |
816 ms |
94700 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
112 ms |
15748 KB |
Output is correct |
24 |
Correct |
31 ms |
9452 KB |
Output is correct |
25 |
Correct |
165 ms |
34824 KB |
Output is correct |
26 |
Correct |
353 ms |
54516 KB |
Output is correct |
27 |
Correct |
427 ms |
49960 KB |
Output is correct |
28 |
Correct |
613 ms |
62732 KB |
Output is correct |
29 |
Correct |
754 ms |
75856 KB |
Output is correct |
30 |
Correct |
928 ms |
87540 KB |
Output is correct |
31 |
Correct |
1053 ms |
100200 KB |
Output is correct |
32 |
Correct |
1002 ms |
106848 KB |
Output is correct |
33 |
Correct |
958 ms |
114716 KB |
Output is correct |
34 |
Correct |
8 ms |
2708 KB |
Output is correct |
35 |
Correct |
12 ms |
4672 KB |
Output is correct |
36 |
Correct |
431 ms |
51708 KB |
Output is correct |
37 |
Correct |
723 ms |
78028 KB |
Output is correct |
38 |
Correct |
1031 ms |
103776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
349 ms |
56716 KB |
Output is correct |
10 |
Correct |
18 ms |
5908 KB |
Output is correct |
11 |
Correct |
130 ms |
30716 KB |
Output is correct |
12 |
Correct |
49 ms |
8716 KB |
Output is correct |
13 |
Correct |
46 ms |
23808 KB |
Output is correct |
14 |
Correct |
1 ms |
856 KB |
Output is correct |
15 |
Correct |
2 ms |
1372 KB |
Output is correct |
16 |
Correct |
330 ms |
58144 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
929 ms |
104472 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
3 ms |
1628 KB |
Output is correct |
27 |
Correct |
5 ms |
2140 KB |
Output is correct |
28 |
Correct |
262 ms |
43276 KB |
Output is correct |
29 |
Correct |
500 ms |
62364 KB |
Output is correct |
30 |
Correct |
737 ms |
84400 KB |
Output is correct |
31 |
Correct |
890 ms |
104348 KB |
Output is correct |
32 |
Correct |
0 ms |
344 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
388 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
416 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
2 ms |
1116 KB |
Output is correct |
44 |
Correct |
5 ms |
1628 KB |
Output is correct |
45 |
Correct |
388 ms |
50940 KB |
Output is correct |
46 |
Correct |
569 ms |
74480 KB |
Output is correct |
47 |
Correct |
569 ms |
75100 KB |
Output is correct |
48 |
Correct |
0 ms |
348 KB |
Output is correct |
49 |
Correct |
0 ms |
348 KB |
Output is correct |
50 |
Correct |
0 ms |
348 KB |
Output is correct |
51 |
Correct |
0 ms |
348 KB |
Output is correct |
52 |
Correct |
0 ms |
348 KB |
Output is correct |
53 |
Correct |
0 ms |
348 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
915 ms |
101776 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
3 ms |
1104 KB |
Output is correct |
58 |
Correct |
12 ms |
3288 KB |
Output is correct |
59 |
Correct |
14 ms |
4880 KB |
Output is correct |
60 |
Correct |
354 ms |
50956 KB |
Output is correct |
61 |
Correct |
607 ms |
68872 KB |
Output is correct |
62 |
Correct |
754 ms |
84484 KB |
Output is correct |
63 |
Correct |
923 ms |
101836 KB |
Output is correct |
64 |
Correct |
1 ms |
344 KB |
Output is correct |
65 |
Correct |
1 ms |
344 KB |
Output is correct |
66 |
Correct |
0 ms |
344 KB |
Output is correct |
67 |
Correct |
873 ms |
113544 KB |
Output is correct |
68 |
Correct |
853 ms |
113868 KB |
Output is correct |
69 |
Correct |
883 ms |
114128 KB |
Output is correct |
70 |
Correct |
5 ms |
2136 KB |
Output is correct |
71 |
Correct |
10 ms |
4044 KB |
Output is correct |
72 |
Correct |
399 ms |
51704 KB |
Output is correct |
73 |
Correct |
646 ms |
76908 KB |
Output is correct |
74 |
Correct |
1028 ms |
103228 KB |
Output is correct |
75 |
Correct |
914 ms |
107576 KB |
Output is correct |
76 |
Correct |
935 ms |
113928 KB |
Output is correct |
77 |
Correct |
6 ms |
2712 KB |
Output is correct |
78 |
Correct |
11 ms |
4760 KB |
Output is correct |
79 |
Correct |
420 ms |
52676 KB |
Output is correct |
80 |
Correct |
690 ms |
78320 KB |
Output is correct |
81 |
Correct |
951 ms |
102988 KB |
Output is correct |
82 |
Correct |
0 ms |
344 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
751 ms |
95336 KB |
Output is correct |
86 |
Correct |
805 ms |
96652 KB |
Output is correct |
87 |
Correct |
818 ms |
97012 KB |
Output is correct |
88 |
Correct |
620 ms |
97272 KB |
Output is correct |
89 |
Correct |
143 ms |
18512 KB |
Output is correct |
90 |
Correct |
548 ms |
104556 KB |
Output is correct |
91 |
Correct |
628 ms |
104368 KB |
Output is correct |
92 |
Correct |
817 ms |
114704 KB |
Output is correct |
93 |
Correct |
815 ms |
114308 KB |
Output is correct |
94 |
Correct |
803 ms |
112880 KB |
Output is correct |
95 |
Correct |
778 ms |
113908 KB |
Output is correct |
96 |
Correct |
0 ms |
344 KB |
Output is correct |
97 |
Correct |
34 ms |
7328 KB |
Output is correct |
98 |
Correct |
67 ms |
9560 KB |
Output is correct |
99 |
Correct |
774 ms |
95232 KB |
Output is correct |
100 |
Correct |
13 ms |
4884 KB |
Output is correct |
101 |
Correct |
83 ms |
22684 KB |
Output is correct |
102 |
Correct |
212 ms |
45048 KB |
Output is correct |
103 |
Correct |
284 ms |
41204 KB |
Output is correct |
104 |
Correct |
429 ms |
54064 KB |
Output is correct |
105 |
Correct |
591 ms |
69008 KB |
Output is correct |
106 |
Correct |
814 ms |
87024 KB |
Output is correct |
107 |
Correct |
937 ms |
100648 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
348 KB |
Output is correct |
110 |
Correct |
0 ms |
348 KB |
Output is correct |
111 |
Correct |
0 ms |
348 KB |
Output is correct |
112 |
Correct |
0 ms |
348 KB |
Output is correct |
113 |
Correct |
0 ms |
348 KB |
Output is correct |
114 |
Correct |
0 ms |
348 KB |
Output is correct |
115 |
Correct |
0 ms |
344 KB |
Output is correct |
116 |
Correct |
0 ms |
348 KB |
Output is correct |
117 |
Correct |
0 ms |
348 KB |
Output is correct |
118 |
Correct |
0 ms |
348 KB |
Output is correct |
119 |
Correct |
2 ms |
1116 KB |
Output is correct |
120 |
Correct |
3 ms |
1628 KB |
Output is correct |
121 |
Correct |
350 ms |
51960 KB |
Output is correct |
122 |
Correct |
562 ms |
74228 KB |
Output is correct |
123 |
Correct |
561 ms |
74476 KB |
Output is correct |
124 |
Correct |
0 ms |
348 KB |
Output is correct |
125 |
Correct |
0 ms |
348 KB |
Output is correct |
126 |
Correct |
0 ms |
348 KB |
Output is correct |
127 |
Correct |
819 ms |
115164 KB |
Output is correct |
128 |
Correct |
872 ms |
114380 KB |
Output is correct |
129 |
Correct |
871 ms |
114164 KB |
Output is correct |
130 |
Correct |
5 ms |
2140 KB |
Output is correct |
131 |
Correct |
11 ms |
3948 KB |
Output is correct |
132 |
Correct |
414 ms |
51044 KB |
Output is correct |
133 |
Correct |
757 ms |
75904 KB |
Output is correct |
134 |
Correct |
1078 ms |
101596 KB |
Output is correct |
135 |
Correct |
858 ms |
114364 KB |
Output is correct |
136 |
Correct |
865 ms |
114160 KB |
Output is correct |
137 |
Correct |
905 ms |
96264 KB |
Output is correct |
138 |
Correct |
988 ms |
99056 KB |
Output is correct |
139 |
Correct |
816 ms |
94700 KB |
Output is correct |
140 |
Correct |
0 ms |
348 KB |
Output is correct |
141 |
Correct |
112 ms |
15748 KB |
Output is correct |
142 |
Correct |
31 ms |
9452 KB |
Output is correct |
143 |
Correct |
165 ms |
34824 KB |
Output is correct |
144 |
Correct |
353 ms |
54516 KB |
Output is correct |
145 |
Correct |
427 ms |
49960 KB |
Output is correct |
146 |
Correct |
613 ms |
62732 KB |
Output is correct |
147 |
Correct |
754 ms |
75856 KB |
Output is correct |
148 |
Correct |
928 ms |
87540 KB |
Output is correct |
149 |
Correct |
1053 ms |
100200 KB |
Output is correct |
150 |
Correct |
1002 ms |
106848 KB |
Output is correct |
151 |
Correct |
958 ms |
114716 KB |
Output is correct |
152 |
Correct |
8 ms |
2708 KB |
Output is correct |
153 |
Correct |
12 ms |
4672 KB |
Output is correct |
154 |
Correct |
431 ms |
51708 KB |
Output is correct |
155 |
Correct |
723 ms |
78028 KB |
Output is correct |
156 |
Correct |
1031 ms |
103776 KB |
Output is correct |
157 |
Correct |
1 ms |
348 KB |
Output is correct |
158 |
Correct |
0 ms |
348 KB |
Output is correct |
159 |
Correct |
0 ms |
348 KB |
Output is correct |
160 |
Correct |
0 ms |
348 KB |
Output is correct |
161 |
Incorrect |
979 ms |
89272 KB |
Solution announced impossible, but it is possible. |
162 |
Halted |
0 ms |
0 KB |
- |