Submission #740264

# Submission time Handle Problem Language Result Execution time Memory
740264 2023-05-12T08:48:28 Z vjudge1 Fountain Parks (IOI21_parks) C++17
15 / 100
3500 ms 152436 KB
#include "parks.h"
#include <bits/stdc++.h>
#define f first
#define s second 
#define ent '\n'
//#define int long long

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")

//typedef long double ld;
typedef long long ll;
using namespace std;
 
struct node{double x,y;};
//double len(node a,node b)
//{return sqrt((a.x-b.x)*(a.x-b.y)+(a.y-b.y)*(a.x-b.y));}

struct seg{
	int l,r,id;
};

const string out[2]={"NO\n","YES\n"};
const ll dx[]={-1,-1,1,1};  
const ll dy[]={-1,1,-1,1};
const ll dxx[]={0,0,2,-2};
const ll dyy[]={2,-2,0,0};
const int md=998244353;
const int mod=1e9+7;
const int mx=8e5+12; 
const int tst=1e5;
const bool T=0;

pair<int,pair<int,int>> p[mx];
map<int,bool> used[mx];
map<int,int> pos[mx];
vector<int> g[mx];
int ma[mx];
int mi[mx];

void dfs(int x,int y){
	used[x][y]=1;
	ma[x]=max(ma[x],y);
	mi[x]=min(mi[x],y);
	for(int k=0;k<4;k++){
		int x1=x+dxx[k];
		int y1=y+dyy[k];
		if(!used[x1].count(y1) && pos[x1].count(y1))dfs(x1,y1);
	}
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
	int n=x.size();
	for(int i=1;i<=n;i++){
		p[i]={x[i-1],{y[i-1],i}};
	}
	srand(time(0));
	sort(p+1,p+n+1);
	int mx=0;
	reverse(x.begin(),x.end());
	reverse(y.begin(),y.end());
	x.push_back(0);
	y.push_back(0);
	reverse(x.begin(),x.end());
	reverse(y.begin(),y.end());
	for(int i=1;i<=n;i++){
		mx=max(mx,x[i]);
		pos[x[i]][y[i]]=i-1;
	}
	for(int i=0;i<=mx;i++)mi[i]=1e9;
	dfs(x[1],y[1]);
	for(int i=1;i<=n;i++){
		if(!used[x[i]][y[i]]){
			return 0;
		}
	}
	vector<int> u,v,a,b;
	if(mx==2){
		for(int i=mi[2];i<ma[2];i+=2){
			u.push_back(pos[2][i]);
			v.push_back(pos[2][i+2]);
			a.push_back(1);
			b.push_back(i+1);
		}
		build(u,v,a,b);
		return 1;
	}
	if(mx==4){
		if(!ma[2]){
			for(int i=mi[4];i<ma[4];i+=2){
				u.push_back(pos[4][i]);
				v.push_back(pos[4][i+2]);
				a.push_back(3);
				b.push_back(i+1);
			}
			build(u,v,a,b);
			return 1;
		}
		for(int i=1;i<=n;i++){
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				if(x[i]==2)a.push_back(1);
				else a.push_back(5);
				b.push_back(y[i]+1);
			}
		}
		for(int i=1;i<=n;i++){
			if(x[i]!=2)continue;
			if(pos[4].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[4][y[i]]);
				a.push_back(3);
				b.push_back(y[i]-1);
			}
		}
		build(u,v,a,b);
		return 1;
	}
	while(!u.size()){
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					a.push_back(x[i]+1);
				}
				else if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1];
					a.push_back(x[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					a.push_back(x[i]+1);
				}
				else if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1];
					a.push_back(x[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1]=1;
					a.push_back(x[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1];
					a.push_back(x[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1]=1;
					a.push_back(x[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1];
					a.push_back(x[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					a.push_back(x[i]+1);
				}
				else if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1];
					a.push_back(x[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					a.push_back(x[i]+1);
				}
				else if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1];
					a.push_back(x[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1]=1;
					a.push_back(x[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1];
					a.push_back(x[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
		random_shuffle(p+1,p+n+1);
		for(int i=1;i<=n;i++){
			int daun=i;
			i=p[i].s.s;
			if(pos[x[i]+2].count(y[i])){
				u.push_back(i-1);
				v.push_back(pos[x[i]+2][y[i]]);
				a.push_back(x[i]+1);
				if(!used[x[i]+1][y[i]-1]){
					used[x[i]+1][y[i]-1]=1;
					b.push_back(y[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1]=1;
					b.push_back(y[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			if(pos[x[i]].count(y[i]+2)){
				u.push_back(i-1);
				v.push_back(pos[x[i]][y[i]+2]);
				b.push_back(y[i]+1);
				if(!used[x[i]-1][y[i]+1]){
					used[x[i]-1][y[i]+1]=1;
					a.push_back(x[i]-1);
				}
				else if(!used[x[i]+1][y[i]+1]){
					used[x[i]+1][y[i]+1];
					a.push_back(x[i]+1);
				}
				else{
					v.clear();
					u.clear();
					a.clear();
					b.clear();
					break;
				}
			}
			i=daun;
		}
		for(int i=1;i<=mx;i++)used[i].clear();
		if(u.size())break;
	}
	build(u,v,a,b);
	return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:312:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  312 |   if(u.size())break;random_shuffle(p+1,p+n+1);
      |   ^~
parks.cpp:312:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  312 |   if(u.size())break;random_shuffle(p+1,p+n+1);
      |                     ^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
17 Correct 46 ms 94148 KB Output is correct
18 Correct 54 ms 94188 KB Output is correct
19 Correct 47 ms 94296 KB Output is correct
20 Correct 44 ms 94160 KB Output is correct
21 Correct 43 ms 94216 KB Output is correct
22 Correct 45 ms 94172 KB Output is correct
23 Correct 643 ms 151588 KB Output is correct
24 Correct 49 ms 94172 KB Output is correct
25 Correct 54 ms 94544 KB Output is correct
26 Correct 56 ms 94600 KB Output is correct
27 Correct 55 ms 94764 KB Output is correct
28 Correct 243 ms 117320 KB Output is correct
29 Correct 361 ms 128636 KB Output is correct
30 Correct 538 ms 140192 KB Output is correct
31 Correct 636 ms 151552 KB Output is correct
32 Correct 47 ms 94172 KB Output is correct
33 Correct 53 ms 94204 KB Output is correct
34 Correct 46 ms 94132 KB Output is correct
35 Correct 47 ms 94200 KB Output is correct
36 Correct 44 ms 94176 KB Output is correct
37 Correct 43 ms 94160 KB Output is correct
38 Correct 42 ms 94132 KB Output is correct
39 Correct 45 ms 94208 KB Output is correct
40 Correct 47 ms 94188 KB Output is correct
41 Correct 44 ms 94144 KB Output is correct
42 Correct 50 ms 94136 KB Output is correct
43 Correct 45 ms 94492 KB Output is correct
44 Correct 48 ms 94412 KB Output is correct
45 Correct 252 ms 117128 KB Output is correct
46 Correct 351 ms 128740 KB Output is correct
47 Correct 391 ms 128288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
17 Correct 46 ms 94148 KB Output is correct
18 Correct 54 ms 94188 KB Output is correct
19 Correct 47 ms 94296 KB Output is correct
20 Correct 44 ms 94160 KB Output is correct
21 Correct 43 ms 94216 KB Output is correct
22 Correct 45 ms 94172 KB Output is correct
23 Correct 643 ms 151588 KB Output is correct
24 Correct 49 ms 94172 KB Output is correct
25 Correct 54 ms 94544 KB Output is correct
26 Correct 56 ms 94600 KB Output is correct
27 Correct 55 ms 94764 KB Output is correct
28 Correct 243 ms 117320 KB Output is correct
29 Correct 361 ms 128636 KB Output is correct
30 Correct 538 ms 140192 KB Output is correct
31 Correct 636 ms 151552 KB Output is correct
32 Correct 47 ms 94172 KB Output is correct
33 Correct 53 ms 94204 KB Output is correct
34 Correct 46 ms 94132 KB Output is correct
35 Correct 47 ms 94200 KB Output is correct
36 Correct 44 ms 94176 KB Output is correct
37 Correct 43 ms 94160 KB Output is correct
38 Correct 42 ms 94132 KB Output is correct
39 Correct 45 ms 94208 KB Output is correct
40 Correct 47 ms 94188 KB Output is correct
41 Correct 44 ms 94144 KB Output is correct
42 Correct 50 ms 94136 KB Output is correct
43 Correct 45 ms 94492 KB Output is correct
44 Correct 48 ms 94412 KB Output is correct
45 Correct 252 ms 117128 KB Output is correct
46 Correct 351 ms 128740 KB Output is correct
47 Correct 391 ms 128288 KB Output is correct
48 Correct 46 ms 94164 KB Output is correct
49 Correct 44 ms 94220 KB Output is correct
50 Correct 48 ms 94284 KB Output is correct
51 Incorrect 43 ms 94148 KB Tree @(3, 3) appears more than once: for edges on positions 3 and 6
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
17 Correct 46 ms 95036 KB Output is correct
18 Correct 45 ms 94944 KB Output is correct
19 Correct 44 ms 94956 KB Output is correct
20 Correct 412 ms 152436 KB Output is correct
21 Correct 451 ms 143144 KB Output is correct
22 Correct 378 ms 145740 KB Output is correct
23 Correct 431 ms 137648 KB Output is correct
24 Correct 174 ms 109076 KB Output is correct
25 Correct 205 ms 109092 KB Output is correct
26 Correct 165 ms 109088 KB Output is correct
27 Correct 591 ms 132008 KB Output is correct
28 Correct 597 ms 129628 KB Output is correct
29 Correct 765 ms 124944 KB Output is correct
30 Correct 701 ms 131752 KB Output is correct
31 Correct 46 ms 94920 KB Output is correct
32 Execution timed out 3568 ms 97244 KB Time limit exceeded
33 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
17 Correct 601 ms 152416 KB Output is correct
18 Incorrect 820 ms 146004 KB Tree @(100001, 50003) appears more than once: for edges on positions 69830 and 156466
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 94156 KB Output is correct
2 Correct 43 ms 94112 KB Output is correct
3 Correct 42 ms 94196 KB Output is correct
4 Correct 44 ms 94132 KB Output is correct
5 Correct 42 ms 94180 KB Output is correct
6 Correct 49 ms 94156 KB Output is correct
7 Correct 45 ms 94220 KB Output is correct
8 Correct 46 ms 94156 KB Output is correct
9 Correct 209 ms 120124 KB Output is correct
10 Correct 56 ms 97200 KB Output is correct
11 Correct 121 ms 108492 KB Output is correct
12 Correct 59 ms 98380 KB Output is correct
13 Correct 76 ms 101692 KB Output is correct
14 Correct 45 ms 94248 KB Output is correct
15 Correct 41 ms 94412 KB Output is correct
16 Correct 234 ms 116168 KB Output is correct
17 Correct 46 ms 94148 KB Output is correct
18 Correct 54 ms 94188 KB Output is correct
19 Correct 47 ms 94296 KB Output is correct
20 Correct 44 ms 94160 KB Output is correct
21 Correct 43 ms 94216 KB Output is correct
22 Correct 45 ms 94172 KB Output is correct
23 Correct 643 ms 151588 KB Output is correct
24 Correct 49 ms 94172 KB Output is correct
25 Correct 54 ms 94544 KB Output is correct
26 Correct 56 ms 94600 KB Output is correct
27 Correct 55 ms 94764 KB Output is correct
28 Correct 243 ms 117320 KB Output is correct
29 Correct 361 ms 128636 KB Output is correct
30 Correct 538 ms 140192 KB Output is correct
31 Correct 636 ms 151552 KB Output is correct
32 Correct 47 ms 94172 KB Output is correct
33 Correct 53 ms 94204 KB Output is correct
34 Correct 46 ms 94132 KB Output is correct
35 Correct 47 ms 94200 KB Output is correct
36 Correct 44 ms 94176 KB Output is correct
37 Correct 43 ms 94160 KB Output is correct
38 Correct 42 ms 94132 KB Output is correct
39 Correct 45 ms 94208 KB Output is correct
40 Correct 47 ms 94188 KB Output is correct
41 Correct 44 ms 94144 KB Output is correct
42 Correct 50 ms 94136 KB Output is correct
43 Correct 45 ms 94492 KB Output is correct
44 Correct 48 ms 94412 KB Output is correct
45 Correct 252 ms 117128 KB Output is correct
46 Correct 351 ms 128740 KB Output is correct
47 Correct 391 ms 128288 KB Output is correct
48 Correct 46 ms 94164 KB Output is correct
49 Correct 44 ms 94220 KB Output is correct
50 Correct 48 ms 94284 KB Output is correct
51 Incorrect 43 ms 94148 KB Tree @(3, 3) appears more than once: for edges on positions 3 and 6
52 Halted 0 ms 0 KB -