Submission #440228

# Submission time Handle Problem Language Result Execution time Memory
440228 2021-07-01T19:14:50 Z DanerZein Fountain Parks (IOI21_parks) C++17
70 / 100
540 ms 51132 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
const int MAX_N=2e5+10;
vector<vi> G;
int pa[MAX_N],tam[MAX_N];
bool vis[MAX_N];
vector<ii> ox[MAX_N],oy[MAX_N];
void init(int n){
  for(int i=0;i<n;i++){
    pa[i]=i; tam[i]=1;
  }
}
int findset(int i){
  if(pa[i]==i) return i;
  return pa[i]=findset(pa[i]);
}
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;
    tam[v]+=tam[u];
  }
}
bool orden(iii a,iii b){
  if(a.second.second==b.second.second){
    return a.second.first<b.second.first;
  }
  return a.second.second<b.second.second;
}
int construct_roads(std::vector<int> x, std::vector<int> y) {
  int n=x.size();
  G.clear(); G.resize(n+1);
  for(int i=0;i<MAX_N;i++){
    ox[i].clear(); oy[i].clear();
  }
  memset(vis,0,sizeof vis);

  init(n);
  for(int i=0;i<n;i++){
    ox[x[i]].push_back(ii(y[i],i));
    oy[y[i]].push_back(ii(x[i],i));
  }
  for(int i=0;i<MAX_N;i++){
    sort(ox[i].begin(),ox[i].end());
    sort(oy[i].begin(),oy[i].end());
  }
  vector<int> ru,rv,ra,rb;
  int id=-1;
  for(int i=0;i<MAX_N;i++){
    int a,b;
    for(int j=0;j<ox[i].size();j++){
      if(j+1!=ox[i].size() && ox[i][j+1].first-ox[i][j].first==2){
	a=ox[i][j+1].second; b=ox[i][j].second;
	unionset(a,b);
	G[a].push_back(b);
	G[b].push_back(a);
      }
    }
    for(int j=0;j<oy[i].size();j++){
      if(id==-1){
	id=oy[i][j].second;
      }
      if(j+1!=oy[i].size() && oy[i][j+1].first-oy[i][j].first==2){
	a=oy[i][j+1].second; b=oy[i][j].second;
	unionset(a,b);
	G[a].push_back(b);
	G[b].push_back(a);
      }
    }
  }
  if(tam[findset(0)]!=n) return 0;
  queue<int> q; q.push(id);
  set<ii> ban; vis[id]=1;
  while(!q.empty()){
    int u; u=q.front();
    q.pop();
    int c=0;
    for(auto &v:G[u]){
      if(!vis[v]) c++;
    }
    while(c!=0){
      int id=-1;
      for(auto &v:G[u]){
	if(vis[v]) continue;
	id=v;
	int mid;
	if(x[u]==x[v]){
	  mid=(y[u]+y[v])/2;
	  if(ban.find(ii(x[u]+1,mid))!=ban.end() || ban.find(ii(x[u]-1,mid))!=ban.end()){
	    id=v; break;
	  }
	}
	else{
	  mid=(x[u]+x[v])/2;
	  if(ban.find(ii(mid,y[u]+1))!=ban.end() || ban.find(ii(mid,y[u]-1))!=ban.end()){
	    id=v; break;
	  }
	}
      }
      vis[id]=1;
      int a,b,mid;
      if(x[u]==x[id]){
	mid=(y[u]+y[id])/2;
	if(ban.find(ii(x[u]-1,mid))==ban.end()){
	  a=x[u]-1; b=mid;
	}
	else{
	  a=x[u]+1; b=mid;
	}
      }
      else{
	mid=(x[u]+x[id])/2;
	if(ban.find(ii(mid,y[u]-1))==ban.end()){
	  a=mid; b=y[u]-1;
	}
	else{
	  a=mid; b=y[u]+1;

	}
      }
      ban.insert(ii(a,b));
      ru.push_back(u); rv.push_back(id);
      ra.push_back(a); rb.push_back(b);
      q.push(id);
      c--;
    }
  }
  build(ru,rv,ra,rb);
  return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:58: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]
   58 |     for(int j=0;j<ox[i].size();j++){
      |                 ~^~~~~~~~~~~~~
parks.cpp:59:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |       if(j+1!=ox[i].size() && ox[i][j+1].first-ox[i][j].first==2){
      |          ~~~^~~~~~~~~~~~~~
parks.cpp:66: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]
   66 |     for(int j=0;j<oy[i].size();j++){
      |                 ~^~~~~~~~~~~~~
parks.cpp:70:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   70 |       if(j+1!=oy[i].size() && oy[i][j+1].first-oy[i][j].first==2){
      |          ~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
17 Correct 8 ms 9876 KB Output is correct
18 Correct 8 ms 9804 KB Output is correct
19 Correct 8 ms 9804 KB Output is correct
20 Correct 11 ms 9824 KB Output is correct
21 Correct 8 ms 9804 KB Output is correct
22 Correct 8 ms 9804 KB Output is correct
23 Correct 437 ms 49284 KB Output is correct
24 Correct 8 ms 9804 KB Output is correct
25 Correct 12 ms 10060 KB Output is correct
26 Correct 10 ms 10164 KB Output is correct
27 Correct 11 ms 10188 KB Output is correct
28 Correct 149 ms 25780 KB Output is correct
29 Correct 232 ms 33392 KB Output is correct
30 Correct 364 ms 41688 KB Output is correct
31 Correct 412 ms 49260 KB Output is correct
32 Correct 8 ms 9804 KB Output is correct
33 Correct 8 ms 9804 KB Output is correct
34 Correct 9 ms 9804 KB Output is correct
35 Correct 8 ms 9804 KB Output is correct
36 Correct 8 ms 9804 KB Output is correct
37 Correct 9 ms 9804 KB Output is correct
38 Correct 8 ms 9804 KB Output is correct
39 Correct 8 ms 9804 KB Output is correct
40 Correct 8 ms 9928 KB Output is correct
41 Correct 9 ms 9804 KB Output is correct
42 Correct 8 ms 9804 KB Output is correct
43 Correct 9 ms 10008 KB Output is correct
44 Correct 14 ms 10188 KB Output is correct
45 Correct 214 ms 30184 KB Output is correct
46 Correct 268 ms 40040 KB Output is correct
47 Correct 262 ms 39984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
17 Correct 8 ms 9876 KB Output is correct
18 Correct 8 ms 9804 KB Output is correct
19 Correct 8 ms 9804 KB Output is correct
20 Correct 11 ms 9824 KB Output is correct
21 Correct 8 ms 9804 KB Output is correct
22 Correct 8 ms 9804 KB Output is correct
23 Correct 437 ms 49284 KB Output is correct
24 Correct 8 ms 9804 KB Output is correct
25 Correct 12 ms 10060 KB Output is correct
26 Correct 10 ms 10164 KB Output is correct
27 Correct 11 ms 10188 KB Output is correct
28 Correct 149 ms 25780 KB Output is correct
29 Correct 232 ms 33392 KB Output is correct
30 Correct 364 ms 41688 KB Output is correct
31 Correct 412 ms 49260 KB Output is correct
32 Correct 8 ms 9804 KB Output is correct
33 Correct 8 ms 9804 KB Output is correct
34 Correct 9 ms 9804 KB Output is correct
35 Correct 8 ms 9804 KB Output is correct
36 Correct 8 ms 9804 KB Output is correct
37 Correct 9 ms 9804 KB Output is correct
38 Correct 8 ms 9804 KB Output is correct
39 Correct 8 ms 9804 KB Output is correct
40 Correct 8 ms 9928 KB Output is correct
41 Correct 9 ms 9804 KB Output is correct
42 Correct 8 ms 9804 KB Output is correct
43 Correct 9 ms 10008 KB Output is correct
44 Correct 14 ms 10188 KB Output is correct
45 Correct 214 ms 30184 KB Output is correct
46 Correct 268 ms 40040 KB Output is correct
47 Correct 262 ms 39984 KB Output is correct
48 Correct 8 ms 9844 KB Output is correct
49 Correct 8 ms 9892 KB Output is correct
50 Correct 8 ms 9804 KB Output is correct
51 Correct 8 ms 9804 KB Output is correct
52 Correct 9 ms 9804 KB Output is correct
53 Correct 8 ms 9824 KB Output is correct
54 Correct 8 ms 9900 KB Output is correct
55 Correct 516 ms 49540 KB Output is correct
56 Correct 9 ms 9804 KB Output is correct
57 Correct 11 ms 10188 KB Output is correct
58 Correct 16 ms 11132 KB Output is correct
59 Correct 16 ms 10828 KB Output is correct
60 Correct 208 ms 29656 KB Output is correct
61 Correct 262 ms 36740 KB Output is correct
62 Correct 348 ms 42428 KB Output is correct
63 Correct 478 ms 49576 KB Output is correct
64 Correct 9 ms 9804 KB Output is correct
65 Correct 9 ms 9804 KB Output is correct
66 Correct 8 ms 9804 KB Output is correct
67 Correct 437 ms 49264 KB Output is correct
68 Correct 407 ms 49300 KB Output is correct
69 Correct 484 ms 49104 KB Output is correct
70 Correct 11 ms 10288 KB Output is correct
71 Correct 14 ms 10652 KB Output is correct
72 Correct 185 ms 29784 KB Output is correct
73 Correct 308 ms 39784 KB Output is correct
74 Correct 395 ms 49768 KB Output is correct
75 Correct 435 ms 49448 KB Output is correct
76 Correct 401 ms 49260 KB Output is correct
77 Correct 11 ms 10316 KB Output is correct
78 Correct 15 ms 10736 KB Output is correct
79 Correct 178 ms 29608 KB Output is correct
80 Correct 288 ms 39432 KB Output is correct
81 Correct 433 ms 49612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
17 Correct 8 ms 9896 KB Output is correct
18 Correct 8 ms 9804 KB Output is correct
19 Correct 7 ms 9804 KB Output is correct
20 Correct 507 ms 50724 KB Output is correct
21 Correct 426 ms 49332 KB Output is correct
22 Correct 511 ms 49876 KB Output is correct
23 Correct 309 ms 43432 KB Output is correct
24 Correct 81 ms 23240 KB Output is correct
25 Correct 138 ms 29096 KB Output is correct
26 Correct 133 ms 29060 KB Output is correct
27 Correct 377 ms 47948 KB Output is correct
28 Correct 392 ms 47972 KB Output is correct
29 Correct 400 ms 47988 KB Output is correct
30 Correct 407 ms 47932 KB Output is correct
31 Correct 9 ms 9804 KB Output is correct
32 Correct 38 ms 13016 KB Output is correct
33 Correct 106 ms 20724 KB Output is correct
34 Correct 508 ms 50584 KB Output is correct
35 Correct 17 ms 10800 KB Output is correct
36 Correct 41 ms 14932 KB Output is correct
37 Correct 84 ms 20064 KB Output is correct
38 Correct 167 ms 25284 KB Output is correct
39 Correct 237 ms 31528 KB Output is correct
40 Correct 369 ms 37492 KB Output is correct
41 Correct 458 ms 43252 KB Output is correct
42 Correct 540 ms 48876 KB Output is correct
43 Correct 10 ms 9804 KB Output is correct
44 Correct 9 ms 9804 KB Output is correct
45 Correct 9 ms 9896 KB Output is correct
46 Correct 9 ms 9844 KB Output is correct
47 Correct 9 ms 9804 KB Output is correct
48 Correct 8 ms 9804 KB Output is correct
49 Correct 9 ms 9804 KB Output is correct
50 Correct 9 ms 9804 KB Output is correct
51 Correct 8 ms 9804 KB Output is correct
52 Correct 8 ms 9812 KB Output is correct
53 Correct 9 ms 9824 KB Output is correct
54 Correct 9 ms 10060 KB Output is correct
55 Correct 10 ms 10212 KB Output is correct
56 Correct 202 ms 30240 KB Output is correct
57 Correct 335 ms 39980 KB Output is correct
58 Correct 288 ms 39992 KB Output is correct
59 Correct 10 ms 9804 KB Output is correct
60 Correct 9 ms 9804 KB Output is correct
61 Correct 7 ms 9804 KB Output is correct
62 Correct 413 ms 49216 KB Output is correct
63 Correct 418 ms 49260 KB Output is correct
64 Correct 361 ms 49196 KB Output is correct
65 Correct 12 ms 10424 KB Output is correct
66 Correct 16 ms 10664 KB Output is correct
67 Correct 179 ms 29796 KB Output is correct
68 Correct 290 ms 39768 KB Output is correct
69 Correct 410 ms 49836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
17 Correct 511 ms 48952 KB Output is correct
18 Correct 489 ms 49028 KB Output is correct
19 Correct 468 ms 49312 KB Output is correct
20 Correct 445 ms 46808 KB Output is correct
21 Correct 383 ms 44564 KB Output is correct
22 Correct 8 ms 9804 KB Output is correct
23 Correct 68 ms 16340 KB Output is correct
24 Correct 25 ms 11852 KB Output is correct
25 Correct 53 ms 16904 KB Output is correct
26 Correct 105 ms 22064 KB Output is correct
27 Correct 214 ms 29508 KB Output is correct
28 Correct 268 ms 34460 KB Output is correct
29 Correct 348 ms 39224 KB Output is correct
30 Correct 413 ms 44080 KB Output is correct
31 Correct 463 ms 48892 KB Output is correct
32 Correct 403 ms 49320 KB Output is correct
33 Correct 412 ms 49264 KB Output is correct
34 Correct 11 ms 10316 KB Output is correct
35 Correct 13 ms 10840 KB Output is correct
36 Correct 168 ms 29672 KB Output is correct
37 Correct 283 ms 39328 KB Output is correct
38 Correct 420 ms 49700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 9804 KB Output is correct
2 Correct 9 ms 9896 KB Output is correct
3 Correct 9 ms 9804 KB Output is correct
4 Correct 8 ms 9864 KB Output is correct
5 Correct 9 ms 9804 KB Output is correct
6 Correct 9 ms 9804 KB Output is correct
7 Correct 11 ms 9896 KB Output is correct
8 Correct 8 ms 9804 KB Output is correct
9 Correct 194 ms 32316 KB Output is correct
10 Correct 23 ms 12236 KB Output is correct
11 Correct 75 ms 21948 KB Output is correct
12 Correct 27 ms 13392 KB Output is correct
13 Correct 28 ms 15044 KB Output is correct
14 Correct 9 ms 9932 KB Output is correct
15 Correct 10 ms 10060 KB Output is correct
16 Correct 175 ms 32336 KB Output is correct
17 Correct 8 ms 9876 KB Output is correct
18 Correct 8 ms 9804 KB Output is correct
19 Correct 8 ms 9804 KB Output is correct
20 Correct 11 ms 9824 KB Output is correct
21 Correct 8 ms 9804 KB Output is correct
22 Correct 8 ms 9804 KB Output is correct
23 Correct 437 ms 49284 KB Output is correct
24 Correct 8 ms 9804 KB Output is correct
25 Correct 12 ms 10060 KB Output is correct
26 Correct 10 ms 10164 KB Output is correct
27 Correct 11 ms 10188 KB Output is correct
28 Correct 149 ms 25780 KB Output is correct
29 Correct 232 ms 33392 KB Output is correct
30 Correct 364 ms 41688 KB Output is correct
31 Correct 412 ms 49260 KB Output is correct
32 Correct 8 ms 9804 KB Output is correct
33 Correct 8 ms 9804 KB Output is correct
34 Correct 9 ms 9804 KB Output is correct
35 Correct 8 ms 9804 KB Output is correct
36 Correct 8 ms 9804 KB Output is correct
37 Correct 9 ms 9804 KB Output is correct
38 Correct 8 ms 9804 KB Output is correct
39 Correct 8 ms 9804 KB Output is correct
40 Correct 8 ms 9928 KB Output is correct
41 Correct 9 ms 9804 KB Output is correct
42 Correct 8 ms 9804 KB Output is correct
43 Correct 9 ms 10008 KB Output is correct
44 Correct 14 ms 10188 KB Output is correct
45 Correct 214 ms 30184 KB Output is correct
46 Correct 268 ms 40040 KB Output is correct
47 Correct 262 ms 39984 KB Output is correct
48 Correct 8 ms 9844 KB Output is correct
49 Correct 8 ms 9892 KB Output is correct
50 Correct 8 ms 9804 KB Output is correct
51 Correct 8 ms 9804 KB Output is correct
52 Correct 9 ms 9804 KB Output is correct
53 Correct 8 ms 9824 KB Output is correct
54 Correct 8 ms 9900 KB Output is correct
55 Correct 516 ms 49540 KB Output is correct
56 Correct 9 ms 9804 KB Output is correct
57 Correct 11 ms 10188 KB Output is correct
58 Correct 16 ms 11132 KB Output is correct
59 Correct 16 ms 10828 KB Output is correct
60 Correct 208 ms 29656 KB Output is correct
61 Correct 262 ms 36740 KB Output is correct
62 Correct 348 ms 42428 KB Output is correct
63 Correct 478 ms 49576 KB Output is correct
64 Correct 9 ms 9804 KB Output is correct
65 Correct 9 ms 9804 KB Output is correct
66 Correct 8 ms 9804 KB Output is correct
67 Correct 437 ms 49264 KB Output is correct
68 Correct 407 ms 49300 KB Output is correct
69 Correct 484 ms 49104 KB Output is correct
70 Correct 11 ms 10288 KB Output is correct
71 Correct 14 ms 10652 KB Output is correct
72 Correct 185 ms 29784 KB Output is correct
73 Correct 308 ms 39784 KB Output is correct
74 Correct 395 ms 49768 KB Output is correct
75 Correct 435 ms 49448 KB Output is correct
76 Correct 401 ms 49260 KB Output is correct
77 Correct 11 ms 10316 KB Output is correct
78 Correct 15 ms 10736 KB Output is correct
79 Correct 178 ms 29608 KB Output is correct
80 Correct 288 ms 39432 KB Output is correct
81 Correct 433 ms 49612 KB Output is correct
82 Correct 8 ms 9896 KB Output is correct
83 Correct 8 ms 9804 KB Output is correct
84 Correct 7 ms 9804 KB Output is correct
85 Correct 507 ms 50724 KB Output is correct
86 Correct 426 ms 49332 KB Output is correct
87 Correct 511 ms 49876 KB Output is correct
88 Correct 309 ms 43432 KB Output is correct
89 Correct 81 ms 23240 KB Output is correct
90 Correct 138 ms 29096 KB Output is correct
91 Correct 133 ms 29060 KB Output is correct
92 Correct 377 ms 47948 KB Output is correct
93 Correct 392 ms 47972 KB Output is correct
94 Correct 400 ms 47988 KB Output is correct
95 Correct 407 ms 47932 KB Output is correct
96 Correct 9 ms 9804 KB Output is correct
97 Correct 38 ms 13016 KB Output is correct
98 Correct 106 ms 20724 KB Output is correct
99 Correct 508 ms 50584 KB Output is correct
100 Correct 17 ms 10800 KB Output is correct
101 Correct 41 ms 14932 KB Output is correct
102 Correct 84 ms 20064 KB Output is correct
103 Correct 167 ms 25284 KB Output is correct
104 Correct 237 ms 31528 KB Output is correct
105 Correct 369 ms 37492 KB Output is correct
106 Correct 458 ms 43252 KB Output is correct
107 Correct 540 ms 48876 KB Output is correct
108 Correct 10 ms 9804 KB Output is correct
109 Correct 9 ms 9804 KB Output is correct
110 Correct 9 ms 9896 KB Output is correct
111 Correct 9 ms 9844 KB Output is correct
112 Correct 9 ms 9804 KB Output is correct
113 Correct 8 ms 9804 KB Output is correct
114 Correct 9 ms 9804 KB Output is correct
115 Correct 9 ms 9804 KB Output is correct
116 Correct 8 ms 9804 KB Output is correct
117 Correct 8 ms 9812 KB Output is correct
118 Correct 9 ms 9824 KB Output is correct
119 Correct 9 ms 10060 KB Output is correct
120 Correct 10 ms 10212 KB Output is correct
121 Correct 202 ms 30240 KB Output is correct
122 Correct 335 ms 39980 KB Output is correct
123 Correct 288 ms 39992 KB Output is correct
124 Correct 10 ms 9804 KB Output is correct
125 Correct 9 ms 9804 KB Output is correct
126 Correct 7 ms 9804 KB Output is correct
127 Correct 413 ms 49216 KB Output is correct
128 Correct 418 ms 49260 KB Output is correct
129 Correct 361 ms 49196 KB Output is correct
130 Correct 12 ms 10424 KB Output is correct
131 Correct 16 ms 10664 KB Output is correct
132 Correct 179 ms 29796 KB Output is correct
133 Correct 290 ms 39768 KB Output is correct
134 Correct 410 ms 49836 KB Output is correct
135 Correct 511 ms 48952 KB Output is correct
136 Correct 489 ms 49028 KB Output is correct
137 Correct 468 ms 49312 KB Output is correct
138 Correct 445 ms 46808 KB Output is correct
139 Correct 383 ms 44564 KB Output is correct
140 Correct 8 ms 9804 KB Output is correct
141 Correct 68 ms 16340 KB Output is correct
142 Correct 25 ms 11852 KB Output is correct
143 Correct 53 ms 16904 KB Output is correct
144 Correct 105 ms 22064 KB Output is correct
145 Correct 214 ms 29508 KB Output is correct
146 Correct 268 ms 34460 KB Output is correct
147 Correct 348 ms 39224 KB Output is correct
148 Correct 413 ms 44080 KB Output is correct
149 Correct 463 ms 48892 KB Output is correct
150 Correct 403 ms 49320 KB Output is correct
151 Correct 412 ms 49264 KB Output is correct
152 Correct 11 ms 10316 KB Output is correct
153 Correct 13 ms 10840 KB Output is correct
154 Correct 168 ms 29672 KB Output is correct
155 Correct 283 ms 39328 KB Output is correct
156 Correct 420 ms 49700 KB Output is correct
157 Correct 10 ms 9804 KB Output is correct
158 Correct 8 ms 9804 KB Output is correct
159 Correct 9 ms 9804 KB Output is correct
160 Correct 9 ms 9804 KB Output is correct
161 Correct 467 ms 48024 KB Output is correct
162 Correct 460 ms 50584 KB Output is correct
163 Correct 463 ms 51020 KB Output is correct
164 Correct 517 ms 51132 KB Output is correct
165 Correct 413 ms 50780 KB Output is correct
166 Correct 359 ms 50652 KB Output is correct
167 Incorrect 98 ms 18872 KB Tree @(185719, 20659) appears more than once: for edges on positions 32 and 36
168 Halted 0 ms 0 KB -