Submission #609689

# Submission time Handle Problem Language Result Execution time Memory
609689 2022-07-27T19:20:04 Z Ozy Fountain Parks (IOI21_parks) C++17
70 / 100
1061 ms 91292 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define repa(i,a,b) for (int i = (a); i >= (b); i--)
#define lli long long int
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "

#define X first
#define Y second

map<pair<int,int>, int> mapa,id,bancas;
lli n,p;
stack<pair<lli,lli> > pila;
pair<lli,lli> act,nuevo,mitad;

vector<int> u,v,a,b;
lli dir[8] = {0,2,0,-2,2,0,-2,0};
bool continua;

void construye(int U, int V, int A, int B) {

    u.push_back(U);
    v.push_back(V);
    a.push_back(A);
    b.push_back(B);
}

//quitar varios logs si no da en tiempo
int construct_roads(std::vector<int> x, std::vector<int> y) {

    n = x.size();
    act = {x[0],y[0]};

    rep(i,0,n-1) {
        nuevo = {x[i],y[i]};
        mapa[nuevo] = 1;
        id[nuevo] = i;

        if (nuevo < act) act = nuevo;
    }

    pila.push(act);
    while (!pila.empty()) {

        act = pila.top();
        mapa[act] = 2;
        continua = false;

        rep(i,0,3){
            nuevo = act;
            nuevo.X += dir[i];
            nuevo.Y += dir[i+4];

            p = mapa[nuevo];
            if (p == 0 || p == 2) continue;

            mitad.X = (act.X + nuevo.X)/2;
            mitad.Y = (act.Y + nuevo.Y)/2;

            if (i&1) {
                //movimiento horizontal
                mitad.Y++;
                if (bancas[mitad] == 1) {
                    mitad.Y -= 2;
                    if (bancas[mitad] == 0) {
                        construye(id[act], id[nuevo], mitad.X, mitad.Y);
                        bancas[mitad] = 1;
                        pila.push(nuevo);
                        continua=true;
                        break;
                    }
                }

                mitad.Y -= 2;
                if (bancas[mitad] == 1) {
                    mitad.Y += 2;
                    if (bancas[mitad] == 0) {
                        construye(id[act], id[nuevo], mitad.X, mitad.Y);
                        bancas[mitad] = 1;
                        pila.push(nuevo);
                        continua=true;
                        break;
                    }
                }
            }
            else {
                //movimiento vertical
                mitad.X++;
                if (bancas[mitad] == 1) {
                    mitad.X -= 2;
                    if (bancas[mitad] == 0) {
                        construye(id[act], id[nuevo], mitad.X, mitad.Y);
                        bancas[mitad] = 1;
                        pila.push(nuevo);
                        continua=true;
                        break;
                    }
                }

                mitad.X -= 2;
                if (bancas[mitad] == 1) {
                    mitad.X += 2;
                    if (bancas[mitad] == 0) {
                        construye(id[act], id[nuevo], mitad.X, mitad.Y);
                        bancas[mitad] = 1;
                        pila.push(nuevo);
                        continua=true;
                        break;
                    }
                }
            }
        }
        if (continua) {
            n--;
            continue;
        }
        rep(i,0,3) {
            nuevo = act;
            nuevo.X += dir[i];
            nuevo.Y += dir[i+4];

            p = mapa[nuevo];
            if (p == 0 || p == 2) continue;

            mitad.X = (act.X + nuevo.X)/2;
            mitad.Y = (act.Y + nuevo.Y)/2;
            if (i&1) mitad.Y++;
            else mitad.X++;

            if (bancas[mitad] == 0) {
                construye(id[act], id[nuevo], mitad.X, mitad.Y);
                bancas[mitad] = 1;
                pila.push(nuevo);
                continua=true;
                break;
            }

            if (i&1) mitad.Y -= 2;
            else mitad.X -= 2;

            if (bancas[mitad] == 0) {
                construye(id[act], id[nuevo], mitad.X, mitad.Y);
                bancas[mitad] = 1;
                pila.push(nuevo);
                continua=true;
                break;
            }
        }

        if (continua) {
            n--;
            continue;
        }
        pila.pop();
    }

    if (n > 1) return 0;

    build(u,v,a,b);
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 710 ms 69384 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 3 ms 724 KB Output is correct
26 Correct 4 ms 980 KB Output is correct
27 Correct 4 ms 964 KB Output is correct
28 Correct 254 ms 27884 KB Output is correct
29 Correct 396 ms 41708 KB Output is correct
30 Correct 582 ms 55544 KB Output is correct
31 Correct 719 ms 69292 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 3 ms 724 KB Output is correct
44 Correct 3 ms 724 KB Output is correct
45 Correct 357 ms 36324 KB Output is correct
46 Correct 545 ms 52616 KB Output is correct
47 Correct 536 ms 52680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 710 ms 69384 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 3 ms 724 KB Output is correct
26 Correct 4 ms 980 KB Output is correct
27 Correct 4 ms 964 KB Output is correct
28 Correct 254 ms 27884 KB Output is correct
29 Correct 396 ms 41708 KB Output is correct
30 Correct 582 ms 55544 KB Output is correct
31 Correct 719 ms 69292 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 3 ms 724 KB Output is correct
44 Correct 3 ms 724 KB Output is correct
45 Correct 357 ms 36324 KB Output is correct
46 Correct 545 ms 52616 KB Output is correct
47 Correct 536 ms 52680 KB Output is correct
48 Correct 0 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 719 ms 63112 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 4 ms 872 KB Output is correct
58 Correct 14 ms 2260 KB Output is correct
59 Correct 9 ms 2072 KB Output is correct
60 Correct 327 ms 32464 KB Output is correct
61 Correct 446 ms 43828 KB Output is correct
62 Correct 561 ms 53552 KB Output is correct
63 Correct 734 ms 63896 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 300 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 817 ms 86600 KB Output is correct
68 Correct 837 ms 85016 KB Output is correct
69 Correct 780 ms 84012 KB Output is correct
70 Correct 10 ms 1236 KB Output is correct
71 Correct 9 ms 1776 KB Output is correct
72 Correct 396 ms 35540 KB Output is correct
73 Correct 582 ms 53172 KB Output is correct
74 Correct 785 ms 70876 KB Output is correct
75 Correct 762 ms 73580 KB Output is correct
76 Correct 856 ms 86560 KB Output is correct
77 Correct 8 ms 1400 KB Output is correct
78 Correct 10 ms 1876 KB Output is correct
79 Correct 439 ms 35416 KB Output is correct
80 Correct 604 ms 53168 KB Output is correct
81 Correct 919 ms 70776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 232 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 614 ms 63504 KB Output is correct
21 Correct 657 ms 63284 KB Output is correct
22 Correct 680 ms 63404 KB Output is correct
23 Correct 676 ms 75584 KB Output is correct
24 Correct 235 ms 28412 KB Output is correct
25 Correct 227 ms 28624 KB Output is correct
26 Correct 225 ms 28492 KB Output is correct
27 Correct 716 ms 75632 KB Output is correct
28 Correct 736 ms 75552 KB Output is correct
29 Correct 1061 ms 75572 KB Output is correct
30 Correct 1051 ms 75548 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 44 ms 5324 KB Output is correct
33 Correct 90 ms 14360 KB Output is correct
34 Correct 599 ms 63532 KB Output is correct
35 Correct 16 ms 2428 KB Output is correct
36 Correct 70 ms 8724 KB Output is correct
37 Correct 135 ms 15756 KB Output is correct
38 Correct 278 ms 24804 KB Output is correct
39 Correct 430 ms 33948 KB Output is correct
40 Correct 553 ms 43244 KB Output is correct
41 Correct 653 ms 52416 KB Output is correct
42 Correct 787 ms 61692 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 0 ms 212 KB Output is correct
47 Correct 0 ms 212 KB Output is correct
48 Correct 0 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 3 ms 724 KB Output is correct
55 Correct 3 ms 724 KB Output is correct
56 Correct 361 ms 36448 KB Output is correct
57 Correct 570 ms 52728 KB Output is correct
58 Correct 557 ms 52692 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 0 ms 212 KB Output is correct
62 Correct 809 ms 84972 KB Output is correct
63 Correct 814 ms 83444 KB Output is correct
64 Correct 781 ms 82344 KB Output is correct
65 Correct 6 ms 1204 KB Output is correct
66 Correct 12 ms 1780 KB Output is correct
67 Correct 374 ms 34644 KB Output is correct
68 Correct 577 ms 51936 KB Output is correct
69 Correct 787 ms 69144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
17 Correct 843 ms 91292 KB Output is correct
18 Correct 817 ms 89744 KB Output is correct
19 Correct 654 ms 63328 KB Output is correct
20 Correct 637 ms 58824 KB Output is correct
21 Correct 732 ms 68284 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 102 ms 11044 KB Output is correct
24 Correct 35 ms 4376 KB Output is correct
25 Correct 92 ms 11548 KB Output is correct
26 Correct 145 ms 18764 KB Output is correct
27 Correct 361 ms 30248 KB Output is correct
28 Correct 478 ms 38036 KB Output is correct
29 Correct 615 ms 45640 KB Output is correct
30 Correct 697 ms 52852 KB Output is correct
31 Correct 845 ms 60624 KB Output is correct
32 Correct 751 ms 71824 KB Output is correct
33 Correct 793 ms 85156 KB Output is correct
34 Correct 9 ms 1392 KB Output is correct
35 Correct 9 ms 1836 KB Output is correct
36 Correct 379 ms 34748 KB Output is correct
37 Correct 576 ms 51968 KB Output is correct
38 Correct 785 ms 69124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 363 ms 45724 KB Output is correct
10 Correct 32 ms 4940 KB Output is correct
11 Correct 196 ms 24852 KB Output is correct
12 Correct 45 ms 7292 KB Output is correct
13 Correct 103 ms 15052 KB Output is correct
14 Correct 3 ms 468 KB Output is correct
15 Correct 2 ms 724 KB Output is correct
16 Correct 360 ms 45728 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 710 ms 69384 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 3 ms 724 KB Output is correct
26 Correct 4 ms 980 KB Output is correct
27 Correct 4 ms 964 KB Output is correct
28 Correct 254 ms 27884 KB Output is correct
29 Correct 396 ms 41708 KB Output is correct
30 Correct 582 ms 55544 KB Output is correct
31 Correct 719 ms 69292 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 3 ms 724 KB Output is correct
44 Correct 3 ms 724 KB Output is correct
45 Correct 357 ms 36324 KB Output is correct
46 Correct 545 ms 52616 KB Output is correct
47 Correct 536 ms 52680 KB Output is correct
48 Correct 0 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 719 ms 63112 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 4 ms 872 KB Output is correct
58 Correct 14 ms 2260 KB Output is correct
59 Correct 9 ms 2072 KB Output is correct
60 Correct 327 ms 32464 KB Output is correct
61 Correct 446 ms 43828 KB Output is correct
62 Correct 561 ms 53552 KB Output is correct
63 Correct 734 ms 63896 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 300 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 817 ms 86600 KB Output is correct
68 Correct 837 ms 85016 KB Output is correct
69 Correct 780 ms 84012 KB Output is correct
70 Correct 10 ms 1236 KB Output is correct
71 Correct 9 ms 1776 KB Output is correct
72 Correct 396 ms 35540 KB Output is correct
73 Correct 582 ms 53172 KB Output is correct
74 Correct 785 ms 70876 KB Output is correct
75 Correct 762 ms 73580 KB Output is correct
76 Correct 856 ms 86560 KB Output is correct
77 Correct 8 ms 1400 KB Output is correct
78 Correct 10 ms 1876 KB Output is correct
79 Correct 439 ms 35416 KB Output is correct
80 Correct 604 ms 53168 KB Output is correct
81 Correct 919 ms 70776 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 0 ms 232 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 614 ms 63504 KB Output is correct
86 Correct 657 ms 63284 KB Output is correct
87 Correct 680 ms 63404 KB Output is correct
88 Correct 676 ms 75584 KB Output is correct
89 Correct 235 ms 28412 KB Output is correct
90 Correct 227 ms 28624 KB Output is correct
91 Correct 225 ms 28492 KB Output is correct
92 Correct 716 ms 75632 KB Output is correct
93 Correct 736 ms 75552 KB Output is correct
94 Correct 1061 ms 75572 KB Output is correct
95 Correct 1051 ms 75548 KB Output is correct
96 Correct 0 ms 212 KB Output is correct
97 Correct 44 ms 5324 KB Output is correct
98 Correct 90 ms 14360 KB Output is correct
99 Correct 599 ms 63532 KB Output is correct
100 Correct 16 ms 2428 KB Output is correct
101 Correct 70 ms 8724 KB Output is correct
102 Correct 135 ms 15756 KB Output is correct
103 Correct 278 ms 24804 KB Output is correct
104 Correct 430 ms 33948 KB Output is correct
105 Correct 553 ms 43244 KB Output is correct
106 Correct 653 ms 52416 KB Output is correct
107 Correct 787 ms 61692 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 0 ms 212 KB Output is correct
110 Correct 0 ms 212 KB Output is correct
111 Correct 0 ms 212 KB Output is correct
112 Correct 0 ms 212 KB Output is correct
113 Correct 0 ms 212 KB Output is correct
114 Correct 0 ms 212 KB Output is correct
115 Correct 0 ms 212 KB Output is correct
116 Correct 0 ms 212 KB Output is correct
117 Correct 0 ms 212 KB Output is correct
118 Correct 0 ms 212 KB Output is correct
119 Correct 3 ms 724 KB Output is correct
120 Correct 3 ms 724 KB Output is correct
121 Correct 361 ms 36448 KB Output is correct
122 Correct 570 ms 52728 KB Output is correct
123 Correct 557 ms 52692 KB Output is correct
124 Correct 0 ms 212 KB Output is correct
125 Correct 0 ms 212 KB Output is correct
126 Correct 0 ms 212 KB Output is correct
127 Correct 809 ms 84972 KB Output is correct
128 Correct 814 ms 83444 KB Output is correct
129 Correct 781 ms 82344 KB Output is correct
130 Correct 6 ms 1204 KB Output is correct
131 Correct 12 ms 1780 KB Output is correct
132 Correct 374 ms 34644 KB Output is correct
133 Correct 577 ms 51936 KB Output is correct
134 Correct 787 ms 69144 KB Output is correct
135 Correct 843 ms 91292 KB Output is correct
136 Correct 817 ms 89744 KB Output is correct
137 Correct 654 ms 63328 KB Output is correct
138 Correct 637 ms 58824 KB Output is correct
139 Correct 732 ms 68284 KB Output is correct
140 Correct 0 ms 212 KB Output is correct
141 Correct 102 ms 11044 KB Output is correct
142 Correct 35 ms 4376 KB Output is correct
143 Correct 92 ms 11548 KB Output is correct
144 Correct 145 ms 18764 KB Output is correct
145 Correct 361 ms 30248 KB Output is correct
146 Correct 478 ms 38036 KB Output is correct
147 Correct 615 ms 45640 KB Output is correct
148 Correct 697 ms 52852 KB Output is correct
149 Correct 845 ms 60624 KB Output is correct
150 Correct 751 ms 71824 KB Output is correct
151 Correct 793 ms 85156 KB Output is correct
152 Correct 9 ms 1392 KB Output is correct
153 Correct 9 ms 1836 KB Output is correct
154 Correct 379 ms 34748 KB Output is correct
155 Correct 576 ms 51968 KB Output is correct
156 Correct 785 ms 69124 KB Output is correct
157 Correct 0 ms 212 KB Output is correct
158 Correct 1 ms 296 KB Output is correct
159 Correct 1 ms 212 KB Output is correct
160 Correct 1 ms 212 KB Output is correct
161 Correct 684 ms 52712 KB Output is correct
162 Correct 629 ms 66084 KB Output is correct
163 Correct 613 ms 61688 KB Output is correct
164 Correct 634 ms 61640 KB Output is correct
165 Incorrect 620 ms 50008 KB Solution announced impossible, but it is possible.
166 Halted 0 ms 0 KB -