답안 #1097206

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1097206 2024-10-06T12:09:48 Z abczz 분수 공원 (IOI21_parks) C++17
70 / 100
1524 ms 142376 KB
#include "parks.h"
#include <iostream>
#include <map>
#include <array>
#include <queue>
#define ll long long
 
using namespace std;
 
map <array<ll, 2>, ll> mp;
map <array<ll, 2>, ll> visited;
map <array<ll, 2>, ll> pt;
map <array<ll, 3>, ll> edge;
queue <array<ll, 2>> Q;
vector <int> U, V, A, B;
ll dj[4][2] = {-1, -1, -1, 1, 1, 1, 1, -1}, dk[4][2] = {-2, 0, 0, 2, 2, 0, 0, -2};
 
void dfs(ll u, ll v) {
    ++visited[{u, v}];
    for (int i=0; i<4; ++i) {
        ll nx = u + dk[i][0], ny = v + dk[i][1];
        if (pt.count({nx, ny}) && !visited.count({nx, ny})) dfs(nx, ny);
    }
}
 
void solve(ll u, ll v) {
    for (int i=0; i<4; ++i) {
        if (edge.count({u, v, i})) {
            if (visited.count({u, v})) break;
            ++visited[{u, v}];
            U.push_back(pt[{u + dj[i][0], v + dj[i][1]}]);
            V.push_back(pt[{u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]}]);
            A.push_back(u);
            B.push_back(v);
            edge.erase({u, v, i});
            edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
            solve(u + dk[i][0], v + dk[i][1]);
            break;
        }
    }
}
 
int construct_roads(std::vector<int> x, std::vector<int> y) {
    ll n = x.size();
    for (int i=0; i<n; ++i) {
        pt[{x[i], y[i]}] = i;
        for (int j=0; j<4; ++j) {
            ll nx = x[i] + dj[j][0], ny = y[i] + dj[j][1];
            ++mp[{nx, ny}];
        }
    }
    dfs(x[0], y[0]);
    if (visited.size() != pt.size()) return 0;
    for (auto it = mp.begin(); it != mp.end();) {
        auto nx = next(it);
        auto [u, v] = it->first;
        ll tot = 0;
        for (int i=0; i<4; ++i) {
            if (pt.count({u + dj[i][0], v + dj[i][1]}) && pt.count({u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]})) {
                ++tot;
                ++edge[{u, v, i}];
            }
        }
        mp[{u, v}] = tot;
        if (tot == 0) mp.erase(it);
        else if (tot == 1) Q.push({u, v});
        it = nx;
    }
    while (!Q.empty()) {
        auto [u, v] = Q.front();
        Q.pop();
        if (!mp.count({u, v})) continue;
        for (int i=0; i<4; ++i) {
            if (edge.count({u, v, i})) {
                U.push_back(pt[{u + dj[i][0], v + dj[i][1]}]);
                V.push_back(pt[{u + dj[(i+1)%4][0], v + dj[(i+1)%4][1]}]);
                edge.erase({u, v, i});
                edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
                --mp[{u + dk[i][0], v + dk[i][1]}];
                if (mp[{u + dk[i][0], v + dk[i][1]}] == 1) Q.push({u + dk[i][0], v + dk[i][1]});
                else if (mp[{u + dk[i][0], v + dk[i][1]}] == 0) mp.erase({u + dk[i][0], v + dk[i][1]});
            }
        }
        mp.erase({u, v});
        A.push_back(u);
        B.push_back(v);
    }
    for (auto [y, z] : mp) {
        auto [u, v] = y;
        if (z == 3) Q.push({u, v});
    }
    while (!Q.empty()) {
        auto [u, v] = Q.front();
        Q.pop();
        for (int i=0; i<4; ++i) {
            if (mp[{u + dk[i][0], v + dk[i][1]}] == 4) {
                edge.erase({u, v, i});
                edge.erase({u + dk[i][0], v + dk[i][1], i ^ 2});
                --mp[{u + dk[i][0], v + dk[i][1]}];
                Q.push({u + dk[i][0], v + dk[i][1]});
            }
        }
    }
    for (auto [y, z] : mp) {
        if (z == 4) return 0;
    }
    visited.clear();
    for (auto [y, z] : mp) {
        auto [u, v] = y;
        solve(u, v);
    }
    build(U, V, A, B);
    return 1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1282 ms 131344 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 4 ms 1112 KB Output is correct
26 Correct 4 ms 1116 KB Output is correct
27 Correct 4 ms 1116 KB Output is correct
28 Correct 445 ms 54208 KB Output is correct
29 Correct 732 ms 81624 KB Output is correct
30 Correct 1016 ms 111536 KB Output is correct
31 Correct 1328 ms 128848 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 0 ms 344 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 436 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 860 KB Output is correct
44 Correct 3 ms 1116 KB Output is correct
45 Correct 504 ms 54736 KB Output is correct
46 Correct 866 ms 81068 KB Output is correct
47 Correct 824 ms 79532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1282 ms 131344 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 4 ms 1112 KB Output is correct
26 Correct 4 ms 1116 KB Output is correct
27 Correct 4 ms 1116 KB Output is correct
28 Correct 445 ms 54208 KB Output is correct
29 Correct 732 ms 81624 KB Output is correct
30 Correct 1016 ms 111536 KB Output is correct
31 Correct 1328 ms 128848 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 0 ms 344 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 436 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 860 KB Output is correct
44 Correct 3 ms 1116 KB Output is correct
45 Correct 504 ms 54736 KB Output is correct
46 Correct 866 ms 81068 KB Output is correct
47 Correct 824 ms 79532 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 432 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 432 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 436 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1499 ms 131552 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 7 ms 1556 KB Output is correct
58 Correct 23 ms 4280 KB Output is correct
59 Correct 10 ms 2396 KB Output is correct
60 Correct 628 ms 68292 KB Output is correct
61 Correct 943 ms 92900 KB Output is correct
62 Correct 1176 ms 109012 KB Output is correct
63 Correct 1484 ms 130784 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 1034 ms 118152 KB Output is correct
68 Correct 980 ms 118648 KB Output is correct
69 Correct 990 ms 120344 KB Output is correct
70 Correct 5 ms 1372 KB Output is correct
71 Correct 9 ms 2216 KB Output is correct
72 Correct 533 ms 50348 KB Output is correct
73 Correct 908 ms 79484 KB Output is correct
74 Correct 1286 ms 104228 KB Output is correct
75 Correct 1170 ms 121524 KB Output is correct
76 Correct 1063 ms 126372 KB Output is correct
77 Correct 6 ms 1624 KB Output is correct
78 Correct 10 ms 2624 KB Output is correct
79 Correct 518 ms 54476 KB Output is correct
80 Correct 851 ms 84092 KB Output is correct
81 Correct 1223 ms 110768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1020 ms 120952 KB Output is correct
21 Correct 1048 ms 114948 KB Output is correct
22 Correct 1061 ms 111884 KB Output is correct
23 Correct 831 ms 99292 KB Output is correct
24 Correct 412 ms 67656 KB Output is correct
25 Correct 390 ms 42684 KB Output is correct
26 Correct 335 ms 42820 KB Output is correct
27 Correct 966 ms 99268 KB Output is correct
28 Correct 1034 ms 99308 KB Output is correct
29 Correct 1162 ms 98292 KB Output is correct
30 Correct 1174 ms 98628 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 57 ms 7804 KB Output is correct
33 Correct 160 ms 28172 KB Output is correct
34 Correct 996 ms 116312 KB Output is correct
35 Correct 13 ms 2648 KB Output is correct
36 Correct 64 ms 10836 KB Output is correct
37 Correct 151 ms 20820 KB Output is correct
38 Correct 377 ms 36420 KB Output is correct
39 Correct 557 ms 49676 KB Output is correct
40 Correct 753 ms 62268 KB Output is correct
41 Correct 1046 ms 76504 KB Output is correct
42 Correct 1225 ms 90768 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 600 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 344 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 1 ms 344 KB Output is correct
54 Correct 3 ms 860 KB Output is correct
55 Correct 3 ms 1116 KB Output is correct
56 Correct 518 ms 54800 KB Output is correct
57 Correct 802 ms 80956 KB Output is correct
58 Correct 814 ms 79696 KB Output is correct
59 Correct 1 ms 344 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1072 ms 118140 KB Output is correct
63 Correct 1079 ms 118540 KB Output is correct
64 Correct 1071 ms 120356 KB Output is correct
65 Correct 5 ms 1368 KB Output is correct
66 Correct 9 ms 2140 KB Output is correct
67 Correct 524 ms 50292 KB Output is correct
68 Correct 824 ms 79364 KB Output is correct
69 Correct 1264 ms 104236 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
17 Correct 1071 ms 127108 KB Output is correct
18 Correct 998 ms 123732 KB Output is correct
19 Correct 1151 ms 118676 KB Output is correct
20 Correct 1278 ms 117660 KB Output is correct
21 Correct 1027 ms 100032 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 131 ms 15972 KB Output is correct
24 Correct 29 ms 5712 KB Output is correct
25 Correct 90 ms 14996 KB Output is correct
26 Correct 167 ms 24148 KB Output is correct
27 Correct 563 ms 56516 KB Output is correct
28 Correct 757 ms 69588 KB Output is correct
29 Correct 1032 ms 84944 KB Output is correct
30 Correct 1254 ms 98500 KB Output is correct
31 Correct 1473 ms 112704 KB Output is correct
32 Correct 1267 ms 121420 KB Output is correct
33 Correct 1133 ms 126216 KB Output is correct
34 Correct 6 ms 1628 KB Output is correct
35 Correct 12 ms 2648 KB Output is correct
36 Correct 527 ms 54612 KB Output is correct
37 Correct 853 ms 84232 KB Output is correct
38 Correct 1237 ms 110764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 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 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 447 ms 61372 KB Output is correct
10 Correct 38 ms 6492 KB Output is correct
11 Correct 256 ms 33764 KB Output is correct
12 Correct 52 ms 9552 KB Output is correct
13 Correct 66 ms 15696 KB Output is correct
14 Correct 1 ms 604 KB Output is correct
15 Correct 3 ms 860 KB Output is correct
16 Correct 456 ms 55468 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1282 ms 131344 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 4 ms 1112 KB Output is correct
26 Correct 4 ms 1116 KB Output is correct
27 Correct 4 ms 1116 KB Output is correct
28 Correct 445 ms 54208 KB Output is correct
29 Correct 732 ms 81624 KB Output is correct
30 Correct 1016 ms 111536 KB Output is correct
31 Correct 1328 ms 128848 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 0 ms 344 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 436 KB Output is correct
36 Correct 1 ms 344 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 1 ms 344 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 2 ms 860 KB Output is correct
44 Correct 3 ms 1116 KB Output is correct
45 Correct 504 ms 54736 KB Output is correct
46 Correct 866 ms 81068 KB Output is correct
47 Correct 824 ms 79532 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 432 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 432 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 436 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1499 ms 131552 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 7 ms 1556 KB Output is correct
58 Correct 23 ms 4280 KB Output is correct
59 Correct 10 ms 2396 KB Output is correct
60 Correct 628 ms 68292 KB Output is correct
61 Correct 943 ms 92900 KB Output is correct
62 Correct 1176 ms 109012 KB Output is correct
63 Correct 1484 ms 130784 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 1034 ms 118152 KB Output is correct
68 Correct 980 ms 118648 KB Output is correct
69 Correct 990 ms 120344 KB Output is correct
70 Correct 5 ms 1372 KB Output is correct
71 Correct 9 ms 2216 KB Output is correct
72 Correct 533 ms 50348 KB Output is correct
73 Correct 908 ms 79484 KB Output is correct
74 Correct 1286 ms 104228 KB Output is correct
75 Correct 1170 ms 121524 KB Output is correct
76 Correct 1063 ms 126372 KB Output is correct
77 Correct 6 ms 1624 KB Output is correct
78 Correct 10 ms 2624 KB Output is correct
79 Correct 518 ms 54476 KB Output is correct
80 Correct 851 ms 84092 KB Output is correct
81 Correct 1223 ms 110768 KB Output is correct
82 Correct 1 ms 344 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 1020 ms 120952 KB Output is correct
86 Correct 1048 ms 114948 KB Output is correct
87 Correct 1061 ms 111884 KB Output is correct
88 Correct 831 ms 99292 KB Output is correct
89 Correct 412 ms 67656 KB Output is correct
90 Correct 390 ms 42684 KB Output is correct
91 Correct 335 ms 42820 KB Output is correct
92 Correct 966 ms 99268 KB Output is correct
93 Correct 1034 ms 99308 KB Output is correct
94 Correct 1162 ms 98292 KB Output is correct
95 Correct 1174 ms 98628 KB Output is correct
96 Correct 0 ms 344 KB Output is correct
97 Correct 57 ms 7804 KB Output is correct
98 Correct 160 ms 28172 KB Output is correct
99 Correct 996 ms 116312 KB Output is correct
100 Correct 13 ms 2648 KB Output is correct
101 Correct 64 ms 10836 KB Output is correct
102 Correct 151 ms 20820 KB Output is correct
103 Correct 377 ms 36420 KB Output is correct
104 Correct 557 ms 49676 KB Output is correct
105 Correct 753 ms 62268 KB Output is correct
106 Correct 1046 ms 76504 KB Output is correct
107 Correct 1225 ms 90768 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 0 ms 348 KB Output is correct
111 Correct 1 ms 600 KB Output is correct
112 Correct 0 ms 348 KB Output is correct
113 Correct 0 ms 348 KB Output is correct
114 Correct 0 ms 344 KB Output is correct
115 Correct 0 ms 348 KB Output is correct
116 Correct 0 ms 348 KB Output is correct
117 Correct 0 ms 348 KB Output is correct
118 Correct 1 ms 344 KB Output is correct
119 Correct 3 ms 860 KB Output is correct
120 Correct 3 ms 1116 KB Output is correct
121 Correct 518 ms 54800 KB Output is correct
122 Correct 802 ms 80956 KB Output is correct
123 Correct 814 ms 79696 KB Output is correct
124 Correct 1 ms 344 KB Output is correct
125 Correct 0 ms 344 KB Output is correct
126 Correct 0 ms 348 KB Output is correct
127 Correct 1072 ms 118140 KB Output is correct
128 Correct 1079 ms 118540 KB Output is correct
129 Correct 1071 ms 120356 KB Output is correct
130 Correct 5 ms 1368 KB Output is correct
131 Correct 9 ms 2140 KB Output is correct
132 Correct 524 ms 50292 KB Output is correct
133 Correct 824 ms 79364 KB Output is correct
134 Correct 1264 ms 104236 KB Output is correct
135 Correct 1071 ms 127108 KB Output is correct
136 Correct 998 ms 123732 KB Output is correct
137 Correct 1151 ms 118676 KB Output is correct
138 Correct 1278 ms 117660 KB Output is correct
139 Correct 1027 ms 100032 KB Output is correct
140 Correct 1 ms 348 KB Output is correct
141 Correct 131 ms 15972 KB Output is correct
142 Correct 29 ms 5712 KB Output is correct
143 Correct 90 ms 14996 KB Output is correct
144 Correct 167 ms 24148 KB Output is correct
145 Correct 563 ms 56516 KB Output is correct
146 Correct 757 ms 69588 KB Output is correct
147 Correct 1032 ms 84944 KB Output is correct
148 Correct 1254 ms 98500 KB Output is correct
149 Correct 1473 ms 112704 KB Output is correct
150 Correct 1267 ms 121420 KB Output is correct
151 Correct 1133 ms 126216 KB Output is correct
152 Correct 6 ms 1628 KB Output is correct
153 Correct 12 ms 2648 KB Output is correct
154 Correct 527 ms 54612 KB Output is correct
155 Correct 853 ms 84232 KB Output is correct
156 Correct 1237 ms 110764 KB Output is correct
157 Correct 0 ms 344 KB Output is correct
158 Correct 0 ms 348 KB Output is correct
159 Correct 1 ms 348 KB Output is correct
160 Correct 0 ms 348 KB Output is correct
161 Correct 1524 ms 142376 KB Output is correct
162 Correct 1006 ms 111988 KB Output is correct
163 Incorrect 816 ms 105296 KB Solution announced impossible, but it is possible.
164 Halted 0 ms 0 KB -