#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
const int MAX_N=2e5+10;
struct point{
int x,y,id;
point(int xx,int yy,int ii){
x=xx;
y=yy;
id=ii;
}
ii coord(){
return ii(x,y);
}
};
struct Road{
int u,v,id;
bool hor;
Road(int uu,int vv,int ii,bool h){
u=uu; v=vv; id=ii; hor=h;
}
};
int pa[MAX_N];
int n;
vector<point> foun;
vector<Road> road;
int X[5]={0,1,0,-1};
int Y[5]={-1,0,1,0};
int ns=0;
void init(int n){
for(int i=0;i<n;i++) pa[i]=i;
ns=n;
}
int findset(int u){
return pa[u]==u?u:pa[u]=findset(pa[u]);
}
bool issameset(int i,int j){
return findset(i)==findset(j);
}
void unionset(int i,int j){
if(!issameset(i,j)){
int u=findset(i),v=findset(j);
pa[u]=v;
ns--;
}
}
set<ii> us;
vector<ii> puntosChoque(int id){
vector<ii> pu;
ii f1=foun[road[id].u].coord();
ii f2=foun[road[id].v].coord();
int x,y;
if(f1.second==f2.second){
x=(f1.first+f2.first)/2;
y=f1.second;
}
else{
x=f1.first;
y=(f1.second+f2.second)/2;
}
for(int i=0;i<4;i++){
int xk=x+X[i];
int yk=y+Y[i];
if(us.find(ii(xk,yk))!=us.end()) continue;
if(ii(xk,yk)!=f1 && ii(xk,yk)!=f2)
pu.push_back(ii(xk,yk));
}
return pu;
}
bool canConnect(point u,point v){
return !issameset(u.id,v.id) && (((u.x==v.x && abs(u.y-v.y)==2)) || ((u.y==v.y && abs(u.x-v.x)==2)));
}
bool don[MAX_N];
bool sortX(point a,point b){
return a.x!=b.x ? a.x<b.x: a.y<b.y;
}
bool sortY(point a,point b){
return a.y!=b.y ? a.y<b.y : a.x<b.x;
}
bool origin(point a,point b){
return a.id<b.id;
}
int be;
map<ii,int> punid;
map<int,ii> idpun;
map<int,vi> conbe;
void choque(int id){
vector<ii> pu=puntosChoque(id);
for(int i=0;i<pu.size();i++){
if(punid.find(pu[i])==punid.end()){
punid[pu[i]]=be;
idpun[id]=pu[i];
be++;
}
conbe[punid[pu[i]]].push_back(id);
}
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
n=x.size();
for(int i=0;i<n;i++){
foun.push_back(point(x[i],y[i],i));
}
init(n);
sort(foun.begin(),foun.end(),sortX);
vector<int> ua,va;
for(int i=0;i<n-1;i++){
if(canConnect(foun[i],foun[i+1])){
unionset(foun[i].id,foun[i+1].id);
ua.push_back(foun[i].id);
va.push_back(foun[i+1].id);
road.push_back(Road(foun[i].id,foun[i+1].id,road.size(),0));
}
}
sort(foun.begin(),foun.end(),sortY);
for(int i=0;i<n-1;i++){
if(canConnect(foun[i],foun[i+1])){
unionset(foun[i].id,foun[i+1].id);
ua.push_back(foun[i].id);
va.push_back(foun[i+1].id);
road.push_back(Road(foun[i].id,foun[i+1].id,road.size(),1));
}
}
sort(foun.begin(),foun.end(),origin);
if(ns!=1) return 0;
be=road.size();
for(int i=0;i<road.size();i++) choque(i);
priority_queue<ii, vector<ii>, greater<ii> > pq;
for(int i=0;i<road.size();i++){
int pro=0;
vector<ii> pu=puntosChoque(i);
for(int j=0;j<pu.size();j++){
int v=punid[pu[j]];
pq.push(ii(conbe[v].size(),i));
}
}
/*for(int i=0;i<road.size();i++){
cout<<road[i].u<<" "<<road[i].v<<endl;
}*/
int t=road.size();
vector<int> a(t),b(t);
while(!pq.empty()){
int i=pq.top().second;
pq.pop();
if(don[i]) continue;
vector<ii> pu=puntosChoque(i);
int iu=0;
//cout<<i<<": \n";
for(int j=0;j<pu.size();j++){
int u=punid[pu[j]];
int vis=0;
//cout<<pu[j].first<<" "<<pu[j].second<<":\n";
for(auto &v:conbe[u]){
// cout<<v<<endl;
if(!don[v]) vis++;
}
if(vis==1){
iu=j;
break;
}
}
don[i]=1;
// cout<<endl;
us.insert(pu[iu]);
a[i]=pu[iu].first; b[i]=pu[iu].second;
for(int j=0;j<pu.size();j++){
int vis=0;
int u=punid[pu[j]];
int id=-1;
for(auto &v:conbe[u]){
if(!don[v]){
id=v;
vis++;
}
}
if(vis!=0){
pq.push(ii(vis,id));
}
}
}
build(ua,va,a,b);
return 1;
}
Compilation message
parks.cpp: In function 'void choque(int)':
parks.cpp:92:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
92 | for(int i=0;i<pu.size();i++){
| ~^~~~~~~~~~
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:129:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Road>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
129 | for(int i=0;i<road.size();i++) choque(i);
| ~^~~~~~~~~~~~
parks.cpp:131:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Road>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
131 | for(int i=0;i<road.size();i++){
| ~^~~~~~~~~~~~
parks.cpp:134: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]
134 | for(int j=0;j<pu.size();j++){
| ~^~~~~~~~~~
parks.cpp:132:9: warning: unused variable 'pro' [-Wunused-variable]
132 | int pro=0;
| ^~~
parks.cpp:151: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]
151 | for(int j=0;j<pu.size();j++){
| ~^~~~~~~~~~
parks.cpp:168: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]
168 | for(int j=0;j<pu.size();j++){
| ~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
308 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1045 ms |
97588 KB |
Output is correct |
24 |
Correct |
1 ms |
212 KB |
Output is correct |
25 |
Correct |
4 ms |
828 KB |
Output is correct |
26 |
Correct |
2 ms |
468 KB |
Output is correct |
27 |
Correct |
3 ms |
596 KB |
Output is correct |
28 |
Correct |
367 ms |
39328 KB |
Output is correct |
29 |
Correct |
593 ms |
58524 KB |
Output is correct |
30 |
Correct |
819 ms |
78228 KB |
Output is correct |
31 |
Correct |
1045 ms |
97568 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
316 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
316 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
448 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
465 ms |
44260 KB |
Output is correct |
46 |
Correct |
698 ms |
64496 KB |
Output is correct |
47 |
Correct |
697 ms |
64440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
308 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1045 ms |
97588 KB |
Output is correct |
24 |
Correct |
1 ms |
212 KB |
Output is correct |
25 |
Correct |
4 ms |
828 KB |
Output is correct |
26 |
Correct |
2 ms |
468 KB |
Output is correct |
27 |
Correct |
3 ms |
596 KB |
Output is correct |
28 |
Correct |
367 ms |
39328 KB |
Output is correct |
29 |
Correct |
593 ms |
58524 KB |
Output is correct |
30 |
Correct |
819 ms |
78228 KB |
Output is correct |
31 |
Correct |
1045 ms |
97568 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
316 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
316 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
448 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
465 ms |
44260 KB |
Output is correct |
46 |
Correct |
698 ms |
64496 KB |
Output is correct |
47 |
Correct |
697 ms |
64440 KB |
Output is correct |
48 |
Correct |
0 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
212 KB |
Output is correct |
51 |
Correct |
1 ms |
312 KB |
Output is correct |
52 |
Correct |
0 ms |
212 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
0 ms |
212 KB |
Output is correct |
55 |
Correct |
1071 ms |
91416 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
5 ms |
1168 KB |
Output is correct |
58 |
Correct |
19 ms |
3064 KB |
Output is correct |
59 |
Correct |
5 ms |
1160 KB |
Output is correct |
60 |
Correct |
479 ms |
45832 KB |
Output is correct |
61 |
Correct |
681 ms |
62116 KB |
Output is correct |
62 |
Correct |
855 ms |
75636 KB |
Output is correct |
63 |
Correct |
1025 ms |
91348 KB |
Output is correct |
64 |
Correct |
0 ms |
212 KB |
Output is correct |
65 |
Correct |
0 ms |
316 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
1037 ms |
114756 KB |
Output is correct |
68 |
Correct |
1065 ms |
114820 KB |
Output is correct |
69 |
Correct |
1018 ms |
113588 KB |
Output is correct |
70 |
Correct |
2 ms |
596 KB |
Output is correct |
71 |
Correct |
4 ms |
968 KB |
Output is correct |
72 |
Correct |
481 ms |
43372 KB |
Output is correct |
73 |
Correct |
745 ms |
65176 KB |
Output is correct |
74 |
Correct |
1041 ms |
86612 KB |
Output is correct |
75 |
Correct |
1018 ms |
98256 KB |
Output is correct |
76 |
Correct |
1105 ms |
114744 KB |
Output is correct |
77 |
Correct |
3 ms |
724 KB |
Output is correct |
78 |
Correct |
5 ms |
1048 KB |
Output is correct |
79 |
Correct |
490 ms |
45188 KB |
Output is correct |
80 |
Correct |
767 ms |
68116 KB |
Output is correct |
81 |
Correct |
1116 ms |
90304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
891 ms |
73468 KB |
Output is correct |
21 |
Correct |
929 ms |
73320 KB |
Output is correct |
22 |
Correct |
928 ms |
73280 KB |
Output is correct |
23 |
Correct |
797 ms |
97020 KB |
Output is correct |
24 |
Correct |
107 ms |
6736 KB |
Output is correct |
25 |
Correct |
113 ms |
14404 KB |
Output is correct |
26 |
Correct |
115 ms |
14400 KB |
Output is correct |
27 |
Correct |
879 ms |
113456 KB |
Output is correct |
28 |
Correct |
865 ms |
113432 KB |
Output is correct |
29 |
Correct |
1027 ms |
113344 KB |
Output is correct |
30 |
Correct |
1042 ms |
113452 KB |
Output is correct |
31 |
Correct |
0 ms |
212 KB |
Output is correct |
32 |
Correct |
60 ms |
6548 KB |
Output is correct |
33 |
Correct |
50 ms |
3696 KB |
Output is correct |
34 |
Correct |
857 ms |
82252 KB |
Output is correct |
35 |
Correct |
6 ms |
1212 KB |
Output is correct |
36 |
Correct |
29 ms |
3940 KB |
Output is correct |
37 |
Correct |
60 ms |
7404 KB |
Output is correct |
38 |
Correct |
473 ms |
33240 KB |
Output is correct |
39 |
Correct |
677 ms |
45076 KB |
Output is correct |
40 |
Correct |
871 ms |
57860 KB |
Output is correct |
41 |
Correct |
1077 ms |
69844 KB |
Output is correct |
42 |
Correct |
1319 ms |
82188 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
312 KB |
Output is correct |
45 |
Correct |
1 ms |
212 KB |
Output is correct |
46 |
Correct |
1 ms |
212 KB |
Output is correct |
47 |
Correct |
1 ms |
308 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
308 KB |
Output is correct |
50 |
Correct |
1 ms |
212 KB |
Output is correct |
51 |
Correct |
1 ms |
212 KB |
Output is correct |
52 |
Correct |
1 ms |
212 KB |
Output is correct |
53 |
Correct |
0 ms |
308 KB |
Output is correct |
54 |
Correct |
1 ms |
468 KB |
Output is correct |
55 |
Correct |
2 ms |
468 KB |
Output is correct |
56 |
Correct |
513 ms |
44404 KB |
Output is correct |
57 |
Correct |
753 ms |
64400 KB |
Output is correct |
58 |
Correct |
735 ms |
64400 KB |
Output is correct |
59 |
Correct |
1 ms |
212 KB |
Output is correct |
60 |
Correct |
1 ms |
212 KB |
Output is correct |
61 |
Correct |
1 ms |
212 KB |
Output is correct |
62 |
Correct |
1086 ms |
114724 KB |
Output is correct |
63 |
Correct |
1157 ms |
114744 KB |
Output is correct |
64 |
Correct |
1085 ms |
113644 KB |
Output is correct |
65 |
Correct |
3 ms |
596 KB |
Output is correct |
66 |
Correct |
5 ms |
964 KB |
Output is correct |
67 |
Correct |
498 ms |
43448 KB |
Output is correct |
68 |
Correct |
860 ms |
65212 KB |
Output is correct |
69 |
Correct |
1104 ms |
86508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
17 |
Correct |
1039 ms |
114168 KB |
Output is correct |
18 |
Correct |
987 ms |
114232 KB |
Output is correct |
19 |
Correct |
892 ms |
73064 KB |
Output is correct |
20 |
Correct |
1053 ms |
84896 KB |
Output is correct |
21 |
Correct |
972 ms |
91900 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
144 ms |
13972 KB |
Output is correct |
24 |
Correct |
12 ms |
1972 KB |
Output is correct |
25 |
Correct |
53 ms |
6476 KB |
Output is correct |
26 |
Correct |
72 ms |
8040 KB |
Output is correct |
27 |
Correct |
595 ms |
42884 KB |
Output is correct |
28 |
Correct |
765 ms |
53580 KB |
Output is correct |
29 |
Correct |
984 ms |
64684 KB |
Output is correct |
30 |
Correct |
1245 ms |
74824 KB |
Output is correct |
31 |
Correct |
1359 ms |
85672 KB |
Output is correct |
32 |
Correct |
1012 ms |
98196 KB |
Output is correct |
33 |
Correct |
1050 ms |
114856 KB |
Output is correct |
34 |
Correct |
3 ms |
724 KB |
Output is correct |
35 |
Correct |
6 ms |
1132 KB |
Output is correct |
36 |
Correct |
464 ms |
45376 KB |
Output is correct |
37 |
Correct |
759 ms |
68260 KB |
Output is correct |
38 |
Correct |
1083 ms |
90284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
531 ms |
58156 KB |
Output is correct |
10 |
Correct |
34 ms |
6156 KB |
Output is correct |
11 |
Correct |
231 ms |
31568 KB |
Output is correct |
12 |
Correct |
57 ms |
9108 KB |
Output is correct |
13 |
Correct |
17 ms |
3744 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
1 ms |
452 KB |
Output is correct |
16 |
Correct |
469 ms |
58264 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
308 KB |
Output is correct |
20 |
Correct |
0 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
1045 ms |
97588 KB |
Output is correct |
24 |
Correct |
1 ms |
212 KB |
Output is correct |
25 |
Correct |
4 ms |
828 KB |
Output is correct |
26 |
Correct |
2 ms |
468 KB |
Output is correct |
27 |
Correct |
3 ms |
596 KB |
Output is correct |
28 |
Correct |
367 ms |
39328 KB |
Output is correct |
29 |
Correct |
593 ms |
58524 KB |
Output is correct |
30 |
Correct |
819 ms |
78228 KB |
Output is correct |
31 |
Correct |
1045 ms |
97568 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
0 ms |
316 KB |
Output is correct |
36 |
Correct |
1 ms |
212 KB |
Output is correct |
37 |
Correct |
0 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
1 ms |
316 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
2 ms |
448 KB |
Output is correct |
44 |
Correct |
2 ms |
580 KB |
Output is correct |
45 |
Correct |
465 ms |
44260 KB |
Output is correct |
46 |
Correct |
698 ms |
64496 KB |
Output is correct |
47 |
Correct |
697 ms |
64440 KB |
Output is correct |
48 |
Correct |
0 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
0 ms |
212 KB |
Output is correct |
51 |
Correct |
1 ms |
312 KB |
Output is correct |
52 |
Correct |
0 ms |
212 KB |
Output is correct |
53 |
Correct |
1 ms |
212 KB |
Output is correct |
54 |
Correct |
0 ms |
212 KB |
Output is correct |
55 |
Correct |
1071 ms |
91416 KB |
Output is correct |
56 |
Correct |
1 ms |
212 KB |
Output is correct |
57 |
Correct |
5 ms |
1168 KB |
Output is correct |
58 |
Correct |
19 ms |
3064 KB |
Output is correct |
59 |
Correct |
5 ms |
1160 KB |
Output is correct |
60 |
Correct |
479 ms |
45832 KB |
Output is correct |
61 |
Correct |
681 ms |
62116 KB |
Output is correct |
62 |
Correct |
855 ms |
75636 KB |
Output is correct |
63 |
Correct |
1025 ms |
91348 KB |
Output is correct |
64 |
Correct |
0 ms |
212 KB |
Output is correct |
65 |
Correct |
0 ms |
316 KB |
Output is correct |
66 |
Correct |
0 ms |
212 KB |
Output is correct |
67 |
Correct |
1037 ms |
114756 KB |
Output is correct |
68 |
Correct |
1065 ms |
114820 KB |
Output is correct |
69 |
Correct |
1018 ms |
113588 KB |
Output is correct |
70 |
Correct |
2 ms |
596 KB |
Output is correct |
71 |
Correct |
4 ms |
968 KB |
Output is correct |
72 |
Correct |
481 ms |
43372 KB |
Output is correct |
73 |
Correct |
745 ms |
65176 KB |
Output is correct |
74 |
Correct |
1041 ms |
86612 KB |
Output is correct |
75 |
Correct |
1018 ms |
98256 KB |
Output is correct |
76 |
Correct |
1105 ms |
114744 KB |
Output is correct |
77 |
Correct |
3 ms |
724 KB |
Output is correct |
78 |
Correct |
5 ms |
1048 KB |
Output is correct |
79 |
Correct |
490 ms |
45188 KB |
Output is correct |
80 |
Correct |
767 ms |
68116 KB |
Output is correct |
81 |
Correct |
1116 ms |
90304 KB |
Output is correct |
82 |
Correct |
1 ms |
212 KB |
Output is correct |
83 |
Correct |
0 ms |
212 KB |
Output is correct |
84 |
Correct |
1 ms |
212 KB |
Output is correct |
85 |
Correct |
891 ms |
73468 KB |
Output is correct |
86 |
Correct |
929 ms |
73320 KB |
Output is correct |
87 |
Correct |
928 ms |
73280 KB |
Output is correct |
88 |
Correct |
797 ms |
97020 KB |
Output is correct |
89 |
Correct |
107 ms |
6736 KB |
Output is correct |
90 |
Correct |
113 ms |
14404 KB |
Output is correct |
91 |
Correct |
115 ms |
14400 KB |
Output is correct |
92 |
Correct |
879 ms |
113456 KB |
Output is correct |
93 |
Correct |
865 ms |
113432 KB |
Output is correct |
94 |
Correct |
1027 ms |
113344 KB |
Output is correct |
95 |
Correct |
1042 ms |
113452 KB |
Output is correct |
96 |
Correct |
0 ms |
212 KB |
Output is correct |
97 |
Correct |
60 ms |
6548 KB |
Output is correct |
98 |
Correct |
50 ms |
3696 KB |
Output is correct |
99 |
Correct |
857 ms |
82252 KB |
Output is correct |
100 |
Correct |
6 ms |
1212 KB |
Output is correct |
101 |
Correct |
29 ms |
3940 KB |
Output is correct |
102 |
Correct |
60 ms |
7404 KB |
Output is correct |
103 |
Correct |
473 ms |
33240 KB |
Output is correct |
104 |
Correct |
677 ms |
45076 KB |
Output is correct |
105 |
Correct |
871 ms |
57860 KB |
Output is correct |
106 |
Correct |
1077 ms |
69844 KB |
Output is correct |
107 |
Correct |
1319 ms |
82188 KB |
Output is correct |
108 |
Correct |
1 ms |
212 KB |
Output is correct |
109 |
Correct |
1 ms |
312 KB |
Output is correct |
110 |
Correct |
1 ms |
212 KB |
Output is correct |
111 |
Correct |
1 ms |
212 KB |
Output is correct |
112 |
Correct |
1 ms |
308 KB |
Output is correct |
113 |
Correct |
1 ms |
212 KB |
Output is correct |
114 |
Correct |
1 ms |
308 KB |
Output is correct |
115 |
Correct |
1 ms |
212 KB |
Output is correct |
116 |
Correct |
1 ms |
212 KB |
Output is correct |
117 |
Correct |
1 ms |
212 KB |
Output is correct |
118 |
Correct |
0 ms |
308 KB |
Output is correct |
119 |
Correct |
1 ms |
468 KB |
Output is correct |
120 |
Correct |
2 ms |
468 KB |
Output is correct |
121 |
Correct |
513 ms |
44404 KB |
Output is correct |
122 |
Correct |
753 ms |
64400 KB |
Output is correct |
123 |
Correct |
735 ms |
64400 KB |
Output is correct |
124 |
Correct |
1 ms |
212 KB |
Output is correct |
125 |
Correct |
1 ms |
212 KB |
Output is correct |
126 |
Correct |
1 ms |
212 KB |
Output is correct |
127 |
Correct |
1086 ms |
114724 KB |
Output is correct |
128 |
Correct |
1157 ms |
114744 KB |
Output is correct |
129 |
Correct |
1085 ms |
113644 KB |
Output is correct |
130 |
Correct |
3 ms |
596 KB |
Output is correct |
131 |
Correct |
5 ms |
964 KB |
Output is correct |
132 |
Correct |
498 ms |
43448 KB |
Output is correct |
133 |
Correct |
860 ms |
65212 KB |
Output is correct |
134 |
Correct |
1104 ms |
86508 KB |
Output is correct |
135 |
Correct |
1039 ms |
114168 KB |
Output is correct |
136 |
Correct |
987 ms |
114232 KB |
Output is correct |
137 |
Correct |
892 ms |
73064 KB |
Output is correct |
138 |
Correct |
1053 ms |
84896 KB |
Output is correct |
139 |
Correct |
972 ms |
91900 KB |
Output is correct |
140 |
Correct |
0 ms |
212 KB |
Output is correct |
141 |
Correct |
144 ms |
13972 KB |
Output is correct |
142 |
Correct |
12 ms |
1972 KB |
Output is correct |
143 |
Correct |
53 ms |
6476 KB |
Output is correct |
144 |
Correct |
72 ms |
8040 KB |
Output is correct |
145 |
Correct |
595 ms |
42884 KB |
Output is correct |
146 |
Correct |
765 ms |
53580 KB |
Output is correct |
147 |
Correct |
984 ms |
64684 KB |
Output is correct |
148 |
Correct |
1245 ms |
74824 KB |
Output is correct |
149 |
Correct |
1359 ms |
85672 KB |
Output is correct |
150 |
Correct |
1012 ms |
98196 KB |
Output is correct |
151 |
Correct |
1050 ms |
114856 KB |
Output is correct |
152 |
Correct |
3 ms |
724 KB |
Output is correct |
153 |
Correct |
6 ms |
1132 KB |
Output is correct |
154 |
Correct |
464 ms |
45376 KB |
Output is correct |
155 |
Correct |
759 ms |
68260 KB |
Output is correct |
156 |
Correct |
1083 ms |
90284 KB |
Output is correct |
157 |
Correct |
1 ms |
212 KB |
Output is correct |
158 |
Correct |
1 ms |
212 KB |
Output is correct |
159 |
Correct |
1 ms |
212 KB |
Output is correct |
160 |
Correct |
1 ms |
312 KB |
Output is correct |
161 |
Correct |
1170 ms |
79196 KB |
Output is correct |
162 |
Correct |
981 ms |
82272 KB |
Output is correct |
163 |
Correct |
941 ms |
75404 KB |
Output is correct |
164 |
Correct |
833 ms |
75636 KB |
Output is correct |
165 |
Correct |
873 ms |
78188 KB |
Output is correct |
166 |
Correct |
843 ms |
78796 KB |
Output is correct |
167 |
Runtime error |
184 ms |
35104 KB |
Execution killed with signal 11 |
168 |
Halted |
0 ms |
0 KB |
- |