Submission #398475

# Submission time Handle Problem Language Result Execution time Memory
398475 2021-05-04T11:05:57 Z model_code From Hacks to Snitches (BOI21_watchmen) C++17
100 / 100
3385 ms 100360 KB
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 250000, MAXK = 1000, inf = 1 << 29;
int N, M, K, L[MAXK], r[MAXN], t[MAXN], c[MAXN];
vector<int> e[MAXN], V[MAXK], dp[MAXN];

int main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 0; i < N; i++)
    r[i] = 0, t[i] = -1;
  int u, v;
  for (int i = 0; i < M; i++) {
    cin >> u >> v, u--, v--;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  cin >> K;
  L[0] = 1;
  for (int i = 1; i <= K; i++) {
    cin >> L[i];
    for (int j = 0; j < L[i]; j++) {
      cin >> u, u--;
      V[i].push_back(u);
      r[u] = i;
      t[u] = j;
    }
  }
  for (int i = 0; i < N; i++) {
    dp[i].resize(L[r[i]]);
    for (int j = 0; j < L[r[i]]; j++)
      dp[i][j] = inf;
  }
  priority_queue<tuple<int, int, int>> pq;
  auto update = [&](int i, int d) {
    int o = d % L[r[i]];
    if (o != t[i] && d < dp[i][o])
      dp[i][o] = d, pq.emplace(-d, i, o);
  };
  update(0, 0);
  while (!pq.empty()) {
    auto [d, i, o] = pq.top();
    pq.pop();
    d *= -1;
    if (d != dp[i][o])
      continue;
    for (int k = 0; k < (int) e[i].size(); k++) {
      int j = e[i][k];
      if (!r[i] || r[j] != r[i] || (t[j] + 1) % L[r[i]] != t[i] || t[j] != o)
        update(j, d + 1);
      if (!r[i] && r[j])
        update(j, d + 1 + (t[j] + L[r[j]] - d % L[r[j]]) % L[r[j]]);
      bool re = false;
      if (r[i] && r[j] && (r[j] != r[i] || ((t[j] + 1) % L[r[i]] != t[i] && (t[i] + 1) % L[r[i]] != t[j]))) {
        int tnj = d + (t[j] + L[r[j]] - d % L[r[j]]) % L[r[j]];
        int tnji = tnj + (t[i] + L[r[i]] - tnj % L[r[i]]) % L[r[i]];
        if (tnj != tnji) {
          update(j, tnj + 1);
          re = true;
        } else {
          int nd = tnj + (o + L[r[i]] - t[i]) % L[r[i]];
          update(j, nd + 1);
          if (L[r[j]] % L[r[i]] != 0 && (L[r[i]] % L[r[j]] != 0 || (t[i] + L[r[i]] - o) % L[r[i]] >= L[r[j]]))
            update(j, nd + 1 + (t[j] + L[r[j]] - nd % L[r[j]]) % L[r[j]]);
        }
      }
      if (!r[i] || !r[j] || re) {
        swap(e[i][k], e[i].back());
        e[i].pop_back();
        k--;
      }
    }
    update(i, d + 1);
  }
  if (dp[N - 1][0] == inf)
    cout << "impossible\n";
  else
    cout << dp[N - 1][0] << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 28 ms 13004 KB Output is correct
2 Correct 98 ms 19256 KB Output is correct
3 Correct 91 ms 18572 KB Output is correct
4 Correct 95 ms 18756 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 89 ms 18564 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 13052 KB Output is correct
2 Correct 97 ms 19140 KB Output is correct
3 Correct 90 ms 18628 KB Output is correct
4 Correct 92 ms 18672 KB Output is correct
5 Correct 11 ms 12108 KB Output is correct
6 Correct 90 ms 18584 KB Output is correct
7 Correct 89 ms 18616 KB Output is correct
8 Correct 85 ms 18576 KB Output is correct
9 Correct 81 ms 18504 KB Output is correct
10 Correct 91 ms 18708 KB Output is correct
11 Correct 92 ms 18708 KB Output is correct
12 Correct 88 ms 18524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 13052 KB Output is correct
2 Correct 97 ms 19140 KB Output is correct
3 Correct 90 ms 18628 KB Output is correct
4 Correct 92 ms 18672 KB Output is correct
5 Correct 11 ms 12108 KB Output is correct
6 Correct 90 ms 18584 KB Output is correct
7 Correct 89 ms 18616 KB Output is correct
8 Correct 85 ms 18576 KB Output is correct
9 Correct 81 ms 18504 KB Output is correct
10 Correct 91 ms 18708 KB Output is correct
11 Correct 92 ms 18708 KB Output is correct
12 Correct 88 ms 18524 KB Output is correct
13 Correct 28 ms 13024 KB Output is correct
14 Correct 103 ms 19284 KB Output is correct
15 Correct 90 ms 18628 KB Output is correct
16 Correct 96 ms 18804 KB Output is correct
17 Correct 10 ms 12108 KB Output is correct
18 Correct 90 ms 18644 KB Output is correct
19 Correct 88 ms 18620 KB Output is correct
20 Correct 83 ms 18512 KB Output is correct
21 Correct 82 ms 18484 KB Output is correct
22 Correct 87 ms 18756 KB Output is correct
23 Correct 88 ms 18632 KB Output is correct
24 Correct 87 ms 18632 KB Output is correct
25 Correct 2044 ms 62172 KB Output is correct
26 Correct 1951 ms 66204 KB Output is correct
27 Correct 1803 ms 61912 KB Output is correct
28 Correct 1461 ms 65976 KB Output is correct
29 Correct 1836 ms 57584 KB Output is correct
30 Correct 1804 ms 59836 KB Output is correct
31 Correct 2148 ms 66144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 13052 KB Output is correct
2 Correct 97 ms 19140 KB Output is correct
3 Correct 90 ms 18628 KB Output is correct
4 Correct 92 ms 18672 KB Output is correct
5 Correct 11 ms 12108 KB Output is correct
6 Correct 90 ms 18584 KB Output is correct
7 Correct 89 ms 18616 KB Output is correct
8 Correct 85 ms 18576 KB Output is correct
9 Correct 81 ms 18504 KB Output is correct
10 Correct 91 ms 18708 KB Output is correct
11 Correct 92 ms 18708 KB Output is correct
12 Correct 88 ms 18524 KB Output is correct
13 Correct 28 ms 13024 KB Output is correct
14 Correct 103 ms 19284 KB Output is correct
15 Correct 90 ms 18628 KB Output is correct
16 Correct 96 ms 18804 KB Output is correct
17 Correct 10 ms 12108 KB Output is correct
18 Correct 90 ms 18644 KB Output is correct
19 Correct 88 ms 18620 KB Output is correct
20 Correct 83 ms 18512 KB Output is correct
21 Correct 82 ms 18484 KB Output is correct
22 Correct 87 ms 18756 KB Output is correct
23 Correct 88 ms 18632 KB Output is correct
24 Correct 87 ms 18632 KB Output is correct
25 Correct 2044 ms 62172 KB Output is correct
26 Correct 1951 ms 66204 KB Output is correct
27 Correct 1803 ms 61912 KB Output is correct
28 Correct 1461 ms 65976 KB Output is correct
29 Correct 1836 ms 57584 KB Output is correct
30 Correct 1804 ms 59836 KB Output is correct
31 Correct 2148 ms 66144 KB Output is correct
32 Correct 28 ms 12936 KB Output is correct
33 Correct 95 ms 19128 KB Output is correct
34 Correct 96 ms 18636 KB Output is correct
35 Correct 98 ms 18688 KB Output is correct
36 Correct 11 ms 12172 KB Output is correct
37 Correct 90 ms 18592 KB Output is correct
38 Correct 93 ms 18572 KB Output is correct
39 Correct 84 ms 18628 KB Output is correct
40 Correct 85 ms 18496 KB Output is correct
41 Correct 88 ms 18756 KB Output is correct
42 Correct 90 ms 18668 KB Output is correct
43 Correct 90 ms 18636 KB Output is correct
44 Correct 1997 ms 62004 KB Output is correct
45 Correct 1934 ms 66216 KB Output is correct
46 Correct 1776 ms 61808 KB Output is correct
47 Correct 1449 ms 66088 KB Output is correct
48 Correct 1834 ms 57576 KB Output is correct
49 Correct 1802 ms 59760 KB Output is correct
50 Correct 2111 ms 66012 KB Output is correct
51 Correct 2768 ms 70528 KB Output is correct
52 Correct 3157 ms 81132 KB Output is correct
53 Correct 2590 ms 71028 KB Output is correct
54 Correct 1410 ms 57140 KB Output is correct
55 Correct 2708 ms 71144 KB Output is correct
56 Correct 2504 ms 63820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 13004 KB Output is correct
2 Correct 98 ms 19256 KB Output is correct
3 Correct 91 ms 18572 KB Output is correct
4 Correct 95 ms 18756 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 89 ms 18564 KB Output is correct
7 Correct 31 ms 13052 KB Output is correct
8 Correct 97 ms 19140 KB Output is correct
9 Correct 90 ms 18628 KB Output is correct
10 Correct 92 ms 18672 KB Output is correct
11 Correct 11 ms 12108 KB Output is correct
12 Correct 90 ms 18584 KB Output is correct
13 Correct 89 ms 18616 KB Output is correct
14 Correct 85 ms 18576 KB Output is correct
15 Correct 81 ms 18504 KB Output is correct
16 Correct 91 ms 18708 KB Output is correct
17 Correct 92 ms 18708 KB Output is correct
18 Correct 88 ms 18524 KB Output is correct
19 Correct 8 ms 12092 KB Output is correct
20 Correct 8 ms 11980 KB Output is correct
21 Correct 8 ms 11980 KB Output is correct
22 Correct 28 ms 13028 KB Output is correct
23 Correct 91 ms 19176 KB Output is correct
24 Correct 90 ms 18592 KB Output is correct
25 Correct 92 ms 18692 KB Output is correct
26 Correct 11 ms 12108 KB Output is correct
27 Correct 99 ms 18592 KB Output is correct
28 Correct 87 ms 18628 KB Output is correct
29 Correct 85 ms 18564 KB Output is correct
30 Correct 83 ms 18552 KB Output is correct
31 Correct 88 ms 18760 KB Output is correct
32 Correct 97 ms 18660 KB Output is correct
33 Correct 88 ms 18520 KB Output is correct
34 Correct 2092 ms 63108 KB Output is correct
35 Correct 2156 ms 59144 KB Output is correct
36 Correct 2177 ms 59300 KB Output is correct
37 Correct 1891 ms 64556 KB Output is correct
38 Correct 2032 ms 61872 KB Output is correct
39 Correct 1787 ms 57944 KB Output is correct
40 Correct 1806 ms 58460 KB Output is correct
41 Correct 1777 ms 58200 KB Output is correct
42 Correct 2016 ms 62076 KB Output is correct
43 Correct 2119 ms 65864 KB Output is correct
44 Correct 2080 ms 65788 KB Output is correct
45 Correct 2410 ms 61500 KB Output is correct
46 Correct 2238 ms 61884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 13004 KB Output is correct
2 Correct 98 ms 19256 KB Output is correct
3 Correct 91 ms 18572 KB Output is correct
4 Correct 95 ms 18756 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 89 ms 18564 KB Output is correct
7 Correct 31 ms 13052 KB Output is correct
8 Correct 97 ms 19140 KB Output is correct
9 Correct 90 ms 18628 KB Output is correct
10 Correct 92 ms 18672 KB Output is correct
11 Correct 11 ms 12108 KB Output is correct
12 Correct 90 ms 18584 KB Output is correct
13 Correct 89 ms 18616 KB Output is correct
14 Correct 85 ms 18576 KB Output is correct
15 Correct 81 ms 18504 KB Output is correct
16 Correct 91 ms 18708 KB Output is correct
17 Correct 92 ms 18708 KB Output is correct
18 Correct 88 ms 18524 KB Output is correct
19 Correct 28 ms 13024 KB Output is correct
20 Correct 103 ms 19284 KB Output is correct
21 Correct 90 ms 18628 KB Output is correct
22 Correct 96 ms 18804 KB Output is correct
23 Correct 10 ms 12108 KB Output is correct
24 Correct 90 ms 18644 KB Output is correct
25 Correct 88 ms 18620 KB Output is correct
26 Correct 83 ms 18512 KB Output is correct
27 Correct 82 ms 18484 KB Output is correct
28 Correct 87 ms 18756 KB Output is correct
29 Correct 88 ms 18632 KB Output is correct
30 Correct 87 ms 18632 KB Output is correct
31 Correct 2044 ms 62172 KB Output is correct
32 Correct 1951 ms 66204 KB Output is correct
33 Correct 1803 ms 61912 KB Output is correct
34 Correct 1461 ms 65976 KB Output is correct
35 Correct 1836 ms 57584 KB Output is correct
36 Correct 1804 ms 59836 KB Output is correct
37 Correct 2148 ms 66144 KB Output is correct
38 Correct 8 ms 12092 KB Output is correct
39 Correct 8 ms 11980 KB Output is correct
40 Correct 8 ms 11980 KB Output is correct
41 Correct 28 ms 13028 KB Output is correct
42 Correct 91 ms 19176 KB Output is correct
43 Correct 90 ms 18592 KB Output is correct
44 Correct 92 ms 18692 KB Output is correct
45 Correct 11 ms 12108 KB Output is correct
46 Correct 99 ms 18592 KB Output is correct
47 Correct 87 ms 18628 KB Output is correct
48 Correct 85 ms 18564 KB Output is correct
49 Correct 83 ms 18552 KB Output is correct
50 Correct 88 ms 18760 KB Output is correct
51 Correct 97 ms 18660 KB Output is correct
52 Correct 88 ms 18520 KB Output is correct
53 Correct 2092 ms 63108 KB Output is correct
54 Correct 2156 ms 59144 KB Output is correct
55 Correct 2177 ms 59300 KB Output is correct
56 Correct 1891 ms 64556 KB Output is correct
57 Correct 2032 ms 61872 KB Output is correct
58 Correct 1787 ms 57944 KB Output is correct
59 Correct 1806 ms 58460 KB Output is correct
60 Correct 1777 ms 58200 KB Output is correct
61 Correct 2016 ms 62076 KB Output is correct
62 Correct 2119 ms 65864 KB Output is correct
63 Correct 2080 ms 65788 KB Output is correct
64 Correct 2410 ms 61500 KB Output is correct
65 Correct 2238 ms 61884 KB Output is correct
66 Correct 8 ms 11980 KB Output is correct
67 Correct 9 ms 11980 KB Output is correct
68 Correct 8 ms 11980 KB Output is correct
69 Correct 30 ms 13004 KB Output is correct
70 Correct 91 ms 19144 KB Output is correct
71 Correct 91 ms 18628 KB Output is correct
72 Correct 95 ms 18900 KB Output is correct
73 Correct 11 ms 12112 KB Output is correct
74 Correct 89 ms 18624 KB Output is correct
75 Correct 89 ms 18640 KB Output is correct
76 Correct 89 ms 18740 KB Output is correct
77 Correct 85 ms 18504 KB Output is correct
78 Correct 120 ms 18712 KB Output is correct
79 Correct 87 ms 18604 KB Output is correct
80 Correct 95 ms 18564 KB Output is correct
81 Correct 2043 ms 62116 KB Output is correct
82 Correct 1943 ms 66224 KB Output is correct
83 Correct 1836 ms 61896 KB Output is correct
84 Correct 1613 ms 65988 KB Output is correct
85 Correct 1986 ms 57608 KB Output is correct
86 Correct 1794 ms 59792 KB Output is correct
87 Correct 2121 ms 66184 KB Output is correct
88 Correct 2111 ms 62944 KB Output is correct
89 Correct 2178 ms 59248 KB Output is correct
90 Correct 2160 ms 59148 KB Output is correct
91 Correct 1894 ms 64532 KB Output is correct
92 Correct 2029 ms 61944 KB Output is correct
93 Correct 1798 ms 57976 KB Output is correct
94 Correct 1823 ms 58448 KB Output is correct
95 Correct 1818 ms 58116 KB Output is correct
96 Correct 2055 ms 62016 KB Output is correct
97 Correct 2161 ms 65708 KB Output is correct
98 Correct 2194 ms 65852 KB Output is correct
99 Correct 2234 ms 61588 KB Output is correct
100 Correct 2063 ms 61848 KB Output is correct
101 Correct 2098 ms 62984 KB Output is correct
102 Correct 1944 ms 64584 KB Output is correct
103 Correct 2152 ms 62020 KB Output is correct
104 Correct 1893 ms 60832 KB Output is correct
105 Correct 2112 ms 62016 KB Output is correct
106 Correct 2217 ms 61728 KB Output is correct
107 Correct 2037 ms 62016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 13004 KB Output is correct
2 Correct 98 ms 19256 KB Output is correct
3 Correct 91 ms 18572 KB Output is correct
4 Correct 95 ms 18756 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 89 ms 18564 KB Output is correct
7 Correct 31 ms 13052 KB Output is correct
8 Correct 97 ms 19140 KB Output is correct
9 Correct 90 ms 18628 KB Output is correct
10 Correct 92 ms 18672 KB Output is correct
11 Correct 11 ms 12108 KB Output is correct
12 Correct 90 ms 18584 KB Output is correct
13 Correct 89 ms 18616 KB Output is correct
14 Correct 85 ms 18576 KB Output is correct
15 Correct 81 ms 18504 KB Output is correct
16 Correct 91 ms 18708 KB Output is correct
17 Correct 92 ms 18708 KB Output is correct
18 Correct 88 ms 18524 KB Output is correct
19 Correct 28 ms 13024 KB Output is correct
20 Correct 103 ms 19284 KB Output is correct
21 Correct 90 ms 18628 KB Output is correct
22 Correct 96 ms 18804 KB Output is correct
23 Correct 10 ms 12108 KB Output is correct
24 Correct 90 ms 18644 KB Output is correct
25 Correct 88 ms 18620 KB Output is correct
26 Correct 83 ms 18512 KB Output is correct
27 Correct 82 ms 18484 KB Output is correct
28 Correct 87 ms 18756 KB Output is correct
29 Correct 88 ms 18632 KB Output is correct
30 Correct 87 ms 18632 KB Output is correct
31 Correct 2044 ms 62172 KB Output is correct
32 Correct 1951 ms 66204 KB Output is correct
33 Correct 1803 ms 61912 KB Output is correct
34 Correct 1461 ms 65976 KB Output is correct
35 Correct 1836 ms 57584 KB Output is correct
36 Correct 1804 ms 59836 KB Output is correct
37 Correct 2148 ms 66144 KB Output is correct
38 Correct 28 ms 12936 KB Output is correct
39 Correct 95 ms 19128 KB Output is correct
40 Correct 96 ms 18636 KB Output is correct
41 Correct 98 ms 18688 KB Output is correct
42 Correct 11 ms 12172 KB Output is correct
43 Correct 90 ms 18592 KB Output is correct
44 Correct 93 ms 18572 KB Output is correct
45 Correct 84 ms 18628 KB Output is correct
46 Correct 85 ms 18496 KB Output is correct
47 Correct 88 ms 18756 KB Output is correct
48 Correct 90 ms 18668 KB Output is correct
49 Correct 90 ms 18636 KB Output is correct
50 Correct 1997 ms 62004 KB Output is correct
51 Correct 1934 ms 66216 KB Output is correct
52 Correct 1776 ms 61808 KB Output is correct
53 Correct 1449 ms 66088 KB Output is correct
54 Correct 1834 ms 57576 KB Output is correct
55 Correct 1802 ms 59760 KB Output is correct
56 Correct 2111 ms 66012 KB Output is correct
57 Correct 2768 ms 70528 KB Output is correct
58 Correct 3157 ms 81132 KB Output is correct
59 Correct 2590 ms 71028 KB Output is correct
60 Correct 1410 ms 57140 KB Output is correct
61 Correct 2708 ms 71144 KB Output is correct
62 Correct 2504 ms 63820 KB Output is correct
63 Correct 8 ms 12092 KB Output is correct
64 Correct 8 ms 11980 KB Output is correct
65 Correct 8 ms 11980 KB Output is correct
66 Correct 28 ms 13028 KB Output is correct
67 Correct 91 ms 19176 KB Output is correct
68 Correct 90 ms 18592 KB Output is correct
69 Correct 92 ms 18692 KB Output is correct
70 Correct 11 ms 12108 KB Output is correct
71 Correct 99 ms 18592 KB Output is correct
72 Correct 87 ms 18628 KB Output is correct
73 Correct 85 ms 18564 KB Output is correct
74 Correct 83 ms 18552 KB Output is correct
75 Correct 88 ms 18760 KB Output is correct
76 Correct 97 ms 18660 KB Output is correct
77 Correct 88 ms 18520 KB Output is correct
78 Correct 2092 ms 63108 KB Output is correct
79 Correct 2156 ms 59144 KB Output is correct
80 Correct 2177 ms 59300 KB Output is correct
81 Correct 1891 ms 64556 KB Output is correct
82 Correct 2032 ms 61872 KB Output is correct
83 Correct 1787 ms 57944 KB Output is correct
84 Correct 1806 ms 58460 KB Output is correct
85 Correct 1777 ms 58200 KB Output is correct
86 Correct 2016 ms 62076 KB Output is correct
87 Correct 2119 ms 65864 KB Output is correct
88 Correct 2080 ms 65788 KB Output is correct
89 Correct 2410 ms 61500 KB Output is correct
90 Correct 2238 ms 61884 KB Output is correct
91 Correct 8 ms 11980 KB Output is correct
92 Correct 9 ms 11980 KB Output is correct
93 Correct 8 ms 11980 KB Output is correct
94 Correct 30 ms 13004 KB Output is correct
95 Correct 91 ms 19144 KB Output is correct
96 Correct 91 ms 18628 KB Output is correct
97 Correct 95 ms 18900 KB Output is correct
98 Correct 11 ms 12112 KB Output is correct
99 Correct 89 ms 18624 KB Output is correct
100 Correct 89 ms 18640 KB Output is correct
101 Correct 89 ms 18740 KB Output is correct
102 Correct 85 ms 18504 KB Output is correct
103 Correct 120 ms 18712 KB Output is correct
104 Correct 87 ms 18604 KB Output is correct
105 Correct 95 ms 18564 KB Output is correct
106 Correct 2043 ms 62116 KB Output is correct
107 Correct 1943 ms 66224 KB Output is correct
108 Correct 1836 ms 61896 KB Output is correct
109 Correct 1613 ms 65988 KB Output is correct
110 Correct 1986 ms 57608 KB Output is correct
111 Correct 1794 ms 59792 KB Output is correct
112 Correct 2121 ms 66184 KB Output is correct
113 Correct 2111 ms 62944 KB Output is correct
114 Correct 2178 ms 59248 KB Output is correct
115 Correct 2160 ms 59148 KB Output is correct
116 Correct 1894 ms 64532 KB Output is correct
117 Correct 2029 ms 61944 KB Output is correct
118 Correct 1798 ms 57976 KB Output is correct
119 Correct 1823 ms 58448 KB Output is correct
120 Correct 1818 ms 58116 KB Output is correct
121 Correct 2055 ms 62016 KB Output is correct
122 Correct 2161 ms 65708 KB Output is correct
123 Correct 2194 ms 65852 KB Output is correct
124 Correct 2234 ms 61588 KB Output is correct
125 Correct 2063 ms 61848 KB Output is correct
126 Correct 2098 ms 62984 KB Output is correct
127 Correct 1944 ms 64584 KB Output is correct
128 Correct 2152 ms 62020 KB Output is correct
129 Correct 1893 ms 60832 KB Output is correct
130 Correct 2112 ms 62016 KB Output is correct
131 Correct 2217 ms 61728 KB Output is correct
132 Correct 2037 ms 62016 KB Output is correct
133 Correct 7 ms 12084 KB Output is correct
134 Correct 7 ms 11980 KB Output is correct
135 Correct 8 ms 11980 KB Output is correct
136 Correct 28 ms 13624 KB Output is correct
137 Correct 105 ms 20328 KB Output is correct
138 Correct 97 ms 19876 KB Output is correct
139 Correct 96 ms 19924 KB Output is correct
140 Correct 10 ms 12088 KB Output is correct
141 Correct 112 ms 19780 KB Output is correct
142 Correct 97 ms 19796 KB Output is correct
143 Correct 101 ms 19832 KB Output is correct
144 Correct 81 ms 19732 KB Output is correct
145 Correct 99 ms 19876 KB Output is correct
146 Correct 89 ms 19784 KB Output is correct
147 Correct 93 ms 19900 KB Output is correct
148 Correct 2252 ms 100360 KB Output is correct
149 Correct 2169 ms 75640 KB Output is correct
150 Correct 1998 ms 61800 KB Output is correct
151 Correct 1587 ms 65940 KB Output is correct
152 Correct 2091 ms 57592 KB Output is correct
153 Correct 1975 ms 59788 KB Output is correct
154 Correct 2390 ms 65960 KB Output is correct
155 Correct 2955 ms 70484 KB Output is correct
156 Correct 3385 ms 81016 KB Output is correct
157 Correct 2759 ms 70924 KB Output is correct
158 Correct 1423 ms 57140 KB Output is correct
159 Correct 2744 ms 71136 KB Output is correct
160 Correct 2525 ms 63784 KB Output is correct
161 Correct 2111 ms 63100 KB Output is correct
162 Correct 2173 ms 59160 KB Output is correct
163 Correct 2158 ms 59168 KB Output is correct
164 Correct 1891 ms 64528 KB Output is correct
165 Correct 2056 ms 61872 KB Output is correct
166 Correct 1787 ms 57968 KB Output is correct
167 Correct 1820 ms 58540 KB Output is correct
168 Correct 1793 ms 58196 KB Output is correct
169 Correct 2083 ms 61932 KB Output is correct
170 Correct 2187 ms 65660 KB Output is correct
171 Correct 2147 ms 65824 KB Output is correct
172 Correct 2270 ms 61552 KB Output is correct
173 Correct 2047 ms 61888 KB Output is correct
174 Correct 2169 ms 62972 KB Output is correct
175 Correct 1926 ms 64564 KB Output is correct
176 Correct 2093 ms 61980 KB Output is correct
177 Correct 1857 ms 60968 KB Output is correct
178 Correct 2160 ms 62168 KB Output is correct
179 Correct 2325 ms 61568 KB Output is correct
180 Correct 2017 ms 62016 KB Output is correct
181 Correct 2251 ms 63240 KB Output is correct
182 Correct 2008 ms 65984 KB Output is correct
183 Correct 2932 ms 71496 KB Output is correct
184 Correct 2758 ms 75092 KB Output is correct
185 Correct 2742 ms 66220 KB Output is correct
186 Correct 2240 ms 61880 KB Output is correct
187 Correct 1838 ms 57596 KB Output is correct