Submission #645973

# Submission time Handle Problem Language Result Execution time Memory
645973 2022-09-28T11:23:57 Z jamezzz Fountain Parks (IOI21_parks) C++17
100 / 100
1596 ms 124632 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define maxn 200005
#define pb push_back

typedef pair<int,int> ii;

int dx[2]={2,0},dy[2]={0,2};
bool vis[maxn],bad[4*maxn],weird[maxn];
vector<ii> squares;
map<ii,int> fid,sid,eid,use;
vector<int> AL[maxn],par[maxn];
int p[maxn],rnk[maxn];

int fp(int i){return (p[i]==i)?i:p[i]=fp(p[i]);}
void join(int x,int y){
	x=fp(x),y=fp(y);
	if(x==y)return;
	if(rnk[x]<rnk[y])p[x]=y;
	else p[y]=x;
	if(rnk[x]==rnk[y])++rnk[x];
}

inline bool fin(int x,int y){
	return fid.find(ii(x,y))!=fid.end();
}

inline bool sin(int x,int y){
	return sid.find(ii(x,y))!=sid.end();
}

inline bool ein(int x,int y){
	return eid.find(ii(x,y))!=eid.end();
}

void dfs(int u,int p){
	//printf("dfs: %d %d\n",u,p);
	if(p!=-1){
		auto[x,y]=squares[u];
		ii f1,f2;
		if(p==par[u][0]){
			if((x+y)%4==0){//vertical
				f1={x-1,y-1},f2={x-1,y+1};
			}
			else{//horizontal
				f1={x-1,y-1},f2={x+1,y-1};
			}
		}
		else{
			if((x+y)%4==0){//vertical
				f1={x+1,y-1},f2={x+1,y+1};
			}
			else{//horizontal
				f1={x-1,y+1},f2={x+1,y+1};
			}
		}
		int i1=fid[f1],i2=fid[f2];
		if(ein(i1,i2))bad[eid[{i1,i2}]]=true;
		else bad[eid[{i2,i1}]]=true;
	}
	for(int v:AL[u]){
		if(vis[v])continue;
		vis[v]=true;
		dfs(v,u);
	}
}

int construct_roads(vector<int> x,vector<int> y){
    int n=x.size();
    for(int i=0;i<n;++i){
		fid[{x[i],y[i]}]=i;
	}
	int scnt=0,ecnt=0;
	for(int i=0;i<n;++i){
		if(fin(x[i]+2,y[i])&&fin(x[i],y[i]+2)&&fin(x[i]+2,y[i]+2)){
			sid[{x[i]+1,y[i]+1}]=scnt++;
			squares.push_back({x[i]+1,y[i]+1});
		}
		for(int j=0;j<2;++j){
			int nx=x[i]+dx[j],ny=y[i]+dy[j];
			if(fin(nx,ny))eid[{i,fid[{nx,ny}]}]=ecnt++;
		}
	}
	for(auto it=sid.begin();it!=sid.end();++it){
		auto[x,y]=it->fi;
		assert(it->se!=scnt);
		if((x+y)%4==0){//vertical
			for(int dx:{-2,2}){
				if(sin(x+dx,y)){
					AL[sid[{x+dx,y}]].push_back(it->se);
					par[it->se].push_back(sid[{x+dx,y}]);
				}
				else{
					AL[scnt].push_back(it->se);
					par[it->se].push_back(scnt);
				}
			}
		}
		else{//horizontal
			for(int dy:{-2,2}){
				if(sin(x,y+dy)){
					AL[sid[{x,y+dy}]].push_back(it->se);
					par[it->se].push_back(sid[{x,y+dy}]);
				}
				else{
					AL[scnt].push_back(it->se);
					par[it->se].push_back(scnt);
				}
			}
		}
	}
	vis[scnt]=true;
	dfs(scnt,-1);
	/*
	for(auto it=sid.begin();it!=sid.end();++it){
		auto[x,y]=it->fi;
		if((x+y)%4==0){//vertical
			int cnt=0;
			for(int dx:{-1,1}){
				ii f1={x+dx,y-1},f2={x+dx,y+1};
				int i1=fid[f1],i2=fid[f2];
				if(ein(i1,i2)&&!bad[eid[{i1,i2}]])++cnt;
				else if(ein(i2,i1)&&!bad[eid[{i2,i1}]])++cnt;
			}
			if(cnt==2)assert(false);
		}
		else{//horizontal
			int cnt=0;
			for(int dy:{-1,1}){
				ii f1={x-1,y+dy},f2={x+1,y+dy};
				int i1=fid[f1],i2=fid[f2];
				if(ein(i1,i2)&&!bad[eid[{i1,i2}]])++cnt;
				else if(ein(i2,i1)&&!bad[eid[{i2,i1}]])++cnt;
			}
			if(cnt==2)assert(false);
		}
	}
	*/
	for(int i=0;i<n;++i)p[i]=i;
	vector<int> u,v,a,b;
	for(auto it=eid.begin();it!=eid.end();++it){
		if(bad[it->se])continue;
		auto[i,j]=it->fi;
		if(fp(i)==fp(j))continue;
		join(i,j);
		int x1=x[i],x2=x[j],y1=y[i],y2=y[j];
		int bx,by;
		if(x1==x2){
			if((x1-1+(y1+y2)/2)%4==0)bx=x1-1,by=(y1+y2)/2;
			else bx=x1+1,by=(y1+y2)/2;
		}
		else{
			if(((x1+x2)/2+y1-1)%4!=0)bx=(x1+x2)/2,by=y1-1;
			else bx=(x1+x2)/2,by=y1+1;
		}
		u.pb(i),v.pb(j),a.pb(bx),b.pb(by);
		int idk=use[{bx,by}];
		use[{bx,by}]=true;
	}
	for(int i=0;i<n;++i){
		if(fp(i)!=fp(0))return 0;
	}
	build(u,v,a,b);
    return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:161:7: warning: unused variable 'idk' [-Wunused-variable]
  161 |   int idk=use[{bx,by}];
      |       ^~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
17 Correct 5 ms 9684 KB Output is correct
18 Correct 5 ms 9684 KB Output is correct
19 Correct 5 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9684 KB Output is correct
22 Correct 5 ms 9684 KB Output is correct
23 Correct 983 ms 80380 KB Output is correct
24 Correct 5 ms 9684 KB Output is correct
25 Correct 8 ms 10104 KB Output is correct
26 Correct 11 ms 10620 KB Output is correct
27 Correct 15 ms 10916 KB Output is correct
28 Correct 328 ms 38708 KB Output is correct
29 Correct 488 ms 53104 KB Output is correct
30 Correct 700 ms 67752 KB Output is correct
31 Correct 967 ms 82180 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9704 KB Output is correct
35 Correct 5 ms 9704 KB Output is correct
36 Correct 5 ms 9696 KB Output is correct
37 Correct 6 ms 9708 KB Output is correct
38 Correct 5 ms 9672 KB Output is correct
39 Correct 5 ms 9684 KB Output is correct
40 Correct 5 ms 9684 KB Output is correct
41 Correct 5 ms 9708 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 8 ms 10068 KB Output is correct
44 Correct 10 ms 10356 KB Output is correct
45 Correct 261 ms 36400 KB Output is correct
46 Correct 388 ms 48288 KB Output is correct
47 Correct 417 ms 48420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
17 Correct 5 ms 9684 KB Output is correct
18 Correct 5 ms 9684 KB Output is correct
19 Correct 5 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9684 KB Output is correct
22 Correct 5 ms 9684 KB Output is correct
23 Correct 983 ms 80380 KB Output is correct
24 Correct 5 ms 9684 KB Output is correct
25 Correct 8 ms 10104 KB Output is correct
26 Correct 11 ms 10620 KB Output is correct
27 Correct 15 ms 10916 KB Output is correct
28 Correct 328 ms 38708 KB Output is correct
29 Correct 488 ms 53104 KB Output is correct
30 Correct 700 ms 67752 KB Output is correct
31 Correct 967 ms 82180 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9704 KB Output is correct
35 Correct 5 ms 9704 KB Output is correct
36 Correct 5 ms 9696 KB Output is correct
37 Correct 6 ms 9708 KB Output is correct
38 Correct 5 ms 9672 KB Output is correct
39 Correct 5 ms 9684 KB Output is correct
40 Correct 5 ms 9684 KB Output is correct
41 Correct 5 ms 9708 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 8 ms 10068 KB Output is correct
44 Correct 10 ms 10356 KB Output is correct
45 Correct 261 ms 36400 KB Output is correct
46 Correct 388 ms 48288 KB Output is correct
47 Correct 417 ms 48420 KB Output is correct
48 Correct 7 ms 9684 KB Output is correct
49 Correct 5 ms 9696 KB Output is correct
50 Correct 7 ms 9700 KB Output is correct
51 Correct 7 ms 9712 KB Output is correct
52 Correct 5 ms 9684 KB Output is correct
53 Correct 7 ms 9612 KB Output is correct
54 Correct 7 ms 9704 KB Output is correct
55 Correct 1275 ms 105208 KB Output is correct
56 Correct 6 ms 9684 KB Output is correct
57 Correct 11 ms 10488 KB Output is correct
58 Correct 21 ms 12612 KB Output is correct
59 Correct 31 ms 13560 KB Output is correct
60 Correct 490 ms 57204 KB Output is correct
61 Correct 745 ms 73548 KB Output is correct
62 Correct 945 ms 86616 KB Output is correct
63 Correct 1182 ms 105348 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 5 ms 9704 KB Output is correct
66 Correct 6 ms 9812 KB Output is correct
67 Correct 551 ms 63052 KB Output is correct
68 Correct 582 ms 62932 KB Output is correct
69 Correct 561 ms 62784 KB Output is correct
70 Correct 10 ms 10580 KB Output is correct
71 Correct 16 ms 11604 KB Output is correct
72 Correct 262 ms 36332 KB Output is correct
73 Correct 433 ms 49712 KB Output is correct
74 Correct 605 ms 63060 KB Output is correct
75 Correct 632 ms 65564 KB Output is correct
76 Correct 531 ms 63008 KB Output is correct
77 Correct 12 ms 10836 KB Output is correct
78 Correct 18 ms 11896 KB Output is correct
79 Correct 272 ms 36936 KB Output is correct
80 Correct 461 ms 50708 KB Output is correct
81 Correct 645 ms 64512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
17 Correct 5 ms 9684 KB Output is correct
18 Correct 5 ms 9712 KB Output is correct
19 Correct 5 ms 9684 KB Output is correct
20 Correct 595 ms 61600 KB Output is correct
21 Correct 643 ms 61716 KB Output is correct
22 Correct 619 ms 61684 KB Output is correct
23 Correct 507 ms 53908 KB Output is correct
24 Correct 297 ms 26388 KB Output is correct
25 Correct 651 ms 55308 KB Output is correct
26 Correct 517 ms 55284 KB Output is correct
27 Correct 595 ms 61740 KB Output is correct
28 Correct 596 ms 61640 KB Output is correct
29 Correct 674 ms 61664 KB Output is correct
30 Correct 684 ms 61552 KB Output is correct
31 Correct 5 ms 9684 KB Output is correct
32 Correct 34 ms 13704 KB Output is correct
33 Correct 103 ms 18164 KB Output is correct
34 Correct 594 ms 61552 KB Output is correct
35 Correct 23 ms 12104 KB Output is correct
36 Correct 102 ms 21180 KB Output is correct
37 Correct 243 ms 32616 KB Output is correct
38 Correct 205 ms 30640 KB Output is correct
39 Correct 304 ms 38324 KB Output is correct
40 Correct 421 ms 46200 KB Output is correct
41 Correct 580 ms 53892 KB Output is correct
42 Correct 716 ms 61720 KB Output is correct
43 Correct 5 ms 9684 KB Output is correct
44 Correct 5 ms 9688 KB Output is correct
45 Correct 6 ms 9712 KB Output is correct
46 Correct 6 ms 9712 KB Output is correct
47 Correct 5 ms 9684 KB Output is correct
48 Correct 5 ms 9708 KB Output is correct
49 Correct 5 ms 9708 KB Output is correct
50 Correct 5 ms 9704 KB Output is correct
51 Correct 5 ms 9704 KB Output is correct
52 Correct 5 ms 9692 KB Output is correct
53 Correct 5 ms 9712 KB Output is correct
54 Correct 7 ms 10068 KB Output is correct
55 Correct 9 ms 10324 KB Output is correct
56 Correct 246 ms 35852 KB Output is correct
57 Correct 385 ms 47380 KB Output is correct
58 Correct 386 ms 47464 KB Output is correct
59 Correct 5 ms 9684 KB Output is correct
60 Correct 5 ms 9704 KB Output is correct
61 Correct 5 ms 9644 KB Output is correct
62 Correct 523 ms 61592 KB Output is correct
63 Correct 538 ms 61584 KB Output is correct
64 Correct 566 ms 61272 KB Output is correct
65 Correct 13 ms 10580 KB Output is correct
66 Correct 17 ms 11476 KB Output is correct
67 Correct 246 ms 35732 KB Output is correct
68 Correct 432 ms 48684 KB Output is correct
69 Correct 611 ms 61664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
17 Correct 593 ms 61532 KB Output is correct
18 Correct 604 ms 61540 KB Output is correct
19 Correct 644 ms 61792 KB Output is correct
20 Correct 782 ms 64564 KB Output is correct
21 Correct 640 ms 56368 KB Output is correct
22 Correct 7 ms 9704 KB Output is correct
23 Correct 79 ms 18384 KB Output is correct
24 Correct 41 ms 14648 KB Output is correct
25 Correct 155 ms 26568 KB Output is correct
26 Correct 308 ms 38568 KB Output is correct
27 Correct 305 ms 36784 KB Output is correct
28 Correct 367 ms 43656 KB Output is correct
29 Correct 505 ms 50264 KB Output is correct
30 Correct 602 ms 57032 KB Output is correct
31 Correct 723 ms 63788 KB Output is correct
32 Correct 627 ms 63904 KB Output is correct
33 Correct 519 ms 61428 KB Output is correct
34 Correct 11 ms 10836 KB Output is correct
35 Correct 18 ms 11824 KB Output is correct
36 Correct 256 ms 36204 KB Output is correct
37 Correct 425 ms 49580 KB Output is correct
38 Correct 610 ms 62700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9620 KB Output is correct
3 Correct 5 ms 9684 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 6 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 206 ms 35484 KB Output is correct
10 Correct 23 ms 12348 KB Output is correct
11 Correct 105 ms 23376 KB Output is correct
12 Correct 27 ms 13728 KB Output is correct
13 Correct 65 ms 19488 KB Output is correct
14 Correct 6 ms 9812 KB Output is correct
15 Correct 7 ms 10068 KB Output is correct
16 Correct 284 ms 35460 KB Output is correct
17 Correct 5 ms 9684 KB Output is correct
18 Correct 5 ms 9684 KB Output is correct
19 Correct 5 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9684 KB Output is correct
22 Correct 5 ms 9684 KB Output is correct
23 Correct 983 ms 80380 KB Output is correct
24 Correct 5 ms 9684 KB Output is correct
25 Correct 8 ms 10104 KB Output is correct
26 Correct 11 ms 10620 KB Output is correct
27 Correct 15 ms 10916 KB Output is correct
28 Correct 328 ms 38708 KB Output is correct
29 Correct 488 ms 53104 KB Output is correct
30 Correct 700 ms 67752 KB Output is correct
31 Correct 967 ms 82180 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9704 KB Output is correct
35 Correct 5 ms 9704 KB Output is correct
36 Correct 5 ms 9696 KB Output is correct
37 Correct 6 ms 9708 KB Output is correct
38 Correct 5 ms 9672 KB Output is correct
39 Correct 5 ms 9684 KB Output is correct
40 Correct 5 ms 9684 KB Output is correct
41 Correct 5 ms 9708 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 8 ms 10068 KB Output is correct
44 Correct 10 ms 10356 KB Output is correct
45 Correct 261 ms 36400 KB Output is correct
46 Correct 388 ms 48288 KB Output is correct
47 Correct 417 ms 48420 KB Output is correct
48 Correct 7 ms 9684 KB Output is correct
49 Correct 5 ms 9696 KB Output is correct
50 Correct 7 ms 9700 KB Output is correct
51 Correct 7 ms 9712 KB Output is correct
52 Correct 5 ms 9684 KB Output is correct
53 Correct 7 ms 9612 KB Output is correct
54 Correct 7 ms 9704 KB Output is correct
55 Correct 1275 ms 105208 KB Output is correct
56 Correct 6 ms 9684 KB Output is correct
57 Correct 11 ms 10488 KB Output is correct
58 Correct 21 ms 12612 KB Output is correct
59 Correct 31 ms 13560 KB Output is correct
60 Correct 490 ms 57204 KB Output is correct
61 Correct 745 ms 73548 KB Output is correct
62 Correct 945 ms 86616 KB Output is correct
63 Correct 1182 ms 105348 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 5 ms 9704 KB Output is correct
66 Correct 6 ms 9812 KB Output is correct
67 Correct 551 ms 63052 KB Output is correct
68 Correct 582 ms 62932 KB Output is correct
69 Correct 561 ms 62784 KB Output is correct
70 Correct 10 ms 10580 KB Output is correct
71 Correct 16 ms 11604 KB Output is correct
72 Correct 262 ms 36332 KB Output is correct
73 Correct 433 ms 49712 KB Output is correct
74 Correct 605 ms 63060 KB Output is correct
75 Correct 632 ms 65564 KB Output is correct
76 Correct 531 ms 63008 KB Output is correct
77 Correct 12 ms 10836 KB Output is correct
78 Correct 18 ms 11896 KB Output is correct
79 Correct 272 ms 36936 KB Output is correct
80 Correct 461 ms 50708 KB Output is correct
81 Correct 645 ms 64512 KB Output is correct
82 Correct 5 ms 9684 KB Output is correct
83 Correct 5 ms 9712 KB Output is correct
84 Correct 5 ms 9684 KB Output is correct
85 Correct 595 ms 61600 KB Output is correct
86 Correct 643 ms 61716 KB Output is correct
87 Correct 619 ms 61684 KB Output is correct
88 Correct 507 ms 53908 KB Output is correct
89 Correct 297 ms 26388 KB Output is correct
90 Correct 651 ms 55308 KB Output is correct
91 Correct 517 ms 55284 KB Output is correct
92 Correct 595 ms 61740 KB Output is correct
93 Correct 596 ms 61640 KB Output is correct
94 Correct 674 ms 61664 KB Output is correct
95 Correct 684 ms 61552 KB Output is correct
96 Correct 5 ms 9684 KB Output is correct
97 Correct 34 ms 13704 KB Output is correct
98 Correct 103 ms 18164 KB Output is correct
99 Correct 594 ms 61552 KB Output is correct
100 Correct 23 ms 12104 KB Output is correct
101 Correct 102 ms 21180 KB Output is correct
102 Correct 243 ms 32616 KB Output is correct
103 Correct 205 ms 30640 KB Output is correct
104 Correct 304 ms 38324 KB Output is correct
105 Correct 421 ms 46200 KB Output is correct
106 Correct 580 ms 53892 KB Output is correct
107 Correct 716 ms 61720 KB Output is correct
108 Correct 5 ms 9684 KB Output is correct
109 Correct 5 ms 9688 KB Output is correct
110 Correct 6 ms 9712 KB Output is correct
111 Correct 6 ms 9712 KB Output is correct
112 Correct 5 ms 9684 KB Output is correct
113 Correct 5 ms 9708 KB Output is correct
114 Correct 5 ms 9708 KB Output is correct
115 Correct 5 ms 9704 KB Output is correct
116 Correct 5 ms 9704 KB Output is correct
117 Correct 5 ms 9692 KB Output is correct
118 Correct 5 ms 9712 KB Output is correct
119 Correct 7 ms 10068 KB Output is correct
120 Correct 9 ms 10324 KB Output is correct
121 Correct 246 ms 35852 KB Output is correct
122 Correct 385 ms 47380 KB Output is correct
123 Correct 386 ms 47464 KB Output is correct
124 Correct 5 ms 9684 KB Output is correct
125 Correct 5 ms 9704 KB Output is correct
126 Correct 5 ms 9644 KB Output is correct
127 Correct 523 ms 61592 KB Output is correct
128 Correct 538 ms 61584 KB Output is correct
129 Correct 566 ms 61272 KB Output is correct
130 Correct 13 ms 10580 KB Output is correct
131 Correct 17 ms 11476 KB Output is correct
132 Correct 246 ms 35732 KB Output is correct
133 Correct 432 ms 48684 KB Output is correct
134 Correct 611 ms 61664 KB Output is correct
135 Correct 593 ms 61532 KB Output is correct
136 Correct 604 ms 61540 KB Output is correct
137 Correct 644 ms 61792 KB Output is correct
138 Correct 782 ms 64564 KB Output is correct
139 Correct 640 ms 56368 KB Output is correct
140 Correct 7 ms 9704 KB Output is correct
141 Correct 79 ms 18384 KB Output is correct
142 Correct 41 ms 14648 KB Output is correct
143 Correct 155 ms 26568 KB Output is correct
144 Correct 308 ms 38568 KB Output is correct
145 Correct 305 ms 36784 KB Output is correct
146 Correct 367 ms 43656 KB Output is correct
147 Correct 505 ms 50264 KB Output is correct
148 Correct 602 ms 57032 KB Output is correct
149 Correct 723 ms 63788 KB Output is correct
150 Correct 627 ms 63904 KB Output is correct
151 Correct 519 ms 61428 KB Output is correct
152 Correct 11 ms 10836 KB Output is correct
153 Correct 18 ms 11824 KB Output is correct
154 Correct 256 ms 36204 KB Output is correct
155 Correct 425 ms 49580 KB Output is correct
156 Correct 610 ms 62700 KB Output is correct
157 Correct 5 ms 9684 KB Output is correct
158 Correct 5 ms 9712 KB Output is correct
159 Correct 5 ms 9684 KB Output is correct
160 Correct 7 ms 9704 KB Output is correct
161 Correct 1596 ms 124632 KB Output is correct
162 Correct 598 ms 64028 KB Output is correct
163 Correct 871 ms 75808 KB Output is correct
164 Correct 830 ms 75916 KB Output is correct
165 Correct 1276 ms 108208 KB Output is correct
166 Correct 1414 ms 115836 KB Output is correct
167 Correct 199 ms 30396 KB Output is correct
168 Correct 133 ms 23480 KB Output is correct
169 Correct 433 ms 44552 KB Output is correct
170 Correct 960 ms 74736 KB Output is correct
171 Correct 1328 ms 94444 KB Output is correct
172 Correct 635 ms 64568 KB Output is correct
173 Correct 797 ms 75640 KB Output is correct
174 Correct 975 ms 87336 KB Output is correct
175 Correct 1129 ms 97712 KB Output is correct
176 Correct 1283 ms 109464 KB Output is correct
177 Correct 1496 ms 120388 KB Output is correct