Submission #1050680

# Submission time Handle Problem Language Result Execution time Memory
1050680 2024-08-09T12:29:18 Z Malix Fountain Parks (IOI21_parks) C++17
70 / 100
1483 ms 75684 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))

ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;

map<pi,pi> p;
map<pi,int> s,num,used;

pi parent(pi x){
    if(p[x]==x)return x;
    return p[x]=parent(p[x]);
}

void join(pi x,pi y){
    x=parent(x);
    y=parent(y);
    if(x==y)return;
    if(s[x]<s[y])swap(x,y);
    s[x]+=s[y];
    p[y]=x;
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
    int n=x.size();
    int mx=0;
    REP(i,0,n)mx=max(mx,x[i]);
if(mx==2){
    pii a;
    REP(i,0,n)a.PB({y[i],i});
    sort(a.begin(),a.end());
    vii ans(4);
    REP(i,0,n-1){
        if(a[i].F+2!=a[i+1].F)return 0;
        ans[0].PB(a[i].S);
        ans[1].PB(a[i+1].S);
        ans[2].PB(3);
        ans[3].PB(a[i].F+1);
    }
    build(ans[0],ans[1],ans[2],ans[3]);
    return 1;
}
if(mx==4){
    REP(i,0,n)s[{x[i],y[i]}]=1;
    REP(i,0,n)p[{x[i],y[i]}]={x[i],y[i]};
    REP(i,0,n)num[{x[i],y[i]}]=i;
    vii ans(4);
    REP(i,2,5){
        REP(j,2,200001){
            if(j<200000&&s[{i,j}]>0&&s[{i,j+2}]>0){
                join({i,j},{i,j+2});
                ans[0].PB(num[{i,j}]);
                ans[1].PB(num[{i,j+2}]);
                if(i==2)ans[2].PB(i-1);
                else ans[2].PB(i+1);
                ans[3].PB(j+1);
            }
            if(i==2&&s[{i,j}]>0&&s[{i+2,j}]>0){
                join({i,j},{i+2,j});
                ans[0].PB(num[{i,j}]);
                ans[1].PB(num[{i+2,j}]);
                ans[2].PB(i+1);
                ans[3].PB(j-1);
            }
            j++;
        }
        i++;
    }
    pi t=parent({x[0],y[0]});
    bool flag=1;
    REP(i,0,n)if(parent({x[i],y[i]})!=t)flag=0;
    if(flag){
        build(ans[0],ans[1],ans[2],ans[3]);
        return 1;
    }
    return 0;
}
if(mx==6){
    REP(i,0,n)s[{x[i],y[i]}]=1;
    REP(i,0,n)p[{x[i],y[i]}]={x[i],y[i]};
    REP(i,0,n)num[{x[i],y[i]}]=i;
    vii ans(4);
    REP(i,2,7){
        REP(j,2,200000){
            if(s[{i,j}]>0&&s[{i,j+2}]>0){
                join({i,j},{i,j+2});
                ans[0].PB(num[{i,j}]);
                ans[1].PB(num[{i,j+2}]);
                if(i==2)ans[2].PB(i-1);
                else if(i==6)ans[2].PB(i+1);
                else if(i==4){
                    if((j/2)%2==0)ans[2].PB(i+1);
                    else ans[2].PB(i-1);
                }
                ans[3].PB(j+1);
                used[{ans[2].back(),ans[3].back()}]=1;
            }
            j++;
        }
        i++;
    }
    REP(i,2,5){
        REP(j,2,200001){
            if(s[{i,j}]>0&&s[{i+2,j}]>0&&parent({i,j})!=parent({i+2,j})){
                if(used[{i+1,j-1}]==1&&used[{i+1,j+1}])return 0;
                join({i,j},{i+2,j});
                ans[0].PB(num[{i,j}]);
                ans[1].PB(num[{i+2,j}]);
                if(used[{i+1,j-1}]==1){
                    ans[2].PB(i+1);
                    ans[3].PB(j+1);
                }
                else{
                    ans[2].PB(i+1);
                    ans[3].PB(j-1);
                }
            }
            j++;
        }
        i++;
    }
    pi t=parent({x[0],y[0]});
    bool flag=1;
    REP(i,0,n)if(parent({x[i],y[i]})!=t)flag=0;
    if(flag){
        build(ans[0],ans[1],ans[2],ans[3]);
        return 1;
    }
    return 0;
}
    REP(i,0,n)s[{x[i],y[i]}]=1;
    REP(i,0,n)p[{x[i],y[i]}]={x[i],y[i]};
    REP(i,0,n)num[{x[i],y[i]}]=i;
    vii ans(4);
    pii loc={{0,2},{0,-2},{2,0},{-2,0}};
    REP(i,0,n){
        REP(j,0,4)if(s[{x[i]+loc[j].F,y[i]+loc[j].S}]>0&&parent({x[i],y[i]})!=parent({x[i]+loc[j].F,y[i]+loc[j].S})){
            join({x[i],y[i]},{x[i]+loc[j].F,y[i]+loc[j].S});
            ans[0].PB(num[{x[i],y[i]}]);
            ans[1].PB(num[{x[i]+loc[j].F,y[i]+loc[j].S}]);
            if(loc[j].F==0){
                if((x[i]/2)%2==0){
                    if((min(y[i],y[i]+loc[j].S)/2)%2==1)ans[2].PB(x[i]+1);
                    else ans[2].PB(x[i]-1);
                }
                else{
                    if((min(y[i],y[i]+loc[j].S)/2)%2==1)ans[2].PB(x[i]-1);
                    else ans[2].PB(x[i]+1);
                }
                ans[3].PB(min(y[i],y[i]+loc[j].S)+1);
            }
            else{
                ans[2].PB(min(x[i],x[i]+loc[j].F)+1);
                if((y[i]/2)%2==0){
                    if((min(x[i],x[i]+loc[j].F)/2)%2==1)ans[3].PB(y[i]-1);
                    else ans[3].PB(y[i]+1);
                }
                else{
                    if((min(x[i],x[i]+loc[j].F)/2)%2==1)ans[3].PB(y[i]+1);
                    else ans[3].PB(y[i]-1);
                }
            }
        }
    }
    pi t=parent({x[0],y[0]});
    bool flag=1;
    REP(i,0,n)if(parent({x[i],y[i]})!=t)flag=0;
    if(flag){
        build(ans[0],ans[1],ans[2],ans[3]);
        return 1;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
17 Correct 35 ms 12884 KB Output is correct
18 Correct 39 ms 12888 KB Output is correct
19 Correct 34 ms 12740 KB Output is correct
20 Correct 39 ms 12884 KB Output is correct
21 Correct 39 ms 12880 KB Output is correct
22 Correct 36 ms 12884 KB Output is correct
23 Correct 591 ms 55228 KB Output is correct
24 Correct 43 ms 12888 KB Output is correct
25 Correct 40 ms 13140 KB Output is correct
26 Correct 41 ms 13304 KB Output is correct
27 Correct 39 ms 13396 KB Output is correct
28 Correct 212 ms 29884 KB Output is correct
29 Correct 360 ms 38316 KB Output is correct
30 Correct 478 ms 46572 KB Output is correct
31 Correct 582 ms 55196 KB Output is correct
32 Correct 36 ms 12884 KB Output is correct
33 Correct 35 ms 12884 KB Output is correct
34 Correct 35 ms 12884 KB Output is correct
35 Correct 35 ms 12880 KB Output is correct
36 Correct 35 ms 12880 KB Output is correct
37 Correct 35 ms 12860 KB Output is correct
38 Correct 36 ms 12880 KB Output is correct
39 Correct 37 ms 12896 KB Output is correct
40 Correct 35 ms 12880 KB Output is correct
41 Correct 41 ms 12884 KB Output is correct
42 Correct 40 ms 12880 KB Output is correct
43 Correct 44 ms 13140 KB Output is correct
44 Correct 38 ms 13392 KB Output is correct
45 Correct 285 ms 31632 KB Output is correct
46 Correct 417 ms 40100 KB Output is correct
47 Correct 398 ms 40104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
17 Correct 35 ms 12884 KB Output is correct
18 Correct 39 ms 12888 KB Output is correct
19 Correct 34 ms 12740 KB Output is correct
20 Correct 39 ms 12884 KB Output is correct
21 Correct 39 ms 12880 KB Output is correct
22 Correct 36 ms 12884 KB Output is correct
23 Correct 591 ms 55228 KB Output is correct
24 Correct 43 ms 12888 KB Output is correct
25 Correct 40 ms 13140 KB Output is correct
26 Correct 41 ms 13304 KB Output is correct
27 Correct 39 ms 13396 KB Output is correct
28 Correct 212 ms 29884 KB Output is correct
29 Correct 360 ms 38316 KB Output is correct
30 Correct 478 ms 46572 KB Output is correct
31 Correct 582 ms 55196 KB Output is correct
32 Correct 36 ms 12884 KB Output is correct
33 Correct 35 ms 12884 KB Output is correct
34 Correct 35 ms 12884 KB Output is correct
35 Correct 35 ms 12880 KB Output is correct
36 Correct 35 ms 12880 KB Output is correct
37 Correct 35 ms 12860 KB Output is correct
38 Correct 36 ms 12880 KB Output is correct
39 Correct 37 ms 12896 KB Output is correct
40 Correct 35 ms 12880 KB Output is correct
41 Correct 41 ms 12884 KB Output is correct
42 Correct 40 ms 12880 KB Output is correct
43 Correct 44 ms 13140 KB Output is correct
44 Correct 38 ms 13392 KB Output is correct
45 Correct 285 ms 31632 KB Output is correct
46 Correct 417 ms 40100 KB Output is correct
47 Correct 398 ms 40104 KB Output is correct
48 Correct 60 ms 19024 KB Output is correct
49 Correct 58 ms 19084 KB Output is correct
50 Correct 63 ms 19052 KB Output is correct
51 Correct 59 ms 19024 KB Output is correct
52 Correct 60 ms 19028 KB Output is correct
53 Correct 64 ms 18952 KB Output is correct
54 Correct 62 ms 18976 KB Output is correct
55 Correct 681 ms 69104 KB Output is correct
56 Correct 60 ms 19128 KB Output is correct
57 Correct 68 ms 19548 KB Output is correct
58 Correct 84 ms 20608 KB Output is correct
59 Correct 81 ms 21332 KB Output is correct
60 Correct 348 ms 44216 KB Output is correct
61 Correct 455 ms 52984 KB Output is correct
62 Correct 582 ms 60580 KB Output is correct
63 Correct 692 ms 69288 KB Output is correct
64 Correct 81 ms 19028 KB Output is correct
65 Correct 58 ms 19024 KB Output is correct
66 Correct 60 ms 19032 KB Output is correct
67 Correct 614 ms 69164 KB Output is correct
68 Correct 615 ms 69292 KB Output is correct
69 Correct 609 ms 69032 KB Output is correct
70 Correct 67 ms 19836 KB Output is correct
71 Correct 77 ms 20816 KB Output is correct
72 Correct 359 ms 44212 KB Output is correct
73 Correct 519 ms 56644 KB Output is correct
74 Correct 706 ms 69428 KB Output is correct
75 Correct 648 ms 69536 KB Output is correct
76 Correct 619 ms 69288 KB Output is correct
77 Correct 72 ms 20308 KB Output is correct
78 Correct 74 ms 21072 KB Output is correct
79 Correct 343 ms 44184 KB Output is correct
80 Correct 528 ms 56724 KB Output is correct
81 Correct 693 ms 69284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 416 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1234 ms 62852 KB Output is correct
21 Correct 1229 ms 65192 KB Output is correct
22 Correct 1208 ms 65200 KB Output is correct
23 Correct 1010 ms 65964 KB Output is correct
24 Correct 532 ms 67740 KB Output is correct
25 Correct 1483 ms 58472 KB Output is correct
26 Correct 1164 ms 58260 KB Output is correct
27 Correct 1310 ms 64552 KB Output is correct
28 Correct 1190 ms 64528 KB Output is correct
29 Correct 1410 ms 64676 KB Output is correct
30 Correct 1449 ms 64692 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 51 ms 5396 KB Output is correct
33 Correct 179 ms 34384 KB Output is correct
34 Correct 1098 ms 65568 KB Output is correct
35 Correct 33 ms 3156 KB Output is correct
36 Correct 213 ms 14012 KB Output is correct
37 Correct 513 ms 27832 KB Output is correct
38 Correct 434 ms 24868 KB Output is correct
39 Correct 598 ms 34228 KB Output is correct
40 Correct 799 ms 42996 KB Output is correct
41 Correct 1078 ms 52348 KB Output is correct
42 Correct 1313 ms 61368 KB Output is correct
43 Correct 36 ms 12884 KB Output is correct
44 Correct 35 ms 12884 KB Output is correct
45 Correct 35 ms 12884 KB Output is correct
46 Correct 35 ms 12740 KB Output is correct
47 Correct 35 ms 12880 KB Output is correct
48 Correct 35 ms 12884 KB Output is correct
49 Correct 35 ms 12880 KB Output is correct
50 Correct 38 ms 12880 KB Output is correct
51 Correct 36 ms 12884 KB Output is correct
52 Correct 35 ms 12884 KB Output is correct
53 Correct 35 ms 12876 KB Output is correct
54 Correct 39 ms 13248 KB Output is correct
55 Correct 42 ms 13372 KB Output is correct
56 Correct 281 ms 32444 KB Output is correct
57 Correct 410 ms 41384 KB Output is correct
58 Correct 404 ms 41184 KB Output is correct
59 Correct 64 ms 19028 KB Output is correct
60 Correct 57 ms 19024 KB Output is correct
61 Correct 58 ms 19028 KB Output is correct
62 Correct 680 ms 70820 KB Output is correct
63 Correct 594 ms 70820 KB Output is correct
64 Correct 606 ms 70564 KB Output is correct
65 Correct 67 ms 20052 KB Output is correct
66 Correct 72 ms 20776 KB Output is correct
67 Correct 374 ms 45212 KB Output is correct
68 Correct 510 ms 58024 KB Output is correct
69 Correct 733 ms 70824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
17 Correct 1273 ms 75432 KB Output is correct
18 Correct 1248 ms 75684 KB Output is correct
19 Correct 1220 ms 62920 KB Output is correct
20 Correct 1187 ms 55144 KB Output is correct
21 Correct 1106 ms 60320 KB Output is correct
22 Correct 0 ms 604 KB Output is correct
23 Correct 126 ms 10648 KB Output is correct
24 Correct 71 ms 5712 KB Output is correct
25 Correct 345 ms 18888 KB Output is correct
26 Correct 613 ms 31956 KB Output is correct
27 Correct 525 ms 29620 KB Output is correct
28 Correct 663 ms 37304 KB Output is correct
29 Correct 887 ms 44708 KB Output is correct
30 Correct 1084 ms 51632 KB Output is correct
31 Correct 1312 ms 59124 KB Output is correct
32 Correct 649 ms 70820 KB Output is correct
33 Correct 614 ms 70820 KB Output is correct
34 Correct 72 ms 20304 KB Output is correct
35 Correct 78 ms 21256 KB Output is correct
36 Correct 333 ms 45052 KB Output is correct
37 Correct 534 ms 57956 KB Output is correct
38 Correct 713 ms 70824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 30 ms 8288 KB Output is correct
10 Correct 3 ms 1292 KB Output is correct
11 Correct 14 ms 4388 KB Output is correct
12 Correct 5 ms 1508 KB Output is correct
13 Correct 5 ms 2000 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 30 ms 8156 KB Output is correct
17 Correct 35 ms 12884 KB Output is correct
18 Correct 39 ms 12888 KB Output is correct
19 Correct 34 ms 12740 KB Output is correct
20 Correct 39 ms 12884 KB Output is correct
21 Correct 39 ms 12880 KB Output is correct
22 Correct 36 ms 12884 KB Output is correct
23 Correct 591 ms 55228 KB Output is correct
24 Correct 43 ms 12888 KB Output is correct
25 Correct 40 ms 13140 KB Output is correct
26 Correct 41 ms 13304 KB Output is correct
27 Correct 39 ms 13396 KB Output is correct
28 Correct 212 ms 29884 KB Output is correct
29 Correct 360 ms 38316 KB Output is correct
30 Correct 478 ms 46572 KB Output is correct
31 Correct 582 ms 55196 KB Output is correct
32 Correct 36 ms 12884 KB Output is correct
33 Correct 35 ms 12884 KB Output is correct
34 Correct 35 ms 12884 KB Output is correct
35 Correct 35 ms 12880 KB Output is correct
36 Correct 35 ms 12880 KB Output is correct
37 Correct 35 ms 12860 KB Output is correct
38 Correct 36 ms 12880 KB Output is correct
39 Correct 37 ms 12896 KB Output is correct
40 Correct 35 ms 12880 KB Output is correct
41 Correct 41 ms 12884 KB Output is correct
42 Correct 40 ms 12880 KB Output is correct
43 Correct 44 ms 13140 KB Output is correct
44 Correct 38 ms 13392 KB Output is correct
45 Correct 285 ms 31632 KB Output is correct
46 Correct 417 ms 40100 KB Output is correct
47 Correct 398 ms 40104 KB Output is correct
48 Correct 60 ms 19024 KB Output is correct
49 Correct 58 ms 19084 KB Output is correct
50 Correct 63 ms 19052 KB Output is correct
51 Correct 59 ms 19024 KB Output is correct
52 Correct 60 ms 19028 KB Output is correct
53 Correct 64 ms 18952 KB Output is correct
54 Correct 62 ms 18976 KB Output is correct
55 Correct 681 ms 69104 KB Output is correct
56 Correct 60 ms 19128 KB Output is correct
57 Correct 68 ms 19548 KB Output is correct
58 Correct 84 ms 20608 KB Output is correct
59 Correct 81 ms 21332 KB Output is correct
60 Correct 348 ms 44216 KB Output is correct
61 Correct 455 ms 52984 KB Output is correct
62 Correct 582 ms 60580 KB Output is correct
63 Correct 692 ms 69288 KB Output is correct
64 Correct 81 ms 19028 KB Output is correct
65 Correct 58 ms 19024 KB Output is correct
66 Correct 60 ms 19032 KB Output is correct
67 Correct 614 ms 69164 KB Output is correct
68 Correct 615 ms 69292 KB Output is correct
69 Correct 609 ms 69032 KB Output is correct
70 Correct 67 ms 19836 KB Output is correct
71 Correct 77 ms 20816 KB Output is correct
72 Correct 359 ms 44212 KB Output is correct
73 Correct 519 ms 56644 KB Output is correct
74 Correct 706 ms 69428 KB Output is correct
75 Correct 648 ms 69536 KB Output is correct
76 Correct 619 ms 69288 KB Output is correct
77 Correct 72 ms 20308 KB Output is correct
78 Correct 74 ms 21072 KB Output is correct
79 Correct 343 ms 44184 KB Output is correct
80 Correct 528 ms 56724 KB Output is correct
81 Correct 693 ms 69284 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 416 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 1234 ms 62852 KB Output is correct
86 Correct 1229 ms 65192 KB Output is correct
87 Correct 1208 ms 65200 KB Output is correct
88 Correct 1010 ms 65964 KB Output is correct
89 Correct 532 ms 67740 KB Output is correct
90 Correct 1483 ms 58472 KB Output is correct
91 Correct 1164 ms 58260 KB Output is correct
92 Correct 1310 ms 64552 KB Output is correct
93 Correct 1190 ms 64528 KB Output is correct
94 Correct 1410 ms 64676 KB Output is correct
95 Correct 1449 ms 64692 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 51 ms 5396 KB Output is correct
98 Correct 179 ms 34384 KB Output is correct
99 Correct 1098 ms 65568 KB Output is correct
100 Correct 33 ms 3156 KB Output is correct
101 Correct 213 ms 14012 KB Output is correct
102 Correct 513 ms 27832 KB Output is correct
103 Correct 434 ms 24868 KB Output is correct
104 Correct 598 ms 34228 KB Output is correct
105 Correct 799 ms 42996 KB Output is correct
106 Correct 1078 ms 52348 KB Output is correct
107 Correct 1313 ms 61368 KB Output is correct
108 Correct 36 ms 12884 KB Output is correct
109 Correct 35 ms 12884 KB Output is correct
110 Correct 35 ms 12884 KB Output is correct
111 Correct 35 ms 12740 KB Output is correct
112 Correct 35 ms 12880 KB Output is correct
113 Correct 35 ms 12884 KB Output is correct
114 Correct 35 ms 12880 KB Output is correct
115 Correct 38 ms 12880 KB Output is correct
116 Correct 36 ms 12884 KB Output is correct
117 Correct 35 ms 12884 KB Output is correct
118 Correct 35 ms 12876 KB Output is correct
119 Correct 39 ms 13248 KB Output is correct
120 Correct 42 ms 13372 KB Output is correct
121 Correct 281 ms 32444 KB Output is correct
122 Correct 410 ms 41384 KB Output is correct
123 Correct 404 ms 41184 KB Output is correct
124 Correct 64 ms 19028 KB Output is correct
125 Correct 57 ms 19024 KB Output is correct
126 Correct 58 ms 19028 KB Output is correct
127 Correct 680 ms 70820 KB Output is correct
128 Correct 594 ms 70820 KB Output is correct
129 Correct 606 ms 70564 KB Output is correct
130 Correct 67 ms 20052 KB Output is correct
131 Correct 72 ms 20776 KB Output is correct
132 Correct 374 ms 45212 KB Output is correct
133 Correct 510 ms 58024 KB Output is correct
134 Correct 733 ms 70824 KB Output is correct
135 Correct 1273 ms 75432 KB Output is correct
136 Correct 1248 ms 75684 KB Output is correct
137 Correct 1220 ms 62920 KB Output is correct
138 Correct 1187 ms 55144 KB Output is correct
139 Correct 1106 ms 60320 KB Output is correct
140 Correct 0 ms 604 KB Output is correct
141 Correct 126 ms 10648 KB Output is correct
142 Correct 71 ms 5712 KB Output is correct
143 Correct 345 ms 18888 KB Output is correct
144 Correct 613 ms 31956 KB Output is correct
145 Correct 525 ms 29620 KB Output is correct
146 Correct 663 ms 37304 KB Output is correct
147 Correct 887 ms 44708 KB Output is correct
148 Correct 1084 ms 51632 KB Output is correct
149 Correct 1312 ms 59124 KB Output is correct
150 Correct 649 ms 70820 KB Output is correct
151 Correct 614 ms 70820 KB Output is correct
152 Correct 72 ms 20304 KB Output is correct
153 Correct 78 ms 21256 KB Output is correct
154 Correct 333 ms 45052 KB Output is correct
155 Correct 534 ms 57956 KB Output is correct
156 Correct 713 ms 70824 KB Output is correct
157 Correct 61 ms 19024 KB Output is correct
158 Correct 41 ms 12740 KB Output is correct
159 Correct 0 ms 344 KB Output is correct
160 Correct 0 ms 344 KB Output is correct
161 Incorrect 1274 ms 52640 KB Tree @(1489, 1173) appears more than once: for edges on positions 656 and 946
162 Halted 0 ms 0 KB -