Submission #465881

# Submission time Handle Problem Language Result Execution time Memory
465881 2021-08-17T06:48:32 Z alexxela12345 Fountain Parks (IOI21_parks) C++17
100 / 100
1641 ms 62616 KB
#include "parks.h"
#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> g;
vector<int> used;

void dfs(int v) {
  used[v] = 1;
  deque<int> q;
  q.push_back(v);
  while (!q.empty()) {
    int v = q.front();
    q.pop_front();
    for (int u : g[v]) {
      if (!used[u]) {
        used[u] = 1;
        q.push_back(u);
      }
    }
  }
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
  if (x.size() == 1) {
    build({}, {}, {}, {});
    return 1;
  }
  map<pair<int, int>, int> byc;
  int n = x.size();
  for (int i = 0; i < n; i++) {
    byc[{x[i], y[i]}] = i;
  }
  g.clear();
  g.resize(n);
  map<pair<int, int>, int> cnt;

  auto add = [&](int i, int j) {
    if (i < j) {
      g[i].push_back(j);
      g[j].push_back(i);
      if (x[i] == x[j]) {
        cnt[{x[i] + 1, (y[i] + y[j]) / 2}] += 1;
        cnt[{x[i] - 1, (y[i] + y[j]) / 2}] += 1;
      } else {
        cnt[{(x[i] + x[j]) / 2, y[i] + 1}] += 1;
        cnt[{(x[i] + x[j]) / 2, y[i] - 1}] += 1;
      }
    }
  };
  for (int i = 0; i < n; i++) {
    {
      pair<int, int> pp = {x[i], y[i]};
      pp.first += 2;
      if (byc.count(pp)) {
        add(i, byc[pp]);
      }
    }
    {
      pair<int, int> pp = {x[i], y[i]};
      pp.second += 2;
      if (byc.count(pp)) {
        add(i, byc[pp]);
      }
    }
    {
      pair<int, int> pp = {x[i], y[i]};
      pp.first -= 2;
      if (byc.count(pp)) {
        add(i, byc[pp]);
      }
    }
    {
      pair<int, int> pp = {x[i], y[i]};
      pp.second -= 2;
      if (byc.count(pp)) {
        add(i, byc[pp]);
      }
    }
  }
  used.assign(n, 0);
  dfs(0);
  if (*min_element(used.begin(), used.end()) == 0) {
    return 0;
  }
  vector<int> u, v, a, b;

  for (auto [xy, _] : cnt) {
    pair<int, int> RU, RD, LD, LU;
    RU = RD = LD = LU = xy;
    RU.first++, RU.second++;
    RD.first++, RD.second--;
    LU.first--, LU.second++;
    LD.first--, LD.second--;
    if ((xy.first + xy.second) % 4) {
      // left right
      if (byc.count(RU) && byc.count(RD)) {
        u.push_back(byc[RU]);
        v.push_back(byc[RD]);
        a.push_back(xy.first);
        b.push_back(xy.second);
      } else if (byc.count(LU) && byc.count(LD)) {
        u.push_back(byc[LU]);
        v.push_back(byc[LD]);
        a.push_back(xy.first);
        b.push_back(xy.second);
      }
    } else {
      if (byc.count(RU) && byc.count(LU)) {
        u.push_back(byc[RU]);
        v.push_back(byc[LU]);
        a.push_back(xy.first);
        b.push_back(xy.second);
      } else if (byc.count(RD) && byc.count(LD)) {
        u.push_back(byc[RD]);
        v.push_back(byc[LD]);
        a.push_back(xy.first);
        b.push_back(xy.second);
      }
    }
  }

  g.clear();
  g.resize(n);

  for (int i = 0; i < (int)u.size(); i++) {
    g[u[i]].push_back(v[i]);
    g[v[i]].push_back(u[i]);
  }
  used.assign(n, 0);
  dfs(0);
  assert(*min_element(used.begin(), used.end()) == 1);

  build(u, v, a, b);
  return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 0 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1486 ms 55984 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 5 ms 588 KB Output is correct
26 Correct 6 ms 972 KB Output is correct
27 Correct 9 ms 1204 KB Output is correct
28 Correct 524 ms 22600 KB Output is correct
29 Correct 848 ms 33888 KB Output is correct
30 Correct 1181 ms 44892 KB Output is correct
31 Correct 1563 ms 55924 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 4 ms 716 KB Output is correct
44 Correct 11 ms 960 KB Output is correct
45 Correct 603 ms 27464 KB Output is correct
46 Correct 989 ms 39584 KB Output is correct
47 Correct 912 ms 39644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 0 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1486 ms 55984 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 5 ms 588 KB Output is correct
26 Correct 6 ms 972 KB Output is correct
27 Correct 9 ms 1204 KB Output is correct
28 Correct 524 ms 22600 KB Output is correct
29 Correct 848 ms 33888 KB Output is correct
30 Correct 1181 ms 44892 KB Output is correct
31 Correct 1563 ms 55924 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 4 ms 716 KB Output is correct
44 Correct 11 ms 960 KB Output is correct
45 Correct 603 ms 27464 KB Output is correct
46 Correct 989 ms 39584 KB Output is correct
47 Correct 912 ms 39644 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 1540 ms 53872 KB Output is correct
56 Correct 0 ms 204 KB Output is correct
57 Correct 5 ms 716 KB Output is correct
58 Correct 19 ms 1924 KB Output is correct
59 Correct 26 ms 2392 KB Output is correct
60 Correct 632 ms 27296 KB Output is correct
61 Correct 1002 ms 36536 KB Output is correct
62 Correct 1271 ms 44616 KB Output is correct
63 Correct 1590 ms 53924 KB Output is correct
64 Correct 0 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 1270 ms 62200 KB Output is correct
68 Correct 1285 ms 62616 KB Output is correct
69 Correct 1274 ms 61884 KB Output is correct
70 Correct 8 ms 1100 KB Output is correct
71 Correct 16 ms 1972 KB Output is correct
72 Correct 594 ms 27052 KB Output is correct
73 Correct 947 ms 40476 KB Output is correct
74 Correct 1400 ms 53916 KB Output is correct
75 Correct 1478 ms 59084 KB Output is correct
76 Correct 1254 ms 62232 KB Output is correct
77 Correct 10 ms 1356 KB Output is correct
78 Correct 20 ms 2340 KB Output is correct
79 Correct 580 ms 28332 KB Output is correct
80 Correct 1010 ms 42336 KB Output is correct
81 Correct 1437 ms 56092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1141 ms 49740 KB Output is correct
21 Correct 1202 ms 49752 KB Output is correct
22 Correct 1218 ms 49692 KB Output is correct
23 Correct 1032 ms 53172 KB Output is correct
24 Correct 422 ms 21408 KB Output is correct
25 Correct 1079 ms 52752 KB Output is correct
26 Correct 954 ms 52672 KB Output is correct
27 Correct 1299 ms 62360 KB Output is correct
28 Correct 1350 ms 62260 KB Output is correct
29 Correct 1542 ms 62364 KB Output is correct
30 Correct 1462 ms 62240 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Correct 53 ms 4360 KB Output is correct
33 Correct 152 ms 10932 KB Output is correct
34 Correct 1065 ms 49764 KB Output is correct
35 Correct 22 ms 2380 KB Output is correct
36 Correct 169 ms 10844 KB Output is correct
37 Correct 435 ms 21548 KB Output is correct
38 Correct 455 ms 21204 KB Output is correct
39 Correct 622 ms 28804 KB Output is correct
40 Correct 881 ms 36512 KB Output is correct
41 Correct 1125 ms 44448 KB Output is correct
42 Correct 1429 ms 52116 KB Output is correct
43 Correct 0 ms 204 KB Output is correct
44 Correct 0 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 204 KB Output is correct
47 Correct 0 ms 204 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 0 ms 204 KB Output is correct
54 Correct 4 ms 676 KB Output is correct
55 Correct 5 ms 844 KB Output is correct
56 Correct 549 ms 27564 KB Output is correct
57 Correct 881 ms 39652 KB Output is correct
58 Correct 958 ms 39728 KB Output is correct
59 Correct 0 ms 204 KB Output is correct
60 Correct 0 ms 204 KB Output is correct
61 Correct 0 ms 204 KB Output is correct
62 Correct 1304 ms 62244 KB Output is correct
63 Correct 1302 ms 62444 KB Output is correct
64 Correct 1300 ms 62172 KB Output is correct
65 Correct 8 ms 1100 KB Output is correct
66 Correct 17 ms 2052 KB Output is correct
67 Correct 552 ms 27192 KB Output is correct
68 Correct 960 ms 40468 KB Output is correct
69 Correct 1368 ms 54232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
17 Correct 1377 ms 62340 KB Output is correct
18 Correct 1292 ms 62320 KB Output is correct
19 Correct 1223 ms 49760 KB Output is correct
20 Correct 1514 ms 56016 KB Output is correct
21 Correct 1422 ms 53252 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 142 ms 8764 KB Output is correct
24 Correct 57 ms 4552 KB Output is correct
25 Correct 303 ms 15564 KB Output is correct
26 Correct 577 ms 26436 KB Output is correct
27 Correct 628 ms 27884 KB Output is correct
28 Correct 827 ms 34904 KB Output is correct
29 Correct 1055 ms 41788 KB Output is correct
30 Correct 1348 ms 48648 KB Output is correct
31 Correct 1580 ms 55492 KB Output is correct
32 Correct 1556 ms 59116 KB Output is correct
33 Correct 1357 ms 62212 KB Output is correct
34 Correct 10 ms 1388 KB Output is correct
35 Correct 19 ms 2288 KB Output is correct
36 Correct 586 ms 28332 KB Output is correct
37 Correct 990 ms 42212 KB Output is correct
38 Correct 1473 ms 56200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 544 ms 31332 KB Output is correct
10 Correct 27 ms 3564 KB Output is correct
11 Correct 193 ms 17032 KB Output is correct
12 Correct 44 ms 5188 KB Output is correct
13 Correct 81 ms 11768 KB Output is correct
14 Correct 2 ms 460 KB Output is correct
15 Correct 3 ms 716 KB Output is correct
16 Correct 586 ms 31260 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 0 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1486 ms 55984 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 5 ms 588 KB Output is correct
26 Correct 6 ms 972 KB Output is correct
27 Correct 9 ms 1204 KB Output is correct
28 Correct 524 ms 22600 KB Output is correct
29 Correct 848 ms 33888 KB Output is correct
30 Correct 1181 ms 44892 KB Output is correct
31 Correct 1563 ms 55924 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 0 ms 204 KB Output is correct
38 Correct 0 ms 204 KB Output is correct
39 Correct 0 ms 204 KB Output is correct
40 Correct 0 ms 204 KB Output is correct
41 Correct 0 ms 204 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 4 ms 716 KB Output is correct
44 Correct 11 ms 960 KB Output is correct
45 Correct 603 ms 27464 KB Output is correct
46 Correct 989 ms 39584 KB Output is correct
47 Correct 912 ms 39644 KB Output is correct
48 Correct 0 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 0 ms 204 KB Output is correct
51 Correct 0 ms 204 KB Output is correct
52 Correct 0 ms 204 KB Output is correct
53 Correct 1 ms 204 KB Output is correct
54 Correct 1 ms 204 KB Output is correct
55 Correct 1540 ms 53872 KB Output is correct
56 Correct 0 ms 204 KB Output is correct
57 Correct 5 ms 716 KB Output is correct
58 Correct 19 ms 1924 KB Output is correct
59 Correct 26 ms 2392 KB Output is correct
60 Correct 632 ms 27296 KB Output is correct
61 Correct 1002 ms 36536 KB Output is correct
62 Correct 1271 ms 44616 KB Output is correct
63 Correct 1590 ms 53924 KB Output is correct
64 Correct 0 ms 204 KB Output is correct
65 Correct 0 ms 204 KB Output is correct
66 Correct 0 ms 204 KB Output is correct
67 Correct 1270 ms 62200 KB Output is correct
68 Correct 1285 ms 62616 KB Output is correct
69 Correct 1274 ms 61884 KB Output is correct
70 Correct 8 ms 1100 KB Output is correct
71 Correct 16 ms 1972 KB Output is correct
72 Correct 594 ms 27052 KB Output is correct
73 Correct 947 ms 40476 KB Output is correct
74 Correct 1400 ms 53916 KB Output is correct
75 Correct 1478 ms 59084 KB Output is correct
76 Correct 1254 ms 62232 KB Output is correct
77 Correct 10 ms 1356 KB Output is correct
78 Correct 20 ms 2340 KB Output is correct
79 Correct 580 ms 28332 KB Output is correct
80 Correct 1010 ms 42336 KB Output is correct
81 Correct 1437 ms 56092 KB Output is correct
82 Correct 0 ms 204 KB Output is correct
83 Correct 0 ms 204 KB Output is correct
84 Correct 0 ms 204 KB Output is correct
85 Correct 1141 ms 49740 KB Output is correct
86 Correct 1202 ms 49752 KB Output is correct
87 Correct 1218 ms 49692 KB Output is correct
88 Correct 1032 ms 53172 KB Output is correct
89 Correct 422 ms 21408 KB Output is correct
90 Correct 1079 ms 52752 KB Output is correct
91 Correct 954 ms 52672 KB Output is correct
92 Correct 1299 ms 62360 KB Output is correct
93 Correct 1350 ms 62260 KB Output is correct
94 Correct 1542 ms 62364 KB Output is correct
95 Correct 1462 ms 62240 KB Output is correct
96 Correct 0 ms 204 KB Output is correct
97 Correct 53 ms 4360 KB Output is correct
98 Correct 152 ms 10932 KB Output is correct
99 Correct 1065 ms 49764 KB Output is correct
100 Correct 22 ms 2380 KB Output is correct
101 Correct 169 ms 10844 KB Output is correct
102 Correct 435 ms 21548 KB Output is correct
103 Correct 455 ms 21204 KB Output is correct
104 Correct 622 ms 28804 KB Output is correct
105 Correct 881 ms 36512 KB Output is correct
106 Correct 1125 ms 44448 KB Output is correct
107 Correct 1429 ms 52116 KB Output is correct
108 Correct 0 ms 204 KB Output is correct
109 Correct 0 ms 204 KB Output is correct
110 Correct 1 ms 204 KB Output is correct
111 Correct 1 ms 204 KB Output is correct
112 Correct 0 ms 204 KB Output is correct
113 Correct 0 ms 204 KB Output is correct
114 Correct 0 ms 204 KB Output is correct
115 Correct 0 ms 204 KB Output is correct
116 Correct 0 ms 204 KB Output is correct
117 Correct 0 ms 204 KB Output is correct
118 Correct 0 ms 204 KB Output is correct
119 Correct 4 ms 676 KB Output is correct
120 Correct 5 ms 844 KB Output is correct
121 Correct 549 ms 27564 KB Output is correct
122 Correct 881 ms 39652 KB Output is correct
123 Correct 958 ms 39728 KB Output is correct
124 Correct 0 ms 204 KB Output is correct
125 Correct 0 ms 204 KB Output is correct
126 Correct 0 ms 204 KB Output is correct
127 Correct 1304 ms 62244 KB Output is correct
128 Correct 1302 ms 62444 KB Output is correct
129 Correct 1300 ms 62172 KB Output is correct
130 Correct 8 ms 1100 KB Output is correct
131 Correct 17 ms 2052 KB Output is correct
132 Correct 552 ms 27192 KB Output is correct
133 Correct 960 ms 40468 KB Output is correct
134 Correct 1368 ms 54232 KB Output is correct
135 Correct 1377 ms 62340 KB Output is correct
136 Correct 1292 ms 62320 KB Output is correct
137 Correct 1223 ms 49760 KB Output is correct
138 Correct 1514 ms 56016 KB Output is correct
139 Correct 1422 ms 53252 KB Output is correct
140 Correct 1 ms 204 KB Output is correct
141 Correct 142 ms 8764 KB Output is correct
142 Correct 57 ms 4552 KB Output is correct
143 Correct 303 ms 15564 KB Output is correct
144 Correct 577 ms 26436 KB Output is correct
145 Correct 628 ms 27884 KB Output is correct
146 Correct 827 ms 34904 KB Output is correct
147 Correct 1055 ms 41788 KB Output is correct
148 Correct 1348 ms 48648 KB Output is correct
149 Correct 1580 ms 55492 KB Output is correct
150 Correct 1556 ms 59116 KB Output is correct
151 Correct 1357 ms 62212 KB Output is correct
152 Correct 10 ms 1388 KB Output is correct
153 Correct 19 ms 2288 KB Output is correct
154 Correct 586 ms 28332 KB Output is correct
155 Correct 990 ms 42212 KB Output is correct
156 Correct 1473 ms 56200 KB Output is correct
157 Correct 0 ms 204 KB Output is correct
158 Correct 0 ms 204 KB Output is correct
159 Correct 0 ms 204 KB Output is correct
160 Correct 1 ms 204 KB Output is correct
161 Correct 1641 ms 49756 KB Output is correct
162 Correct 1169 ms 49816 KB Output is correct
163 Correct 1238 ms 49880 KB Output is correct
164 Correct 1226 ms 49944 KB Output is correct
165 Correct 1453 ms 49816 KB Output is correct
166 Correct 1563 ms 49852 KB Output is correct
167 Correct 224 ms 12128 KB Output is correct
168 Correct 100 ms 6272 KB Output is correct
169 Correct 379 ms 16312 KB Output is correct
170 Correct 896 ms 30384 KB Output is correct
171 Correct 1314 ms 40620 KB Output is correct
172 Correct 706 ms 25132 KB Output is correct
173 Correct 924 ms 30136 KB Output is correct
174 Correct 1032 ms 35104 KB Output is correct
175 Correct 1208 ms 40048 KB Output is correct
176 Correct 1481 ms 45096 KB Output is correct
177 Correct 1585 ms 50072 KB Output is correct