답안 #399438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
399438 2021-05-05T19:37:55 Z egorlifar From Hacks to Snitches (BOI21_watchmen) C++17
100 / 100
3349 ms 119488 KB
/*
KAMUI!
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 
▓▓▓▓▓▓▓▓▓▓▓▓▓██████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 
▓▓▓▓▓▓▓▓▓▓███▓▓▓▓▓▓▓▓▓▓█████▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓███▓▒▒░▒▒▒▒▒░░░▒▒▒▓▓███▓▓▓▓▓▓▓ 
▓▓▓▓▓▓█▓▒▒▒▓▓████████▓▒▒░▒▒▒▓██▓▓▓▓▓▓
▓▓▓▓██▒▓████████████████▓░▒▒▒▒▓██▓▓▓▓ 
▓▓▓██▓███████▓▒░░░░░░░▒███▒░░▒▒▒██▓▓▓ 
▓▓█████████▓░░░░░░░░░░░░░██▓▓██████▓▓ 
▓▓█▒▓███████████▓▓▒▒▒▓▓██████████▓█▓▓ 
▓██▒▒▒███████████████████████████▓▓█▓ 
▓█▓▒▒░░████████▒░░░░▓███████████▓░▒█▓ 
▓█▒▒▒░██░▒████░░░░░░█████░░████▓░░▒█▓ 
▓█▒▒▒▒██░░░██▓░░░░░░░███▒░░████▒▒▒▒█▓ 
▓█▓▒▒▒██▒░░░▓█▓░░░░░▓█▓░░░▓███▓▒▒░▓█▓ 
▓█▓▒▒▒███░░░░████████▓░░░░░████▒▒▒▓█▓ 
▓▓█▒▒░▓███░░░▒███████▒░░░▒███▓▒▒▒▒█▓▓ 
▓▓██▒▒░████▒░░███████░░░▓███▓░▒▒▒██▓▓ 
▓▓▓██▒▒▒█████▓░░██████▒▓███▓▒░▒▒██▓▓▓ 
▓▓▓▓██▓▒░▓██████████████▓▒░▒▒▒▓██▓▓▓▓ 
▓▓▓▓▓▓██▓░▒▓█████████▒░░▒▒▒▒▓██▓▓▓▓▓▓ 
▓▓▓▓▓▓▓███▓▒▒▓██████▓░▒▒▒▓▓███▓▓▓▓▓▓▓ 
▓▓▓▓▓▓▓▓▓▓▓███▓▓▓▓███▓▓▓████▓▓▓▓▓▓▓▓▓ 
▓▓▓▓▓▓▓▓▓▓▓▓▓███████████▓▓▓▓▓▓▓▓▓▓▓▓▓ 
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
 
using namespace std;
template<typename T1, typename T2> inline void chkmin(T1 &a, T2 b) {if (a > b) a = b;}
template<typename T1, typename T2> inline void chkmax(T1 &a, T2 b) {if (a < b) a = b;}
#define files(FILENAME) read(FILENAME); write(FILENAME)
#define read(FILENAME) freopen((FILENAME + ".in").c_str(), "r", stdin)
#define write(FILENAME) freopen((FILENAME + ".out").c_str(), "w", stdout)
#define all(c) (c).begin(), (c).end()
#define sz(c) (int)(c).size()
#define left left228
#define right right228
#define y1 y1228
#define mp make_pair
#define pb push_back
#define y2 y2228
#define rank rank228
using ll = long long;
using ld = long double; 
const string FILENAME = "input";
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.tie(0);
    cout.tie(0);
   // read(FILENAME);
    cin >> N >> M;
    for (int i = 0; i < N; i++) {
        r[i] = 0, t[i] = -1;
    }
    for (int i = 0; i < M; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        e[u].pb(v);
        e[v].pb(u);
    }
    cin >> K;
    L[0] = 1;
    for (int i = 1; i <= K; i++) {
        cin >> L[i];
        for (int j = 0; j < L[i]; j++) {
            int u;
            cin >> u;
            u--;
            V[i].pb(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 < sz(e[i]); 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';
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13520 KB Output is correct
2 Correct 96 ms 20596 KB Output is correct
3 Correct 83 ms 19768 KB Output is correct
4 Correct 97 ms 19908 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 88 ms 19788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 13624 KB Output is correct
2 Correct 94 ms 20352 KB Output is correct
3 Correct 105 ms 19824 KB Output is correct
4 Correct 95 ms 19940 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 85 ms 19704 KB Output is correct
7 Correct 88 ms 19772 KB Output is correct
8 Correct 83 ms 19908 KB Output is correct
9 Correct 76 ms 19616 KB Output is correct
10 Correct 88 ms 19936 KB Output is correct
11 Correct 119 ms 19720 KB Output is correct
12 Correct 93 ms 19752 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 13624 KB Output is correct
2 Correct 94 ms 20352 KB Output is correct
3 Correct 105 ms 19824 KB Output is correct
4 Correct 95 ms 19940 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 85 ms 19704 KB Output is correct
7 Correct 88 ms 19772 KB Output is correct
8 Correct 83 ms 19908 KB Output is correct
9 Correct 76 ms 19616 KB Output is correct
10 Correct 88 ms 19936 KB Output is correct
11 Correct 119 ms 19720 KB Output is correct
12 Correct 93 ms 19752 KB Output is correct
13 Correct 28 ms 13612 KB Output is correct
14 Correct 93 ms 20348 KB Output is correct
15 Correct 89 ms 19832 KB Output is correct
16 Correct 112 ms 19908 KB Output is correct
17 Correct 11 ms 12108 KB Output is correct
18 Correct 88 ms 19820 KB Output is correct
19 Correct 81 ms 19772 KB Output is correct
20 Correct 82 ms 19780 KB Output is correct
21 Correct 88 ms 19864 KB Output is correct
22 Correct 98 ms 19872 KB Output is correct
23 Correct 84 ms 19776 KB Output is correct
24 Correct 84 ms 19780 KB Output is correct
25 Correct 2013 ms 100580 KB Output is correct
26 Correct 1949 ms 104648 KB Output is correct
27 Correct 1846 ms 100364 KB Output is correct
28 Correct 1446 ms 104456 KB Output is correct
29 Correct 1802 ms 96444 KB Output is correct
30 Correct 1758 ms 98316 KB Output is correct
31 Correct 2107 ms 104656 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 13624 KB Output is correct
2 Correct 94 ms 20352 KB Output is correct
3 Correct 105 ms 19824 KB Output is correct
4 Correct 95 ms 19940 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 85 ms 19704 KB Output is correct
7 Correct 88 ms 19772 KB Output is correct
8 Correct 83 ms 19908 KB Output is correct
9 Correct 76 ms 19616 KB Output is correct
10 Correct 88 ms 19936 KB Output is correct
11 Correct 119 ms 19720 KB Output is correct
12 Correct 93 ms 19752 KB Output is correct
13 Correct 28 ms 13612 KB Output is correct
14 Correct 93 ms 20348 KB Output is correct
15 Correct 89 ms 19832 KB Output is correct
16 Correct 112 ms 19908 KB Output is correct
17 Correct 11 ms 12108 KB Output is correct
18 Correct 88 ms 19820 KB Output is correct
19 Correct 81 ms 19772 KB Output is correct
20 Correct 82 ms 19780 KB Output is correct
21 Correct 88 ms 19864 KB Output is correct
22 Correct 98 ms 19872 KB Output is correct
23 Correct 84 ms 19776 KB Output is correct
24 Correct 84 ms 19780 KB Output is correct
25 Correct 2013 ms 100580 KB Output is correct
26 Correct 1949 ms 104648 KB Output is correct
27 Correct 1846 ms 100364 KB Output is correct
28 Correct 1446 ms 104456 KB Output is correct
29 Correct 1802 ms 96444 KB Output is correct
30 Correct 1758 ms 98316 KB Output is correct
31 Correct 2107 ms 104656 KB Output is correct
32 Correct 29 ms 13624 KB Output is correct
33 Correct 93 ms 20340 KB Output is correct
34 Correct 99 ms 19776 KB Output is correct
35 Correct 110 ms 20036 KB Output is correct
36 Correct 11 ms 12108 KB Output is correct
37 Correct 88 ms 19708 KB Output is correct
38 Correct 83 ms 19796 KB Output is correct
39 Correct 79 ms 19788 KB Output is correct
40 Correct 79 ms 19652 KB Output is correct
41 Correct 94 ms 19896 KB Output is correct
42 Correct 82 ms 19796 KB Output is correct
43 Correct 85 ms 19796 KB Output is correct
44 Correct 2020 ms 100512 KB Output is correct
45 Correct 1907 ms 104712 KB Output is correct
46 Correct 1725 ms 100412 KB Output is correct
47 Correct 1403 ms 104460 KB Output is correct
48 Correct 1769 ms 96476 KB Output is correct
49 Correct 1776 ms 98324 KB Output is correct
50 Correct 2108 ms 104572 KB Output is correct
51 Correct 2746 ms 109220 KB Output is correct
52 Correct 3349 ms 119488 KB Output is correct
53 Correct 2672 ms 109684 KB Output is correct
54 Correct 1390 ms 95600 KB Output is correct
55 Correct 2737 ms 109724 KB Output is correct
56 Correct 2520 ms 102232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13520 KB Output is correct
2 Correct 96 ms 20596 KB Output is correct
3 Correct 83 ms 19768 KB Output is correct
4 Correct 97 ms 19908 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 88 ms 19788 KB Output is correct
7 Correct 28 ms 13624 KB Output is correct
8 Correct 94 ms 20352 KB Output is correct
9 Correct 105 ms 19824 KB Output is correct
10 Correct 95 ms 19940 KB Output is correct
11 Correct 10 ms 12108 KB Output is correct
12 Correct 85 ms 19704 KB Output is correct
13 Correct 88 ms 19772 KB Output is correct
14 Correct 83 ms 19908 KB Output is correct
15 Correct 76 ms 19616 KB Output is correct
16 Correct 88 ms 19936 KB Output is correct
17 Correct 119 ms 19720 KB Output is correct
18 Correct 93 ms 19752 KB Output is correct
19 Correct 8 ms 12000 KB Output is correct
20 Correct 7 ms 11980 KB Output is correct
21 Correct 8 ms 11984 KB Output is correct
22 Correct 27 ms 13640 KB Output is correct
23 Correct 91 ms 20288 KB Output is correct
24 Correct 103 ms 19936 KB Output is correct
25 Correct 89 ms 19920 KB Output is correct
26 Correct 11 ms 12160 KB Output is correct
27 Correct 87 ms 19700 KB Output is correct
28 Correct 82 ms 19780 KB Output is correct
29 Correct 85 ms 19668 KB Output is correct
30 Correct 90 ms 19780 KB Output is correct
31 Correct 86 ms 19964 KB Output is correct
32 Correct 88 ms 19796 KB Output is correct
33 Correct 85 ms 19748 KB Output is correct
34 Correct 2078 ms 101424 KB Output is correct
35 Correct 2154 ms 97740 KB Output is correct
36 Correct 2146 ms 97620 KB Output is correct
37 Correct 1875 ms 102948 KB Output is correct
38 Correct 2028 ms 100272 KB Output is correct
39 Correct 1792 ms 96788 KB Output is correct
40 Correct 1796 ms 96796 KB Output is correct
41 Correct 1787 ms 96680 KB Output is correct
42 Correct 2047 ms 100308 KB Output is correct
43 Correct 2127 ms 104240 KB Output is correct
44 Correct 2113 ms 104308 KB Output is correct
45 Correct 2234 ms 100352 KB Output is correct
46 Correct 2035 ms 100300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13520 KB Output is correct
2 Correct 96 ms 20596 KB Output is correct
3 Correct 83 ms 19768 KB Output is correct
4 Correct 97 ms 19908 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 88 ms 19788 KB Output is correct
7 Correct 28 ms 13624 KB Output is correct
8 Correct 94 ms 20352 KB Output is correct
9 Correct 105 ms 19824 KB Output is correct
10 Correct 95 ms 19940 KB Output is correct
11 Correct 10 ms 12108 KB Output is correct
12 Correct 85 ms 19704 KB Output is correct
13 Correct 88 ms 19772 KB Output is correct
14 Correct 83 ms 19908 KB Output is correct
15 Correct 76 ms 19616 KB Output is correct
16 Correct 88 ms 19936 KB Output is correct
17 Correct 119 ms 19720 KB Output is correct
18 Correct 93 ms 19752 KB Output is correct
19 Correct 28 ms 13612 KB Output is correct
20 Correct 93 ms 20348 KB Output is correct
21 Correct 89 ms 19832 KB Output is correct
22 Correct 112 ms 19908 KB Output is correct
23 Correct 11 ms 12108 KB Output is correct
24 Correct 88 ms 19820 KB Output is correct
25 Correct 81 ms 19772 KB Output is correct
26 Correct 82 ms 19780 KB Output is correct
27 Correct 88 ms 19864 KB Output is correct
28 Correct 98 ms 19872 KB Output is correct
29 Correct 84 ms 19776 KB Output is correct
30 Correct 84 ms 19780 KB Output is correct
31 Correct 2013 ms 100580 KB Output is correct
32 Correct 1949 ms 104648 KB Output is correct
33 Correct 1846 ms 100364 KB Output is correct
34 Correct 1446 ms 104456 KB Output is correct
35 Correct 1802 ms 96444 KB Output is correct
36 Correct 1758 ms 98316 KB Output is correct
37 Correct 2107 ms 104656 KB Output is correct
38 Correct 8 ms 12000 KB Output is correct
39 Correct 7 ms 11980 KB Output is correct
40 Correct 8 ms 11984 KB Output is correct
41 Correct 27 ms 13640 KB Output is correct
42 Correct 91 ms 20288 KB Output is correct
43 Correct 103 ms 19936 KB Output is correct
44 Correct 89 ms 19920 KB Output is correct
45 Correct 11 ms 12160 KB Output is correct
46 Correct 87 ms 19700 KB Output is correct
47 Correct 82 ms 19780 KB Output is correct
48 Correct 85 ms 19668 KB Output is correct
49 Correct 90 ms 19780 KB Output is correct
50 Correct 86 ms 19964 KB Output is correct
51 Correct 88 ms 19796 KB Output is correct
52 Correct 85 ms 19748 KB Output is correct
53 Correct 2078 ms 101424 KB Output is correct
54 Correct 2154 ms 97740 KB Output is correct
55 Correct 2146 ms 97620 KB Output is correct
56 Correct 1875 ms 102948 KB Output is correct
57 Correct 2028 ms 100272 KB Output is correct
58 Correct 1792 ms 96788 KB Output is correct
59 Correct 1796 ms 96796 KB Output is correct
60 Correct 1787 ms 96680 KB Output is correct
61 Correct 2047 ms 100308 KB Output is correct
62 Correct 2127 ms 104240 KB Output is correct
63 Correct 2113 ms 104308 KB Output is correct
64 Correct 2234 ms 100352 KB Output is correct
65 Correct 2035 ms 100300 KB Output is correct
66 Correct 8 ms 12092 KB Output is correct
67 Correct 8 ms 11980 KB Output is correct
68 Correct 8 ms 12108 KB Output is correct
69 Correct 29 ms 13620 KB Output is correct
70 Correct 99 ms 20312 KB Output is correct
71 Correct 92 ms 19780 KB Output is correct
72 Correct 90 ms 19860 KB Output is correct
73 Correct 11 ms 12108 KB Output is correct
74 Correct 87 ms 19800 KB Output is correct
75 Correct 84 ms 19780 KB Output is correct
76 Correct 93 ms 19776 KB Output is correct
77 Correct 82 ms 19724 KB Output is correct
78 Correct 114 ms 19852 KB Output is correct
79 Correct 85 ms 19820 KB Output is correct
80 Correct 86 ms 19772 KB Output is correct
81 Correct 2037 ms 100716 KB Output is correct
82 Correct 1929 ms 104656 KB Output is correct
83 Correct 1778 ms 100288 KB Output is correct
84 Correct 1436 ms 104580 KB Output is correct
85 Correct 1815 ms 96300 KB Output is correct
86 Correct 1841 ms 98396 KB Output is correct
87 Correct 2151 ms 104636 KB Output is correct
88 Correct 2062 ms 101336 KB Output is correct
89 Correct 2196 ms 97652 KB Output is correct
90 Correct 2188 ms 97552 KB Output is correct
91 Correct 1908 ms 102864 KB Output is correct
92 Correct 2033 ms 100428 KB Output is correct
93 Correct 1807 ms 96676 KB Output is correct
94 Correct 1840 ms 96620 KB Output is correct
95 Correct 1803 ms 96844 KB Output is correct
96 Correct 2072 ms 100188 KB Output is correct
97 Correct 2156 ms 104140 KB Output is correct
98 Correct 2132 ms 104180 KB Output is correct
99 Correct 2204 ms 100264 KB Output is correct
100 Correct 2052 ms 100208 KB Output is correct
101 Correct 2072 ms 101276 KB Output is correct
102 Correct 1919 ms 103032 KB Output is correct
103 Correct 2062 ms 100324 KB Output is correct
104 Correct 1888 ms 99036 KB Output is correct
105 Correct 2045 ms 100632 KB Output is correct
106 Correct 2314 ms 100072 KB Output is correct
107 Correct 2077 ms 100436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13520 KB Output is correct
2 Correct 96 ms 20596 KB Output is correct
3 Correct 83 ms 19768 KB Output is correct
4 Correct 97 ms 19908 KB Output is correct
5 Correct 10 ms 12108 KB Output is correct
6 Correct 88 ms 19788 KB Output is correct
7 Correct 28 ms 13624 KB Output is correct
8 Correct 94 ms 20352 KB Output is correct
9 Correct 105 ms 19824 KB Output is correct
10 Correct 95 ms 19940 KB Output is correct
11 Correct 10 ms 12108 KB Output is correct
12 Correct 85 ms 19704 KB Output is correct
13 Correct 88 ms 19772 KB Output is correct
14 Correct 83 ms 19908 KB Output is correct
15 Correct 76 ms 19616 KB Output is correct
16 Correct 88 ms 19936 KB Output is correct
17 Correct 119 ms 19720 KB Output is correct
18 Correct 93 ms 19752 KB Output is correct
19 Correct 28 ms 13612 KB Output is correct
20 Correct 93 ms 20348 KB Output is correct
21 Correct 89 ms 19832 KB Output is correct
22 Correct 112 ms 19908 KB Output is correct
23 Correct 11 ms 12108 KB Output is correct
24 Correct 88 ms 19820 KB Output is correct
25 Correct 81 ms 19772 KB Output is correct
26 Correct 82 ms 19780 KB Output is correct
27 Correct 88 ms 19864 KB Output is correct
28 Correct 98 ms 19872 KB Output is correct
29 Correct 84 ms 19776 KB Output is correct
30 Correct 84 ms 19780 KB Output is correct
31 Correct 2013 ms 100580 KB Output is correct
32 Correct 1949 ms 104648 KB Output is correct
33 Correct 1846 ms 100364 KB Output is correct
34 Correct 1446 ms 104456 KB Output is correct
35 Correct 1802 ms 96444 KB Output is correct
36 Correct 1758 ms 98316 KB Output is correct
37 Correct 2107 ms 104656 KB Output is correct
38 Correct 29 ms 13624 KB Output is correct
39 Correct 93 ms 20340 KB Output is correct
40 Correct 99 ms 19776 KB Output is correct
41 Correct 110 ms 20036 KB Output is correct
42 Correct 11 ms 12108 KB Output is correct
43 Correct 88 ms 19708 KB Output is correct
44 Correct 83 ms 19796 KB Output is correct
45 Correct 79 ms 19788 KB Output is correct
46 Correct 79 ms 19652 KB Output is correct
47 Correct 94 ms 19896 KB Output is correct
48 Correct 82 ms 19796 KB Output is correct
49 Correct 85 ms 19796 KB Output is correct
50 Correct 2020 ms 100512 KB Output is correct
51 Correct 1907 ms 104712 KB Output is correct
52 Correct 1725 ms 100412 KB Output is correct
53 Correct 1403 ms 104460 KB Output is correct
54 Correct 1769 ms 96476 KB Output is correct
55 Correct 1776 ms 98324 KB Output is correct
56 Correct 2108 ms 104572 KB Output is correct
57 Correct 2746 ms 109220 KB Output is correct
58 Correct 3349 ms 119488 KB Output is correct
59 Correct 2672 ms 109684 KB Output is correct
60 Correct 1390 ms 95600 KB Output is correct
61 Correct 2737 ms 109724 KB Output is correct
62 Correct 2520 ms 102232 KB Output is correct
63 Correct 8 ms 12000 KB Output is correct
64 Correct 7 ms 11980 KB Output is correct
65 Correct 8 ms 11984 KB Output is correct
66 Correct 27 ms 13640 KB Output is correct
67 Correct 91 ms 20288 KB Output is correct
68 Correct 103 ms 19936 KB Output is correct
69 Correct 89 ms 19920 KB Output is correct
70 Correct 11 ms 12160 KB Output is correct
71 Correct 87 ms 19700 KB Output is correct
72 Correct 82 ms 19780 KB Output is correct
73 Correct 85 ms 19668 KB Output is correct
74 Correct 90 ms 19780 KB Output is correct
75 Correct 86 ms 19964 KB Output is correct
76 Correct 88 ms 19796 KB Output is correct
77 Correct 85 ms 19748 KB Output is correct
78 Correct 2078 ms 101424 KB Output is correct
79 Correct 2154 ms 97740 KB Output is correct
80 Correct 2146 ms 97620 KB Output is correct
81 Correct 1875 ms 102948 KB Output is correct
82 Correct 2028 ms 100272 KB Output is correct
83 Correct 1792 ms 96788 KB Output is correct
84 Correct 1796 ms 96796 KB Output is correct
85 Correct 1787 ms 96680 KB Output is correct
86 Correct 2047 ms 100308 KB Output is correct
87 Correct 2127 ms 104240 KB Output is correct
88 Correct 2113 ms 104308 KB Output is correct
89 Correct 2234 ms 100352 KB Output is correct
90 Correct 2035 ms 100300 KB Output is correct
91 Correct 8 ms 12092 KB Output is correct
92 Correct 8 ms 11980 KB Output is correct
93 Correct 8 ms 12108 KB Output is correct
94 Correct 29 ms 13620 KB Output is correct
95 Correct 99 ms 20312 KB Output is correct
96 Correct 92 ms 19780 KB Output is correct
97 Correct 90 ms 19860 KB Output is correct
98 Correct 11 ms 12108 KB Output is correct
99 Correct 87 ms 19800 KB Output is correct
100 Correct 84 ms 19780 KB Output is correct
101 Correct 93 ms 19776 KB Output is correct
102 Correct 82 ms 19724 KB Output is correct
103 Correct 114 ms 19852 KB Output is correct
104 Correct 85 ms 19820 KB Output is correct
105 Correct 86 ms 19772 KB Output is correct
106 Correct 2037 ms 100716 KB Output is correct
107 Correct 1929 ms 104656 KB Output is correct
108 Correct 1778 ms 100288 KB Output is correct
109 Correct 1436 ms 104580 KB Output is correct
110 Correct 1815 ms 96300 KB Output is correct
111 Correct 1841 ms 98396 KB Output is correct
112 Correct 2151 ms 104636 KB Output is correct
113 Correct 2062 ms 101336 KB Output is correct
114 Correct 2196 ms 97652 KB Output is correct
115 Correct 2188 ms 97552 KB Output is correct
116 Correct 1908 ms 102864 KB Output is correct
117 Correct 2033 ms 100428 KB Output is correct
118 Correct 1807 ms 96676 KB Output is correct
119 Correct 1840 ms 96620 KB Output is correct
120 Correct 1803 ms 96844 KB Output is correct
121 Correct 2072 ms 100188 KB Output is correct
122 Correct 2156 ms 104140 KB Output is correct
123 Correct 2132 ms 104180 KB Output is correct
124 Correct 2204 ms 100264 KB Output is correct
125 Correct 2052 ms 100208 KB Output is correct
126 Correct 2072 ms 101276 KB Output is correct
127 Correct 1919 ms 103032 KB Output is correct
128 Correct 2062 ms 100324 KB Output is correct
129 Correct 1888 ms 99036 KB Output is correct
130 Correct 2045 ms 100632 KB Output is correct
131 Correct 2314 ms 100072 KB Output is correct
132 Correct 2077 ms 100436 KB Output is correct
133 Correct 8 ms 12084 KB Output is correct
134 Correct 8 ms 12112 KB Output is correct
135 Correct 8 ms 11980 KB Output is correct
136 Correct 28 ms 13516 KB Output is correct
137 Correct 98 ms 20340 KB Output is correct
138 Correct 90 ms 19780 KB Output is correct
139 Correct 95 ms 19908 KB Output is correct
140 Correct 11 ms 12176 KB Output is correct
141 Correct 91 ms 19768 KB Output is correct
142 Correct 92 ms 19780 KB Output is correct
143 Correct 97 ms 19688 KB Output is correct
144 Correct 88 ms 19668 KB Output is correct
145 Correct 117 ms 19876 KB Output is correct
146 Correct 87 ms 19816 KB Output is correct
147 Correct 102 ms 19696 KB Output is correct
148 Correct 2047 ms 100456 KB Output is correct
149 Correct 1944 ms 104812 KB Output is correct
150 Correct 1836 ms 100412 KB Output is correct
151 Correct 1458 ms 104256 KB Output is correct
152 Correct 1823 ms 95988 KB Output is correct
153 Correct 1829 ms 98240 KB Output is correct
154 Correct 2161 ms 104520 KB Output is correct
155 Correct 2857 ms 108976 KB Output is correct
156 Correct 3291 ms 118832 KB Output is correct
157 Correct 2797 ms 109456 KB Output is correct
158 Correct 1427 ms 95568 KB Output is correct
159 Correct 2798 ms 109728 KB Output is correct
160 Correct 2589 ms 102336 KB Output is correct
161 Correct 2092 ms 101400 KB Output is correct
162 Correct 2190 ms 97612 KB Output is correct
163 Correct 2188 ms 97512 KB Output is correct
164 Correct 1901 ms 102680 KB Output is correct
165 Correct 2020 ms 100444 KB Output is correct
166 Correct 1798 ms 96676 KB Output is correct
167 Correct 1818 ms 96800 KB Output is correct
168 Correct 1807 ms 96580 KB Output is correct
169 Correct 2055 ms 100176 KB Output is correct
170 Correct 2166 ms 103900 KB Output is correct
171 Correct 2169 ms 103880 KB Output is correct
172 Correct 2259 ms 99760 KB Output is correct
173 Correct 2135 ms 99920 KB Output is correct
174 Correct 2164 ms 100952 KB Output is correct
175 Correct 2005 ms 102476 KB Output is correct
176 Correct 2092 ms 100160 KB Output is correct
177 Correct 1933 ms 98748 KB Output is correct
178 Correct 2176 ms 100076 KB Output is correct
179 Correct 2228 ms 99560 KB Output is correct
180 Correct 2080 ms 99996 KB Output is correct
181 Correct 2133 ms 101152 KB Output is correct
182 Correct 2113 ms 103744 KB Output is correct
183 Correct 2938 ms 109268 KB Output is correct
184 Correct 2813 ms 112860 KB Output is correct
185 Correct 2745 ms 104268 KB Output is correct
186 Correct 2290 ms 99988 KB Output is correct
187 Correct 1866 ms 95708 KB Output is correct