답안 #614378

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
614378 2022-07-31T02:38:37 Z DanerZein 분수 공원 (IOI21_parks) C++17
70 / 100
1372 ms 114724 KB
#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);
    if(pu.empty()) return 0;
    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==1){
	pq.push(ii(1,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:152: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]
  152 |     for(int j=0;j<pu.size();j++){
      |                 ~^~~~~~~~~~
parks.cpp:169: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]
  169 |     for(int j=0;j<pu.size();j++){
      |                 ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 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 1173 ms 97416 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 4 ms 800 KB Output is correct
26 Correct 2 ms 468 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 407 ms 39216 KB Output is correct
29 Correct 629 ms 58432 KB Output is correct
30 Correct 861 ms 78260 KB Output is correct
31 Correct 1092 ms 97420 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 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 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 2 ms 468 KB Output is correct
45 Correct 468 ms 44192 KB Output is correct
46 Correct 715 ms 64316 KB Output is correct
47 Correct 734 ms 64272 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 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 1173 ms 97416 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 4 ms 800 KB Output is correct
26 Correct 2 ms 468 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 407 ms 39216 KB Output is correct
29 Correct 629 ms 58432 KB Output is correct
30 Correct 861 ms 78260 KB Output is correct
31 Correct 1092 ms 97420 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 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 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 2 ms 468 KB Output is correct
45 Correct 468 ms 44192 KB Output is correct
46 Correct 715 ms 64316 KB Output is correct
47 Correct 734 ms 64272 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 1096 ms 91276 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 5 ms 1108 KB Output is correct
58 Correct 23 ms 3156 KB Output is correct
59 Correct 5 ms 1048 KB Output is correct
60 Correct 465 ms 45700 KB Output is correct
61 Correct 679 ms 62100 KB Output is correct
62 Correct 857 ms 75732 KB Output is correct
63 Correct 1062 ms 91228 KB Output is correct
64 Correct 0 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 0 ms 212 KB Output is correct
67 Correct 1137 ms 114588 KB Output is correct
68 Correct 1061 ms 114620 KB Output is correct
69 Correct 1100 ms 113460 KB Output is correct
70 Correct 3 ms 596 KB Output is correct
71 Correct 4 ms 852 KB Output is correct
72 Correct 489 ms 43348 KB Output is correct
73 Correct 760 ms 65076 KB Output is correct
74 Correct 1080 ms 86540 KB Output is correct
75 Correct 1022 ms 98124 KB Output is correct
76 Correct 1093 ms 114588 KB Output is correct
77 Correct 3 ms 724 KB Output is correct
78 Correct 4 ms 1048 KB Output is correct
79 Correct 480 ms 45236 KB Output is correct
80 Correct 749 ms 68104 KB Output is correct
81 Correct 1040 ms 90340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 912 ms 73144 KB Output is correct
21 Correct 895 ms 73084 KB Output is correct
22 Correct 904 ms 73104 KB Output is correct
23 Correct 800 ms 96828 KB Output is correct
24 Correct 110 ms 6696 KB Output is correct
25 Correct 118 ms 14272 KB Output is correct
26 Correct 123 ms 14264 KB Output is correct
27 Correct 926 ms 113316 KB Output is correct
28 Correct 848 ms 113324 KB Output is correct
29 Correct 1062 ms 113364 KB Output is correct
30 Correct 1040 ms 113320 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 62 ms 6396 KB Output is correct
33 Correct 47 ms 3532 KB Output is correct
34 Correct 888 ms 81756 KB Output is correct
35 Correct 5 ms 1048 KB Output is correct
36 Correct 29 ms 3792 KB Output is correct
37 Correct 61 ms 7280 KB Output is correct
38 Correct 491 ms 33116 KB Output is correct
39 Correct 689 ms 45044 KB Output is correct
40 Correct 897 ms 57524 KB Output is correct
41 Correct 1124 ms 69724 KB Output is correct
42 Correct 1305 ms 81864 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 0 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 0 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 2 ms 468 KB Output is correct
56 Correct 484 ms 44196 KB Output is correct
57 Correct 718 ms 64312 KB Output is correct
58 Correct 722 ms 64372 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 1061 ms 114724 KB Output is correct
63 Correct 1050 ms 114588 KB Output is correct
64 Correct 1048 ms 113404 KB Output is correct
65 Correct 2 ms 596 KB Output is correct
66 Correct 4 ms 852 KB Output is correct
67 Correct 486 ms 43256 KB Output is correct
68 Correct 779 ms 65028 KB Output is correct
69 Correct 1045 ms 86444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
17 Correct 1022 ms 114008 KB Output is correct
18 Correct 1065 ms 114112 KB Output is correct
19 Correct 898 ms 72988 KB Output is correct
20 Correct 1070 ms 84760 KB Output is correct
21 Correct 969 ms 91780 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 157 ms 13900 KB Output is correct
24 Correct 13 ms 1876 KB Output is correct
25 Correct 55 ms 6364 KB Output is correct
26 Correct 72 ms 7876 KB Output is correct
27 Correct 604 ms 42904 KB Output is correct
28 Correct 853 ms 53424 KB Output is correct
29 Correct 997 ms 64560 KB Output is correct
30 Correct 1219 ms 74708 KB Output is correct
31 Correct 1372 ms 85652 KB Output is correct
32 Correct 1097 ms 98116 KB Output is correct
33 Correct 1136 ms 114616 KB Output is correct
34 Correct 3 ms 724 KB Output is correct
35 Correct 4 ms 1048 KB Output is correct
36 Correct 554 ms 45176 KB Output is correct
37 Correct 776 ms 67992 KB Output is correct
38 Correct 1097 ms 90260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 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 527 ms 58008 KB Output is correct
10 Correct 33 ms 6056 KB Output is correct
11 Correct 251 ms 31348 KB Output is correct
12 Correct 57 ms 8964 KB Output is correct
13 Correct 16 ms 3660 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 2 ms 340 KB Output is correct
16 Correct 508 ms 57988 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 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 1173 ms 97416 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 4 ms 800 KB Output is correct
26 Correct 2 ms 468 KB Output is correct
27 Correct 3 ms 596 KB Output is correct
28 Correct 407 ms 39216 KB Output is correct
29 Correct 629 ms 58432 KB Output is correct
30 Correct 861 ms 78260 KB Output is correct
31 Correct 1092 ms 97420 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 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 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 2 ms 468 KB Output is correct
45 Correct 468 ms 44192 KB Output is correct
46 Correct 715 ms 64316 KB Output is correct
47 Correct 734 ms 64272 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 1096 ms 91276 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 5 ms 1108 KB Output is correct
58 Correct 23 ms 3156 KB Output is correct
59 Correct 5 ms 1048 KB Output is correct
60 Correct 465 ms 45700 KB Output is correct
61 Correct 679 ms 62100 KB Output is correct
62 Correct 857 ms 75732 KB Output is correct
63 Correct 1062 ms 91228 KB Output is correct
64 Correct 0 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 0 ms 212 KB Output is correct
67 Correct 1137 ms 114588 KB Output is correct
68 Correct 1061 ms 114620 KB Output is correct
69 Correct 1100 ms 113460 KB Output is correct
70 Correct 3 ms 596 KB Output is correct
71 Correct 4 ms 852 KB Output is correct
72 Correct 489 ms 43348 KB Output is correct
73 Correct 760 ms 65076 KB Output is correct
74 Correct 1080 ms 86540 KB Output is correct
75 Correct 1022 ms 98124 KB Output is correct
76 Correct 1093 ms 114588 KB Output is correct
77 Correct 3 ms 724 KB Output is correct
78 Correct 4 ms 1048 KB Output is correct
79 Correct 480 ms 45236 KB Output is correct
80 Correct 749 ms 68104 KB Output is correct
81 Correct 1040 ms 90340 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 0 ms 212 KB Output is correct
84 Correct 0 ms 212 KB Output is correct
85 Correct 912 ms 73144 KB Output is correct
86 Correct 895 ms 73084 KB Output is correct
87 Correct 904 ms 73104 KB Output is correct
88 Correct 800 ms 96828 KB Output is correct
89 Correct 110 ms 6696 KB Output is correct
90 Correct 118 ms 14272 KB Output is correct
91 Correct 123 ms 14264 KB Output is correct
92 Correct 926 ms 113316 KB Output is correct
93 Correct 848 ms 113324 KB Output is correct
94 Correct 1062 ms 113364 KB Output is correct
95 Correct 1040 ms 113320 KB Output is correct
96 Correct 0 ms 212 KB Output is correct
97 Correct 62 ms 6396 KB Output is correct
98 Correct 47 ms 3532 KB Output is correct
99 Correct 888 ms 81756 KB Output is correct
100 Correct 5 ms 1048 KB Output is correct
101 Correct 29 ms 3792 KB Output is correct
102 Correct 61 ms 7280 KB Output is correct
103 Correct 491 ms 33116 KB Output is correct
104 Correct 689 ms 45044 KB Output is correct
105 Correct 897 ms 57524 KB Output is correct
106 Correct 1124 ms 69724 KB Output is correct
107 Correct 1305 ms 81864 KB Output is correct
108 Correct 1 ms 212 KB Output is correct
109 Correct 0 ms 212 KB Output is correct
110 Correct 1 ms 212 KB Output is correct
111 Correct 0 ms 212 KB Output is correct
112 Correct 1 ms 212 KB Output is correct
113 Correct 0 ms 212 KB Output is correct
114 Correct 0 ms 212 KB Output is correct
115 Correct 0 ms 212 KB Output is correct
116 Correct 0 ms 212 KB Output is correct
117 Correct 0 ms 212 KB Output is correct
118 Correct 0 ms 212 KB Output is correct
119 Correct 1 ms 340 KB Output is correct
120 Correct 2 ms 468 KB Output is correct
121 Correct 484 ms 44196 KB Output is correct
122 Correct 718 ms 64312 KB Output is correct
123 Correct 722 ms 64372 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 1061 ms 114724 KB Output is correct
128 Correct 1050 ms 114588 KB Output is correct
129 Correct 1048 ms 113404 KB Output is correct
130 Correct 2 ms 596 KB Output is correct
131 Correct 4 ms 852 KB Output is correct
132 Correct 486 ms 43256 KB Output is correct
133 Correct 779 ms 65028 KB Output is correct
134 Correct 1045 ms 86444 KB Output is correct
135 Correct 1022 ms 114008 KB Output is correct
136 Correct 1065 ms 114112 KB Output is correct
137 Correct 898 ms 72988 KB Output is correct
138 Correct 1070 ms 84760 KB Output is correct
139 Correct 969 ms 91780 KB Output is correct
140 Correct 0 ms 212 KB Output is correct
141 Correct 157 ms 13900 KB Output is correct
142 Correct 13 ms 1876 KB Output is correct
143 Correct 55 ms 6364 KB Output is correct
144 Correct 72 ms 7876 KB Output is correct
145 Correct 604 ms 42904 KB Output is correct
146 Correct 853 ms 53424 KB Output is correct
147 Correct 997 ms 64560 KB Output is correct
148 Correct 1219 ms 74708 KB Output is correct
149 Correct 1372 ms 85652 KB Output is correct
150 Correct 1097 ms 98116 KB Output is correct
151 Correct 1136 ms 114616 KB Output is correct
152 Correct 3 ms 724 KB Output is correct
153 Correct 4 ms 1048 KB Output is correct
154 Correct 554 ms 45176 KB Output is correct
155 Correct 776 ms 67992 KB Output is correct
156 Correct 1097 ms 90260 KB Output is correct
157 Correct 1 ms 212 KB Output is correct
158 Correct 0 ms 212 KB Output is correct
159 Correct 0 ms 212 KB Output is correct
160 Correct 0 ms 212 KB Output is correct
161 Correct 1064 ms 79100 KB Output is correct
162 Correct 895 ms 81780 KB Output is correct
163 Correct 866 ms 75128 KB Output is correct
164 Correct 841 ms 75180 KB Output is correct
165 Correct 892 ms 77800 KB Output is correct
166 Correct 858 ms 78628 KB Output is correct
167 Incorrect 217 ms 17292 KB Solution announced impossible, but it is possible.
168 Halted 0 ms 0 KB -