Submission #435500

# Submission time Handle Problem Language Result Execution time Memory
435500 2021-06-23T11:31:14 Z kshitij_sodani Fountain Parks (IOI21_parks) C++17
70 / 100
2227 ms 168692 KB
#include <bits/stdc++.h>
using namespace std;
#define a first
#define b second
#define pb push_back
typedef long long llo;

#include "parks.h"
int par[300001];
int ss[300001];
int find(int no){
	if(par[no]==no){
		return no;
	}
	par[no]=find(par[no]);
	return par[no];
}
map<pair<int,int>,int> mid;
map<int,pair<int,int>> mid2;
int ind5=-1;
void add(int i,int j){
	if(mid.find({i,j})==mid.end()){
		//ind5++;
		mid[{i,j}]=ind5;
		mid2[ind5]={i,j};
		ind5++;
	}
}
vector<int> adj2[2000001];
int dd[2000001];
int vis[2000001];
//vector<int> adj3[300001];
int construct_roads(vector<int> x, std::vector<int> y) {
    int n=x.size();

   // sort(y,y+n);
   	vector<int> uu, vv, aa, bb;
   	vector<pair<int,int>> zz;
   	map<pair<int,int>,int> xx;
   	for(int i=0;i<n;i++){
   		xx[{x[i],y[i]}]=i;
   		par[i]=i;
   	}
   	map<pair<int,int>,int> kk;
   	for(int i=0;i<n;i++){
   		if(xx.find({x[i],y[i]+2})!=xx.end()){
   			int x1=find(i);
   			int y1=find(xx[{x[i],y[i]+2}]);
   			if(x1!=y1){
   				par[x1]=y1;
   				uu.pb(i);
   				vv.pb(xx[{x[i],y[i]+2}]);
   				
   			}
   		}
   	}
   	for(int i=0;i<n;i++){
   		if(xx.find({x[i]+2,y[i]})!=xx.end()){
   			int x1=find(i);
   			int y1=find(xx[{x[i]+2,y[i]}]);
   			if(x1!=y1){
   				par[x1]=y1;
   				uu.pb(i);
   				vv.pb(xx[{x[i]+2,y[i]}]);
   			}
   		}
   	}


   	for(int i=0;i<n;i++){
   		par[i]=find(i);
   	}

   	for(int i=0;i<n;i++){
   		if(par[i]!=par[0]){
   			return 0;
   		}
   	}
   	ind5=uu.size();
   	for(int i=0;i<uu.size();i++){
   		aa.pb(-1);
   		bb.pb(-1);
   		if(x[uu[i]]+2==x[vv[i]]){
   			//
   			add(x[uu[i]]+1,y[uu[i]]+1);
   			add(x[uu[i]]+1,y[uu[i]]-1);
   			adj2[i].pb(mid[{x[uu[i]]+1,y[uu[i]]+1}]);
   			//adj2[mid[{x[uu[i]]+1,y[uu[i]]+1}]].pb(i);
   			adj2[i].pb(mid[{x[uu[i]]+1,y[uu[i]]-1}]);
   			//adj2[mid[{x[uu[i]]+1,y[uu[i]]-1}]].pb(i);
   		}
   		else{
   			add(x[uu[i]]+1,y[uu[i]]+1);
   			add(x[uu[i]]-1,y[uu[i]]+1);
   			adj2[i].pb(mid[{x[uu[i]]+1,y[uu[i]]+1}]);
   			adj2[i].pb(mid[{x[uu[i]]-1,y[uu[i]]+1}]);
   		}
   	}
   	for(int i=0;i<uu.size();i++){
   		for(auto j:adj2[i]){
   			adj2[j].pb(i);
   		}
   	}
   	set<pair<int,int>> ee;
   	for(int i=0;i<ind5;i++){
   		if(adj2[i].size()==0){
   			return 0;
   		}
   		dd[i]=adj2[i].size();
   		ee.insert({adj2[i].size(),i});
   	}
   	while(ee.size()){
   		pair<int,int> no=*ee.begin();
   		if(no.a==0){
   			if(no.b<uu.size()){
   				return 0;
   			}
   			ee.erase(no);
   			vis[no.b]=1;
   			continue;
   		}
   		int st=-1;
   		for(auto j:adj2[no.b]){
   			if(vis[j]==0){
   				st=j;
   			}
   		}
   		vis[st]=1;
   		vis[no.b]=1;
   		ee.erase({dd[no.b],no.b});
   		ee.erase({dd[st],st});
   		int ac=no.b;
   		int bc=st;
   		if(ac>bc){
   			swap(ac,bc);
   		}
   		aa[ac]=mid2[bc].a;
   		bb[ac]=mid2[bc].b;
   		for(auto j:adj2[no.b]){
   			if(vis[j]==0){
   				ee.erase({dd[j],j});
   				dd[j]--;

   				ee.insert({dd[j],j});
   			}
   		}
   		for(auto j:adj2[st]){
   			if(vis[j]==0){
   				ee.erase({dd[j],j});
   				dd[j]--;

   				ee.insert({dd[j],j});
   			}
   		}
   	}

  /* 	for(int i=0;i<n;i++){
   		zz.pb({y[i],i});
   	}
   	sort(zz.begin(),zz.end());
   	for(int i=0;i<n-1;i++){
   		if(zz[i+1].a-zz[i].a>2){
   			return 0;
   		}
   		uu.pb(zz[i].b);
   		vv.pb(zz[i+1].b);
   		aa.pb(1);
   		bb.pb(zz[i].a+1);
   	}*/
   	build(uu,vv,aa,bb);

   	return 1;
    /*if (x.size() == 1)
        return 0;
    
    u.push_back(0);
    v.push_back(1);
    a.push_back(x[0]+1);
    b.push_back(y[0]-1);
    build(u, v, a, b);
    return 1;*/
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:80:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |     for(int i=0;i<uu.size();i++){
      |                 ~^~~~~~~~~~
parks.cpp:99:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   99 |     for(int i=0;i<uu.size();i++){
      |                 ~^~~~~~~~~~
parks.cpp:115:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |       if(no.b<uu.size()){
      |          ~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
17 Correct 28 ms 47240 KB Output is correct
18 Correct 29 ms 47180 KB Output is correct
19 Correct 31 ms 47216 KB Output is correct
20 Correct 30 ms 47172 KB Output is correct
21 Correct 30 ms 47284 KB Output is correct
22 Correct 29 ms 47176 KB Output is correct
23 Correct 2008 ms 147560 KB Output is correct
24 Correct 30 ms 47192 KB Output is correct
25 Correct 34 ms 48004 KB Output is correct
26 Correct 31 ms 47488 KB Output is correct
27 Correct 36 ms 47588 KB Output is correct
28 Correct 670 ms 87392 KB Output is correct
29 Correct 1080 ms 107588 KB Output is correct
30 Correct 1460 ms 127428 KB Output is correct
31 Correct 2031 ms 147492 KB Output is correct
32 Correct 29 ms 47180 KB Output is correct
33 Correct 28 ms 47204 KB Output is correct
34 Correct 36 ms 47180 KB Output is correct
35 Correct 30 ms 47180 KB Output is correct
36 Correct 31 ms 47180 KB Output is correct
37 Correct 28 ms 47272 KB Output is correct
38 Correct 29 ms 47168 KB Output is correct
39 Correct 29 ms 47224 KB Output is correct
40 Correct 37 ms 47220 KB Output is correct
41 Correct 30 ms 47316 KB Output is correct
42 Correct 29 ms 47172 KB Output is correct
43 Correct 31 ms 47360 KB Output is correct
44 Correct 30 ms 47564 KB Output is correct
45 Correct 751 ms 94768 KB Output is correct
46 Correct 1249 ms 116244 KB Output is correct
47 Correct 1439 ms 116172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
17 Correct 28 ms 47240 KB Output is correct
18 Correct 29 ms 47180 KB Output is correct
19 Correct 31 ms 47216 KB Output is correct
20 Correct 30 ms 47172 KB Output is correct
21 Correct 30 ms 47284 KB Output is correct
22 Correct 29 ms 47176 KB Output is correct
23 Correct 2008 ms 147560 KB Output is correct
24 Correct 30 ms 47192 KB Output is correct
25 Correct 34 ms 48004 KB Output is correct
26 Correct 31 ms 47488 KB Output is correct
27 Correct 36 ms 47588 KB Output is correct
28 Correct 670 ms 87392 KB Output is correct
29 Correct 1080 ms 107588 KB Output is correct
30 Correct 1460 ms 127428 KB Output is correct
31 Correct 2031 ms 147492 KB Output is correct
32 Correct 29 ms 47180 KB Output is correct
33 Correct 28 ms 47204 KB Output is correct
34 Correct 36 ms 47180 KB Output is correct
35 Correct 30 ms 47180 KB Output is correct
36 Correct 31 ms 47180 KB Output is correct
37 Correct 28 ms 47272 KB Output is correct
38 Correct 29 ms 47168 KB Output is correct
39 Correct 29 ms 47224 KB Output is correct
40 Correct 37 ms 47220 KB Output is correct
41 Correct 30 ms 47316 KB Output is correct
42 Correct 29 ms 47172 KB Output is correct
43 Correct 31 ms 47360 KB Output is correct
44 Correct 30 ms 47564 KB Output is correct
45 Correct 751 ms 94768 KB Output is correct
46 Correct 1249 ms 116244 KB Output is correct
47 Correct 1439 ms 116172 KB Output is correct
48 Correct 27 ms 47252 KB Output is correct
49 Correct 29 ms 47200 KB Output is correct
50 Correct 33 ms 47268 KB Output is correct
51 Correct 30 ms 47148 KB Output is correct
52 Correct 29 ms 47180 KB Output is correct
53 Correct 28 ms 47228 KB Output is correct
54 Correct 29 ms 47188 KB Output is correct
55 Correct 2063 ms 140344 KB Output is correct
56 Correct 30 ms 47180 KB Output is correct
57 Correct 36 ms 48108 KB Output is correct
58 Correct 58 ms 50048 KB Output is correct
59 Correct 41 ms 48192 KB Output is correct
60 Correct 847 ms 93844 KB Output is correct
61 Correct 1202 ms 110160 KB Output is correct
62 Correct 1653 ms 124164 KB Output is correct
63 Correct 2035 ms 140416 KB Output is correct
64 Correct 32 ms 47224 KB Output is correct
65 Correct 29 ms 47180 KB Output is correct
66 Correct 33 ms 47180 KB Output is correct
67 Correct 1670 ms 168536 KB Output is correct
68 Correct 1633 ms 168504 KB Output is correct
69 Correct 1805 ms 167988 KB Output is correct
70 Correct 33 ms 47564 KB Output is correct
71 Correct 37 ms 47948 KB Output is correct
72 Correct 888 ms 93760 KB Output is correct
73 Correct 1297 ms 116988 KB Output is correct
74 Correct 2016 ms 140448 KB Output is correct
75 Correct 1738 ms 151820 KB Output is correct
76 Correct 1722 ms 168608 KB Output is correct
77 Correct 34 ms 47692 KB Output is correct
78 Correct 41 ms 48072 KB Output is correct
79 Correct 799 ms 95812 KB Output is correct
80 Correct 1305 ms 120200 KB Output is correct
81 Correct 1930 ms 144416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
17 Correct 29 ms 47192 KB Output is correct
18 Correct 29 ms 47180 KB Output is correct
19 Correct 30 ms 47180 KB Output is correct
20 Correct 2170 ms 126416 KB Output is correct
21 Correct 2112 ms 126436 KB Output is correct
22 Correct 2190 ms 126524 KB Output is correct
23 Correct 1303 ms 150416 KB Output is correct
24 Correct 450 ms 63716 KB Output is correct
25 Correct 661 ms 65492 KB Output is correct
26 Correct 632 ms 65596 KB Output is correct
27 Correct 1738 ms 168512 KB Output is correct
28 Correct 1675 ms 168472 KB Output is correct
29 Correct 1673 ms 168436 KB Output is correct
30 Correct 1656 ms 168584 KB Output is correct
31 Correct 34 ms 47308 KB Output is correct
32 Correct 98 ms 53872 KB Output is correct
33 Correct 160 ms 55488 KB Output is correct
34 Correct 2162 ms 126360 KB Output is correct
35 Correct 43 ms 48196 KB Output is correct
36 Correct 115 ms 51872 KB Output is correct
37 Correct 232 ms 56556 KB Output is correct
38 Correct 650 ms 82164 KB Output is correct
39 Correct 976 ms 95120 KB Output is correct
40 Correct 1290 ms 108364 KB Output is correct
41 Correct 1638 ms 121380 KB Output is correct
42 Correct 2009 ms 134328 KB Output is correct
43 Correct 29 ms 47172 KB Output is correct
44 Correct 29 ms 47172 KB Output is correct
45 Correct 31 ms 47180 KB Output is correct
46 Correct 31 ms 47180 KB Output is correct
47 Correct 29 ms 47220 KB Output is correct
48 Correct 29 ms 47180 KB Output is correct
49 Correct 29 ms 47196 KB Output is correct
50 Correct 28 ms 47220 KB Output is correct
51 Correct 29 ms 47172 KB Output is correct
52 Correct 29 ms 47236 KB Output is correct
53 Correct 31 ms 47184 KB Output is correct
54 Correct 31 ms 47436 KB Output is correct
55 Correct 36 ms 47472 KB Output is correct
56 Correct 770 ms 94920 KB Output is correct
57 Correct 1175 ms 116144 KB Output is correct
58 Correct 1122 ms 116360 KB Output is correct
59 Correct 29 ms 47172 KB Output is correct
60 Correct 28 ms 47180 KB Output is correct
61 Correct 28 ms 47256 KB Output is correct
62 Correct 1692 ms 168592 KB Output is correct
63 Correct 1677 ms 168492 KB Output is correct
64 Correct 1758 ms 167940 KB Output is correct
65 Correct 32 ms 47564 KB Output is correct
66 Correct 48 ms 47984 KB Output is correct
67 Correct 766 ms 93700 KB Output is correct
68 Correct 1420 ms 117124 KB Output is correct
69 Correct 1841 ms 140336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
17 Correct 1667 ms 168516 KB Output is correct
18 Correct 1616 ms 168692 KB Output is correct
19 Correct 2227 ms 126348 KB Output is correct
20 Correct 1812 ms 138660 KB Output is correct
21 Correct 1482 ms 140556 KB Output is correct
22 Correct 32 ms 47180 KB Output is correct
23 Correct 206 ms 61616 KB Output is correct
24 Correct 57 ms 49200 KB Output is correct
25 Correct 144 ms 53872 KB Output is correct
26 Correct 377 ms 58352 KB Output is correct
27 Correct 803 ms 92716 KB Output is correct
28 Correct 1141 ms 103996 KB Output is correct
29 Correct 1376 ms 115328 KB Output is correct
30 Correct 1710 ms 126680 KB Output is correct
31 Correct 2090 ms 137936 KB Output is correct
32 Correct 1831 ms 151680 KB Output is correct
33 Correct 1636 ms 168612 KB Output is correct
34 Correct 34 ms 47696 KB Output is correct
35 Correct 42 ms 48068 KB Output is correct
36 Correct 752 ms 95748 KB Output is correct
37 Correct 1345 ms 120112 KB Output is correct
38 Correct 1807 ms 144436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 47180 KB Output is correct
2 Correct 29 ms 47268 KB Output is correct
3 Correct 28 ms 47264 KB Output is correct
4 Correct 30 ms 47220 KB Output is correct
5 Correct 32 ms 47212 KB Output is correct
6 Correct 30 ms 47180 KB Output is correct
7 Correct 30 ms 47300 KB Output is correct
8 Correct 29 ms 47180 KB Output is correct
9 Correct 770 ms 107936 KB Output is correct
10 Correct 71 ms 53444 KB Output is correct
11 Correct 295 ms 80600 KB Output is correct
12 Correct 90 ms 56516 KB Output is correct
13 Correct 75 ms 51756 KB Output is correct
14 Correct 31 ms 47276 KB Output is correct
15 Correct 31 ms 47336 KB Output is correct
16 Correct 766 ms 107964 KB Output is correct
17 Correct 28 ms 47240 KB Output is correct
18 Correct 29 ms 47180 KB Output is correct
19 Correct 31 ms 47216 KB Output is correct
20 Correct 30 ms 47172 KB Output is correct
21 Correct 30 ms 47284 KB Output is correct
22 Correct 29 ms 47176 KB Output is correct
23 Correct 2008 ms 147560 KB Output is correct
24 Correct 30 ms 47192 KB Output is correct
25 Correct 34 ms 48004 KB Output is correct
26 Correct 31 ms 47488 KB Output is correct
27 Correct 36 ms 47588 KB Output is correct
28 Correct 670 ms 87392 KB Output is correct
29 Correct 1080 ms 107588 KB Output is correct
30 Correct 1460 ms 127428 KB Output is correct
31 Correct 2031 ms 147492 KB Output is correct
32 Correct 29 ms 47180 KB Output is correct
33 Correct 28 ms 47204 KB Output is correct
34 Correct 36 ms 47180 KB Output is correct
35 Correct 30 ms 47180 KB Output is correct
36 Correct 31 ms 47180 KB Output is correct
37 Correct 28 ms 47272 KB Output is correct
38 Correct 29 ms 47168 KB Output is correct
39 Correct 29 ms 47224 KB Output is correct
40 Correct 37 ms 47220 KB Output is correct
41 Correct 30 ms 47316 KB Output is correct
42 Correct 29 ms 47172 KB Output is correct
43 Correct 31 ms 47360 KB Output is correct
44 Correct 30 ms 47564 KB Output is correct
45 Correct 751 ms 94768 KB Output is correct
46 Correct 1249 ms 116244 KB Output is correct
47 Correct 1439 ms 116172 KB Output is correct
48 Correct 27 ms 47252 KB Output is correct
49 Correct 29 ms 47200 KB Output is correct
50 Correct 33 ms 47268 KB Output is correct
51 Correct 30 ms 47148 KB Output is correct
52 Correct 29 ms 47180 KB Output is correct
53 Correct 28 ms 47228 KB Output is correct
54 Correct 29 ms 47188 KB Output is correct
55 Correct 2063 ms 140344 KB Output is correct
56 Correct 30 ms 47180 KB Output is correct
57 Correct 36 ms 48108 KB Output is correct
58 Correct 58 ms 50048 KB Output is correct
59 Correct 41 ms 48192 KB Output is correct
60 Correct 847 ms 93844 KB Output is correct
61 Correct 1202 ms 110160 KB Output is correct
62 Correct 1653 ms 124164 KB Output is correct
63 Correct 2035 ms 140416 KB Output is correct
64 Correct 32 ms 47224 KB Output is correct
65 Correct 29 ms 47180 KB Output is correct
66 Correct 33 ms 47180 KB Output is correct
67 Correct 1670 ms 168536 KB Output is correct
68 Correct 1633 ms 168504 KB Output is correct
69 Correct 1805 ms 167988 KB Output is correct
70 Correct 33 ms 47564 KB Output is correct
71 Correct 37 ms 47948 KB Output is correct
72 Correct 888 ms 93760 KB Output is correct
73 Correct 1297 ms 116988 KB Output is correct
74 Correct 2016 ms 140448 KB Output is correct
75 Correct 1738 ms 151820 KB Output is correct
76 Correct 1722 ms 168608 KB Output is correct
77 Correct 34 ms 47692 KB Output is correct
78 Correct 41 ms 48072 KB Output is correct
79 Correct 799 ms 95812 KB Output is correct
80 Correct 1305 ms 120200 KB Output is correct
81 Correct 1930 ms 144416 KB Output is correct
82 Correct 29 ms 47192 KB Output is correct
83 Correct 29 ms 47180 KB Output is correct
84 Correct 30 ms 47180 KB Output is correct
85 Correct 2170 ms 126416 KB Output is correct
86 Correct 2112 ms 126436 KB Output is correct
87 Correct 2190 ms 126524 KB Output is correct
88 Correct 1303 ms 150416 KB Output is correct
89 Correct 450 ms 63716 KB Output is correct
90 Correct 661 ms 65492 KB Output is correct
91 Correct 632 ms 65596 KB Output is correct
92 Correct 1738 ms 168512 KB Output is correct
93 Correct 1675 ms 168472 KB Output is correct
94 Correct 1673 ms 168436 KB Output is correct
95 Correct 1656 ms 168584 KB Output is correct
96 Correct 34 ms 47308 KB Output is correct
97 Correct 98 ms 53872 KB Output is correct
98 Correct 160 ms 55488 KB Output is correct
99 Correct 2162 ms 126360 KB Output is correct
100 Correct 43 ms 48196 KB Output is correct
101 Correct 115 ms 51872 KB Output is correct
102 Correct 232 ms 56556 KB Output is correct
103 Correct 650 ms 82164 KB Output is correct
104 Correct 976 ms 95120 KB Output is correct
105 Correct 1290 ms 108364 KB Output is correct
106 Correct 1638 ms 121380 KB Output is correct
107 Correct 2009 ms 134328 KB Output is correct
108 Correct 29 ms 47172 KB Output is correct
109 Correct 29 ms 47172 KB Output is correct
110 Correct 31 ms 47180 KB Output is correct
111 Correct 31 ms 47180 KB Output is correct
112 Correct 29 ms 47220 KB Output is correct
113 Correct 29 ms 47180 KB Output is correct
114 Correct 29 ms 47196 KB Output is correct
115 Correct 28 ms 47220 KB Output is correct
116 Correct 29 ms 47172 KB Output is correct
117 Correct 29 ms 47236 KB Output is correct
118 Correct 31 ms 47184 KB Output is correct
119 Correct 31 ms 47436 KB Output is correct
120 Correct 36 ms 47472 KB Output is correct
121 Correct 770 ms 94920 KB Output is correct
122 Correct 1175 ms 116144 KB Output is correct
123 Correct 1122 ms 116360 KB Output is correct
124 Correct 29 ms 47172 KB Output is correct
125 Correct 28 ms 47180 KB Output is correct
126 Correct 28 ms 47256 KB Output is correct
127 Correct 1692 ms 168592 KB Output is correct
128 Correct 1677 ms 168492 KB Output is correct
129 Correct 1758 ms 167940 KB Output is correct
130 Correct 32 ms 47564 KB Output is correct
131 Correct 48 ms 47984 KB Output is correct
132 Correct 766 ms 93700 KB Output is correct
133 Correct 1420 ms 117124 KB Output is correct
134 Correct 1841 ms 140336 KB Output is correct
135 Correct 1667 ms 168516 KB Output is correct
136 Correct 1616 ms 168692 KB Output is correct
137 Correct 2227 ms 126348 KB Output is correct
138 Correct 1812 ms 138660 KB Output is correct
139 Correct 1482 ms 140556 KB Output is correct
140 Correct 32 ms 47180 KB Output is correct
141 Correct 206 ms 61616 KB Output is correct
142 Correct 57 ms 49200 KB Output is correct
143 Correct 144 ms 53872 KB Output is correct
144 Correct 377 ms 58352 KB Output is correct
145 Correct 803 ms 92716 KB Output is correct
146 Correct 1141 ms 103996 KB Output is correct
147 Correct 1376 ms 115328 KB Output is correct
148 Correct 1710 ms 126680 KB Output is correct
149 Correct 2090 ms 137936 KB Output is correct
150 Correct 1831 ms 151680 KB Output is correct
151 Correct 1636 ms 168612 KB Output is correct
152 Correct 34 ms 47696 KB Output is correct
153 Correct 42 ms 48068 KB Output is correct
154 Correct 752 ms 95748 KB Output is correct
155 Correct 1345 ms 120112 KB Output is correct
156 Correct 1807 ms 144436 KB Output is correct
157 Correct 28 ms 47228 KB Output is correct
158 Correct 31 ms 47248 KB Output is correct
159 Correct 30 ms 47240 KB Output is correct
160 Correct 30 ms 47244 KB Output is correct
161 Incorrect 2105 ms 126396 KB Solution announced impossible, but it is possible.
162 Halted 0 ms 0 KB -