답안 #869353

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
869353 2023-11-04T07:13:15 Z Trisanu_Das From Hacks to Snitches (BOI21_watchmen) C++17
100 / 100
1650 ms 120604 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';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 16476 KB Output is correct
2 Correct 41 ms 22316 KB Output is correct
3 Correct 44 ms 21840 KB Output is correct
4 Correct 45 ms 22108 KB Output is correct
5 Correct 5 ms 14940 KB Output is correct
6 Correct 44 ms 21848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 16392 KB Output is correct
2 Correct 43 ms 22364 KB Output is correct
3 Correct 59 ms 21776 KB Output is correct
4 Correct 47 ms 22072 KB Output is correct
5 Correct 5 ms 14936 KB Output is correct
6 Correct 43 ms 22016 KB Output is correct
7 Correct 41 ms 21840 KB Output is correct
8 Correct 40 ms 21848 KB Output is correct
9 Correct 45 ms 21840 KB Output is correct
10 Correct 45 ms 22096 KB Output is correct
11 Correct 49 ms 21840 KB Output is correct
12 Correct 52 ms 21748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 16392 KB Output is correct
2 Correct 43 ms 22364 KB Output is correct
3 Correct 59 ms 21776 KB Output is correct
4 Correct 47 ms 22072 KB Output is correct
5 Correct 5 ms 14936 KB Output is correct
6 Correct 43 ms 22016 KB Output is correct
7 Correct 41 ms 21840 KB Output is correct
8 Correct 40 ms 21848 KB Output is correct
9 Correct 45 ms 21840 KB Output is correct
10 Correct 45 ms 22096 KB Output is correct
11 Correct 49 ms 21840 KB Output is correct
12 Correct 52 ms 21748 KB Output is correct
13 Correct 16 ms 16476 KB Output is correct
14 Correct 46 ms 22344 KB Output is correct
15 Correct 41 ms 22012 KB Output is correct
16 Correct 45 ms 22100 KB Output is correct
17 Correct 5 ms 14936 KB Output is correct
18 Correct 43 ms 21848 KB Output is correct
19 Correct 40 ms 21844 KB Output is correct
20 Correct 40 ms 21852 KB Output is correct
21 Correct 38 ms 21840 KB Output is correct
22 Correct 42 ms 22100 KB Output is correct
23 Correct 40 ms 21844 KB Output is correct
24 Correct 44 ms 21844 KB Output is correct
25 Correct 998 ms 101816 KB Output is correct
26 Correct 909 ms 106128 KB Output is correct
27 Correct 846 ms 101652 KB Output is correct
28 Correct 793 ms 105664 KB Output is correct
29 Correct 1052 ms 97316 KB Output is correct
30 Correct 980 ms 99344 KB Output is correct
31 Correct 1176 ms 105936 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 16392 KB Output is correct
2 Correct 43 ms 22364 KB Output is correct
3 Correct 59 ms 21776 KB Output is correct
4 Correct 47 ms 22072 KB Output is correct
5 Correct 5 ms 14936 KB Output is correct
6 Correct 43 ms 22016 KB Output is correct
7 Correct 41 ms 21840 KB Output is correct
8 Correct 40 ms 21848 KB Output is correct
9 Correct 45 ms 21840 KB Output is correct
10 Correct 45 ms 22096 KB Output is correct
11 Correct 49 ms 21840 KB Output is correct
12 Correct 52 ms 21748 KB Output is correct
13 Correct 16 ms 16476 KB Output is correct
14 Correct 46 ms 22344 KB Output is correct
15 Correct 41 ms 22012 KB Output is correct
16 Correct 45 ms 22100 KB Output is correct
17 Correct 5 ms 14936 KB Output is correct
18 Correct 43 ms 21848 KB Output is correct
19 Correct 40 ms 21844 KB Output is correct
20 Correct 40 ms 21852 KB Output is correct
21 Correct 38 ms 21840 KB Output is correct
22 Correct 42 ms 22100 KB Output is correct
23 Correct 40 ms 21844 KB Output is correct
24 Correct 44 ms 21844 KB Output is correct
25 Correct 998 ms 101816 KB Output is correct
26 Correct 909 ms 106128 KB Output is correct
27 Correct 846 ms 101652 KB Output is correct
28 Correct 793 ms 105664 KB Output is correct
29 Correct 1052 ms 97316 KB Output is correct
30 Correct 980 ms 99344 KB Output is correct
31 Correct 1176 ms 105936 KB Output is correct
32 Correct 17 ms 16476 KB Output is correct
33 Correct 58 ms 22464 KB Output is correct
34 Correct 49 ms 21780 KB Output is correct
35 Correct 46 ms 22108 KB Output is correct
36 Correct 5 ms 14940 KB Output is correct
37 Correct 57 ms 21844 KB Output is correct
38 Correct 40 ms 21852 KB Output is correct
39 Correct 39 ms 21840 KB Output is correct
40 Correct 40 ms 21720 KB Output is correct
41 Correct 43 ms 22172 KB Output is correct
42 Correct 40 ms 21840 KB Output is correct
43 Correct 46 ms 21988 KB Output is correct
44 Correct 1091 ms 101504 KB Output is correct
45 Correct 982 ms 105680 KB Output is correct
46 Correct 913 ms 101452 KB Output is correct
47 Correct 1139 ms 105568 KB Output is correct
48 Correct 1059 ms 97480 KB Output is correct
49 Correct 1120 ms 99368 KB Output is correct
50 Correct 1223 ms 105688 KB Output is correct
51 Correct 1474 ms 110032 KB Output is correct
52 Correct 1567 ms 120540 KB Output is correct
53 Correct 1286 ms 110496 KB Output is correct
54 Correct 781 ms 96664 KB Output is correct
55 Correct 1650 ms 110800 KB Output is correct
56 Correct 1547 ms 103420 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 16476 KB Output is correct
2 Correct 41 ms 22316 KB Output is correct
3 Correct 44 ms 21840 KB Output is correct
4 Correct 45 ms 22108 KB Output is correct
5 Correct 5 ms 14940 KB Output is correct
6 Correct 44 ms 21848 KB Output is correct
7 Correct 16 ms 16392 KB Output is correct
8 Correct 43 ms 22364 KB Output is correct
9 Correct 59 ms 21776 KB Output is correct
10 Correct 47 ms 22072 KB Output is correct
11 Correct 5 ms 14936 KB Output is correct
12 Correct 43 ms 22016 KB Output is correct
13 Correct 41 ms 21840 KB Output is correct
14 Correct 40 ms 21848 KB Output is correct
15 Correct 45 ms 21840 KB Output is correct
16 Correct 45 ms 22096 KB Output is correct
17 Correct 49 ms 21840 KB Output is correct
18 Correct 52 ms 21748 KB Output is correct
19 Correct 3 ms 14940 KB Output is correct
20 Correct 3 ms 14940 KB Output is correct
21 Correct 3 ms 14996 KB Output is correct
22 Correct 16 ms 16476 KB Output is correct
23 Correct 69 ms 22452 KB Output is correct
24 Correct 46 ms 21864 KB Output is correct
25 Correct 45 ms 22108 KB Output is correct
26 Correct 4 ms 15188 KB Output is correct
27 Correct 42 ms 21852 KB Output is correct
28 Correct 43 ms 21852 KB Output is correct
29 Correct 38 ms 21792 KB Output is correct
30 Correct 37 ms 21840 KB Output is correct
31 Correct 40 ms 22152 KB Output is correct
32 Correct 57 ms 22100 KB Output is correct
33 Correct 41 ms 21936 KB Output is correct
34 Correct 1279 ms 102552 KB Output is correct
35 Correct 1339 ms 99192 KB Output is correct
36 Correct 1356 ms 99172 KB Output is correct
37 Correct 1059 ms 104076 KB Output is correct
38 Correct 1131 ms 101680 KB Output is correct
39 Correct 1119 ms 97908 KB Output is correct
40 Correct 1444 ms 97780 KB Output is correct
41 Correct 1138 ms 97648 KB Output is correct
42 Correct 1048 ms 101512 KB Output is correct
43 Correct 1190 ms 105156 KB Output is correct
44 Correct 1207 ms 105600 KB Output is correct
45 Correct 1266 ms 101108 KB Output is correct
46 Correct 1069 ms 101640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 16476 KB Output is correct
2 Correct 41 ms 22316 KB Output is correct
3 Correct 44 ms 21840 KB Output is correct
4 Correct 45 ms 22108 KB Output is correct
5 Correct 5 ms 14940 KB Output is correct
6 Correct 44 ms 21848 KB Output is correct
7 Correct 16 ms 16392 KB Output is correct
8 Correct 43 ms 22364 KB Output is correct
9 Correct 59 ms 21776 KB Output is correct
10 Correct 47 ms 22072 KB Output is correct
11 Correct 5 ms 14936 KB Output is correct
12 Correct 43 ms 22016 KB Output is correct
13 Correct 41 ms 21840 KB Output is correct
14 Correct 40 ms 21848 KB Output is correct
15 Correct 45 ms 21840 KB Output is correct
16 Correct 45 ms 22096 KB Output is correct
17 Correct 49 ms 21840 KB Output is correct
18 Correct 52 ms 21748 KB Output is correct
19 Correct 16 ms 16476 KB Output is correct
20 Correct 46 ms 22344 KB Output is correct
21 Correct 41 ms 22012 KB Output is correct
22 Correct 45 ms 22100 KB Output is correct
23 Correct 5 ms 14936 KB Output is correct
24 Correct 43 ms 21848 KB Output is correct
25 Correct 40 ms 21844 KB Output is correct
26 Correct 40 ms 21852 KB Output is correct
27 Correct 38 ms 21840 KB Output is correct
28 Correct 42 ms 22100 KB Output is correct
29 Correct 40 ms 21844 KB Output is correct
30 Correct 44 ms 21844 KB Output is correct
31 Correct 998 ms 101816 KB Output is correct
32 Correct 909 ms 106128 KB Output is correct
33 Correct 846 ms 101652 KB Output is correct
34 Correct 793 ms 105664 KB Output is correct
35 Correct 1052 ms 97316 KB Output is correct
36 Correct 980 ms 99344 KB Output is correct
37 Correct 1176 ms 105936 KB Output is correct
38 Correct 3 ms 14940 KB Output is correct
39 Correct 3 ms 14940 KB Output is correct
40 Correct 3 ms 14996 KB Output is correct
41 Correct 16 ms 16476 KB Output is correct
42 Correct 69 ms 22452 KB Output is correct
43 Correct 46 ms 21864 KB Output is correct
44 Correct 45 ms 22108 KB Output is correct
45 Correct 4 ms 15188 KB Output is correct
46 Correct 42 ms 21852 KB Output is correct
47 Correct 43 ms 21852 KB Output is correct
48 Correct 38 ms 21792 KB Output is correct
49 Correct 37 ms 21840 KB Output is correct
50 Correct 40 ms 22152 KB Output is correct
51 Correct 57 ms 22100 KB Output is correct
52 Correct 41 ms 21936 KB Output is correct
53 Correct 1279 ms 102552 KB Output is correct
54 Correct 1339 ms 99192 KB Output is correct
55 Correct 1356 ms 99172 KB Output is correct
56 Correct 1059 ms 104076 KB Output is correct
57 Correct 1131 ms 101680 KB Output is correct
58 Correct 1119 ms 97908 KB Output is correct
59 Correct 1444 ms 97780 KB Output is correct
60 Correct 1138 ms 97648 KB Output is correct
61 Correct 1048 ms 101512 KB Output is correct
62 Correct 1190 ms 105156 KB Output is correct
63 Correct 1207 ms 105600 KB Output is correct
64 Correct 1266 ms 101108 KB Output is correct
65 Correct 1069 ms 101640 KB Output is correct
66 Correct 3 ms 14936 KB Output is correct
67 Correct 3 ms 14940 KB Output is correct
68 Correct 4 ms 15196 KB Output is correct
69 Correct 16 ms 16540 KB Output is correct
70 Correct 44 ms 22356 KB Output is correct
71 Correct 41 ms 21848 KB Output is correct
72 Correct 45 ms 22108 KB Output is correct
73 Correct 5 ms 14940 KB Output is correct
74 Correct 43 ms 21872 KB Output is correct
75 Correct 40 ms 21844 KB Output is correct
76 Correct 66 ms 21848 KB Output is correct
77 Correct 38 ms 21840 KB Output is correct
78 Correct 42 ms 22096 KB Output is correct
79 Correct 40 ms 21840 KB Output is correct
80 Correct 41 ms 21840 KB Output is correct
81 Correct 1111 ms 101488 KB Output is correct
82 Correct 1000 ms 105836 KB Output is correct
83 Correct 906 ms 101648 KB Output is correct
84 Correct 808 ms 105500 KB Output is correct
85 Correct 1056 ms 97604 KB Output is correct
86 Correct 997 ms 99532 KB Output is correct
87 Correct 1153 ms 105556 KB Output is correct
88 Correct 1036 ms 102408 KB Output is correct
89 Correct 1219 ms 98684 KB Output is correct
90 Correct 1198 ms 98560 KB Output is correct
91 Correct 892 ms 104028 KB Output is correct
92 Correct 1014 ms 101404 KB Output is correct
93 Correct 1000 ms 97740 KB Output is correct
94 Correct 1012 ms 98040 KB Output is correct
95 Correct 1008 ms 97808 KB Output is correct
96 Correct 1018 ms 101332 KB Output is correct
97 Correct 1244 ms 105252 KB Output is correct
98 Correct 1151 ms 105384 KB Output is correct
99 Correct 1214 ms 101432 KB Output is correct
100 Correct 1044 ms 101460 KB Output is correct
101 Correct 1018 ms 102760 KB Output is correct
102 Correct 958 ms 104272 KB Output is correct
103 Correct 1002 ms 101716 KB Output is correct
104 Correct 1274 ms 100140 KB Output is correct
105 Correct 1056 ms 101508 KB Output is correct
106 Correct 1214 ms 101116 KB Output is correct
107 Correct 1008 ms 101820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 16476 KB Output is correct
2 Correct 41 ms 22316 KB Output is correct
3 Correct 44 ms 21840 KB Output is correct
4 Correct 45 ms 22108 KB Output is correct
5 Correct 5 ms 14940 KB Output is correct
6 Correct 44 ms 21848 KB Output is correct
7 Correct 16 ms 16392 KB Output is correct
8 Correct 43 ms 22364 KB Output is correct
9 Correct 59 ms 21776 KB Output is correct
10 Correct 47 ms 22072 KB Output is correct
11 Correct 5 ms 14936 KB Output is correct
12 Correct 43 ms 22016 KB Output is correct
13 Correct 41 ms 21840 KB Output is correct
14 Correct 40 ms 21848 KB Output is correct
15 Correct 45 ms 21840 KB Output is correct
16 Correct 45 ms 22096 KB Output is correct
17 Correct 49 ms 21840 KB Output is correct
18 Correct 52 ms 21748 KB Output is correct
19 Correct 16 ms 16476 KB Output is correct
20 Correct 46 ms 22344 KB Output is correct
21 Correct 41 ms 22012 KB Output is correct
22 Correct 45 ms 22100 KB Output is correct
23 Correct 5 ms 14936 KB Output is correct
24 Correct 43 ms 21848 KB Output is correct
25 Correct 40 ms 21844 KB Output is correct
26 Correct 40 ms 21852 KB Output is correct
27 Correct 38 ms 21840 KB Output is correct
28 Correct 42 ms 22100 KB Output is correct
29 Correct 40 ms 21844 KB Output is correct
30 Correct 44 ms 21844 KB Output is correct
31 Correct 998 ms 101816 KB Output is correct
32 Correct 909 ms 106128 KB Output is correct
33 Correct 846 ms 101652 KB Output is correct
34 Correct 793 ms 105664 KB Output is correct
35 Correct 1052 ms 97316 KB Output is correct
36 Correct 980 ms 99344 KB Output is correct
37 Correct 1176 ms 105936 KB Output is correct
38 Correct 17 ms 16476 KB Output is correct
39 Correct 58 ms 22464 KB Output is correct
40 Correct 49 ms 21780 KB Output is correct
41 Correct 46 ms 22108 KB Output is correct
42 Correct 5 ms 14940 KB Output is correct
43 Correct 57 ms 21844 KB Output is correct
44 Correct 40 ms 21852 KB Output is correct
45 Correct 39 ms 21840 KB Output is correct
46 Correct 40 ms 21720 KB Output is correct
47 Correct 43 ms 22172 KB Output is correct
48 Correct 40 ms 21840 KB Output is correct
49 Correct 46 ms 21988 KB Output is correct
50 Correct 1091 ms 101504 KB Output is correct
51 Correct 982 ms 105680 KB Output is correct
52 Correct 913 ms 101452 KB Output is correct
53 Correct 1139 ms 105568 KB Output is correct
54 Correct 1059 ms 97480 KB Output is correct
55 Correct 1120 ms 99368 KB Output is correct
56 Correct 1223 ms 105688 KB Output is correct
57 Correct 1474 ms 110032 KB Output is correct
58 Correct 1567 ms 120540 KB Output is correct
59 Correct 1286 ms 110496 KB Output is correct
60 Correct 781 ms 96664 KB Output is correct
61 Correct 1650 ms 110800 KB Output is correct
62 Correct 1547 ms 103420 KB Output is correct
63 Correct 3 ms 14940 KB Output is correct
64 Correct 3 ms 14940 KB Output is correct
65 Correct 3 ms 14996 KB Output is correct
66 Correct 16 ms 16476 KB Output is correct
67 Correct 69 ms 22452 KB Output is correct
68 Correct 46 ms 21864 KB Output is correct
69 Correct 45 ms 22108 KB Output is correct
70 Correct 4 ms 15188 KB Output is correct
71 Correct 42 ms 21852 KB Output is correct
72 Correct 43 ms 21852 KB Output is correct
73 Correct 38 ms 21792 KB Output is correct
74 Correct 37 ms 21840 KB Output is correct
75 Correct 40 ms 22152 KB Output is correct
76 Correct 57 ms 22100 KB Output is correct
77 Correct 41 ms 21936 KB Output is correct
78 Correct 1279 ms 102552 KB Output is correct
79 Correct 1339 ms 99192 KB Output is correct
80 Correct 1356 ms 99172 KB Output is correct
81 Correct 1059 ms 104076 KB Output is correct
82 Correct 1131 ms 101680 KB Output is correct
83 Correct 1119 ms 97908 KB Output is correct
84 Correct 1444 ms 97780 KB Output is correct
85 Correct 1138 ms 97648 KB Output is correct
86 Correct 1048 ms 101512 KB Output is correct
87 Correct 1190 ms 105156 KB Output is correct
88 Correct 1207 ms 105600 KB Output is correct
89 Correct 1266 ms 101108 KB Output is correct
90 Correct 1069 ms 101640 KB Output is correct
91 Correct 3 ms 14936 KB Output is correct
92 Correct 3 ms 14940 KB Output is correct
93 Correct 4 ms 15196 KB Output is correct
94 Correct 16 ms 16540 KB Output is correct
95 Correct 44 ms 22356 KB Output is correct
96 Correct 41 ms 21848 KB Output is correct
97 Correct 45 ms 22108 KB Output is correct
98 Correct 5 ms 14940 KB Output is correct
99 Correct 43 ms 21872 KB Output is correct
100 Correct 40 ms 21844 KB Output is correct
101 Correct 66 ms 21848 KB Output is correct
102 Correct 38 ms 21840 KB Output is correct
103 Correct 42 ms 22096 KB Output is correct
104 Correct 40 ms 21840 KB Output is correct
105 Correct 41 ms 21840 KB Output is correct
106 Correct 1111 ms 101488 KB Output is correct
107 Correct 1000 ms 105836 KB Output is correct
108 Correct 906 ms 101648 KB Output is correct
109 Correct 808 ms 105500 KB Output is correct
110 Correct 1056 ms 97604 KB Output is correct
111 Correct 997 ms 99532 KB Output is correct
112 Correct 1153 ms 105556 KB Output is correct
113 Correct 1036 ms 102408 KB Output is correct
114 Correct 1219 ms 98684 KB Output is correct
115 Correct 1198 ms 98560 KB Output is correct
116 Correct 892 ms 104028 KB Output is correct
117 Correct 1014 ms 101404 KB Output is correct
118 Correct 1000 ms 97740 KB Output is correct
119 Correct 1012 ms 98040 KB Output is correct
120 Correct 1008 ms 97808 KB Output is correct
121 Correct 1018 ms 101332 KB Output is correct
122 Correct 1244 ms 105252 KB Output is correct
123 Correct 1151 ms 105384 KB Output is correct
124 Correct 1214 ms 101432 KB Output is correct
125 Correct 1044 ms 101460 KB Output is correct
126 Correct 1018 ms 102760 KB Output is correct
127 Correct 958 ms 104272 KB Output is correct
128 Correct 1002 ms 101716 KB Output is correct
129 Correct 1274 ms 100140 KB Output is correct
130 Correct 1056 ms 101508 KB Output is correct
131 Correct 1214 ms 101116 KB Output is correct
132 Correct 1008 ms 101820 KB Output is correct
133 Correct 3 ms 14940 KB Output is correct
134 Correct 3 ms 15000 KB Output is correct
135 Correct 3 ms 14936 KB Output is correct
136 Correct 16 ms 16476 KB Output is correct
137 Correct 45 ms 22364 KB Output is correct
138 Correct 42 ms 21840 KB Output is correct
139 Correct 45 ms 22120 KB Output is correct
140 Correct 5 ms 14940 KB Output is correct
141 Correct 45 ms 21856 KB Output is correct
142 Correct 61 ms 21940 KB Output is correct
143 Correct 42 ms 21840 KB Output is correct
144 Correct 38 ms 21848 KB Output is correct
145 Correct 42 ms 22096 KB Output is correct
146 Correct 44 ms 22012 KB Output is correct
147 Correct 41 ms 21840 KB Output is correct
148 Correct 1000 ms 101712 KB Output is correct
149 Correct 896 ms 105808 KB Output is correct
150 Correct 853 ms 101484 KB Output is correct
151 Correct 776 ms 105560 KB Output is correct
152 Correct 1041 ms 97408 KB Output is correct
153 Correct 965 ms 99476 KB Output is correct
154 Correct 1108 ms 105668 KB Output is correct
155 Correct 1494 ms 110256 KB Output is correct
156 Correct 1563 ms 120604 KB Output is correct
157 Correct 1274 ms 110672 KB Output is correct
158 Correct 773 ms 96840 KB Output is correct
159 Correct 1606 ms 110700 KB Output is correct
160 Correct 1395 ms 103208 KB Output is correct
161 Correct 1010 ms 102576 KB Output is correct
162 Correct 1232 ms 98752 KB Output is correct
163 Correct 1328 ms 98664 KB Output is correct
164 Correct 902 ms 104156 KB Output is correct
165 Correct 1050 ms 101592 KB Output is correct
166 Correct 1088 ms 98120 KB Output is correct
167 Correct 1010 ms 97744 KB Output is correct
168 Correct 1028 ms 97996 KB Output is correct
169 Correct 1197 ms 101396 KB Output is correct
170 Correct 1207 ms 105492 KB Output is correct
171 Correct 1151 ms 105548 KB Output is correct
172 Correct 1289 ms 101192 KB Output is correct
173 Correct 1090 ms 101336 KB Output is correct
174 Correct 1144 ms 102468 KB Output is correct
175 Correct 925 ms 104056 KB Output is correct
176 Correct 1048 ms 101972 KB Output is correct
177 Correct 1059 ms 100812 KB Output is correct
178 Correct 1138 ms 101604 KB Output is correct
179 Correct 1246 ms 101324 KB Output is correct
180 Correct 1045 ms 101504 KB Output is correct
181 Correct 1059 ms 102836 KB Output is correct
182 Correct 943 ms 105812 KB Output is correct
183 Correct 1465 ms 111060 KB Output is correct
184 Correct 1585 ms 114704 KB Output is correct
185 Correct 1486 ms 105912 KB Output is correct
186 Correct 1209 ms 101548 KB Output is correct
187 Correct 984 ms 97396 KB Output is correct