Submission #630707

# Submission time Handle Problem Language Result Execution time Memory
630707 2022-08-16T23:52:44 Z SorahISA Duathlon (APIO18_duathlon) C++17
100 / 100
131 ms 29316 KB
#ifdef local
#define _GLIBCXX_DEBUG 1
#endif
#pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
using namespace std;

#define int int64_t
#define double long double
using pii = pair<int, int>;
template <typename T>
using Prior = std::priority_queue<T>;
template <typename T>
using prior = std::priority_queue<T, vector<T>, greater<T>>;

// #define X first
// #define Y second
#define eb emplace_back
#define ef emplace_front
#define ee emplace
#define pb pop_back
#define pf pop_front
#define ALL(x) begin(x), end(x)
#define RALL(x) rbegin(x), rend(x)
#define SZ(x) ((int)(x).size())

#ifdef local
#define fastIO() void()
#define debug(...) \
    _color.eb("\u001b[31m"),\
    cerr << _color.back() << "At [" << __FUNCTION__ << "], line " << __LINE__ << ": ",\
    cerr << "(" << #__VA_ARGS__ << ") = ", _do(__VA_ARGS__),\
    _color.pb(),\
    cerr << _color.back()
deque<string> _color{"\u001b[0m"};

template <typename T> concept is_string = is_same_v<T, string&> or is_same_v<T, const string&>;
template <typename T> concept is_iterable = requires (T _t) {begin(_t);};

template <typename T> inline void _print_err(T &&_t) {cerr << _t;}
template <typename T> inline void _print_err(T &&_t) requires is_iterable<T> and (not is_string<T>) {
    string _tmp_color = _color.back();
    ++_tmp_color[3], _color.eb(_tmp_color);
    cerr << _color.back() << "[";
    for (bool _first = true; auto &_x : _t) {
        if (!_first) cerr << ", ";
        _print_err(_x), _first = false;
    }
    cerr << "]" << (_color.pb(), _color.back());
}

template <typename T, typename U> ostream& operator << (ostream &os, pair<T, U> &_tu) {
    string _tmp_color = _color.back();
    ++_tmp_color[3], _color.eb(_tmp_color);
    cerr << _color.back() << "(";
    _print_err(_tu.first), cerr << ", ", _print_err(_tu.second);
    cerr << ")" << (_color.pb(), _color.back());
    return os;
}

template <size_t I = 0, typename ...U> inline typename enable_if<I == sizeof...(U), void>::type _print_err(tuple<U...> &) {
    cerr << ")" << (_color.pb(), _color.back());
}

template <size_t I = 0, typename ...U> inline typename enable_if<I <  sizeof...(U), void>::type _print_err(tuple<U...> &_t) {
    if (!I) {
        string _tmp_color = _color.back();
        ++_tmp_color[3], _color.eb(_tmp_color);
        cerr << _color.back();
    }
    cerr << (I ? ", " : "("), _print_err(get<I>(_t)), _print_err<I+1, U...>(_t);
}

template <typename T> inline void _do(T &&_t) {_print_err(_t), cerr << "\n";}
template <typename T, typename ...U> inline void _do(T &&_t, U &&..._u) {_print_err(_t), cerr << ", ", _do(_u...);}
#else
#define fastIO() ios_base::sync_with_stdio(0), cin.tie(0)
#define debug(...) void()
#endif

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

inline int getRand(int L, int R) {
    if (L > R) swap(L, R);
    return (int)(rng() % ((uint64_t)R - L + 1) + L);
}

template <typename T, typename U> bool chmin(T &lhs, U rhs) {return lhs > rhs ? lhs = rhs, 1 : 0;}
template <typename T, typename U> bool chmax(T &lhs, U rhs) {return lhs < rhs ? lhs = rhs, 1 : 0;}

const int maxn = 1E5 + 5;

vector<int> adj[maxn], dfn, low;
vector<int> bct[2*maxn];
deque<int> stk;

void Tarjan(int now, int &tok_dfn, int &tok_bcc) {
    dfn[now] = low[now] = tok_dfn++;
    stk.eb(now);
    for (int x : adj[now]) {
        if (!~dfn[x]) {
            Tarjan(x, tok_dfn, tok_bcc);
            chmin(low[now], low[x]);
            // debug(now, x, dfn[now], low[x], stk);
            if (low[x] >= dfn[now]) {
                int p;
                while ((p = stk.back()) != x) {
                    bct[p].eb(tok_bcc), bct[tok_bcc].eb(p), stk.pb();
                }
                bct[p].eb(tok_bcc), bct[tok_bcc].eb(p), stk.pb();
                bct[now].eb(tok_bcc), bct[tok_bcc].eb(now);
                ++tok_bcc;
            }
        }
        chmin(low[now], dfn[x]);
    }
    // debug(now, dfn[now], low[now]);
}

void solve() {
    int N, M; cin >> N >> M;
    
    for (int i = 0, u, v; i < M; ++i) {
        cin >> u >> v, --u, --v;
        adj[u].eb(v), adj[v].eb(u);
    }
    
    dfn.assign(N, -1), low.resize(N);
    
    int tok_bcc = N;
    for (int i = 0, tok_dfn = 0; i < N; ++i) {
        if (!~dfn[i]) stk.clear(), Tarjan(i, tok_dfn, tok_bcc);
    }
    
    // for (int i = N; i < tok_bcc; ++i) debug(i, bct[i]);
    
    /// calculate answer in Block-Cut Tree ///
    
    vector<int> vis(tok_bcc, 0), sz(tok_bcc, 0);
    
    int ans = 0;
    for (int i = 0; i < N; ++i) {
        if (vis[i]) continue;
        
        auto get_sz_ = [&](auto &&get_sz, int now, int fa) -> void {
            vis[now] = true, sz[now] = (now < N);
            for (int x : bct[now]) {
                if (x == fa) continue;
                get_sz(get_sz, x, now), sz[now] += sz[x];
            }
        };
        get_sz_(get_sz_, i, -1);
        
        int sz_all = sz[i];
        ans += sz_all * (sz_all - 1) * (sz_all - 2);
        
        auto dfs_ = [&](auto &&dfs, int now, int fa) -> void {
            for (int x : bct[now]) {
                if (x == fa) continue;
                dfs(dfs, x, now);
                if (now >= N) ans -= (SZ(bct[now]) - 1) * sz[x] * (sz[x] - 1);
            }
            if (now >= N) ans -= (SZ(bct[now]) - 1) * (sz_all - sz[now]) * (sz_all - sz[now] - 1);
        };
        dfs_(dfs_, i, -1);
    }
    cout << ans << "\n";
}

int32_t main() {
    fastIO();
    
    int t = 1; // cin >> t;
    for (int _ = 1; _ <= t; ++_) {
        // cout << "Case #" << _ << ": ";
        solve();
    }
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7372 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7376 KB Output is correct
4 Correct 4 ms 7336 KB Output is correct
5 Correct 4 ms 7368 KB Output is correct
6 Correct 4 ms 7368 KB Output is correct
7 Correct 5 ms 7380 KB Output is correct
8 Correct 4 ms 7372 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7372 KB Output is correct
12 Correct 5 ms 7252 KB Output is correct
13 Correct 5 ms 7252 KB Output is correct
14 Correct 5 ms 7252 KB Output is correct
15 Correct 4 ms 7252 KB Output is correct
16 Correct 5 ms 7368 KB Output is correct
17 Correct 4 ms 7252 KB Output is correct
18 Correct 4 ms 7252 KB Output is correct
19 Correct 4 ms 7288 KB Output is correct
20 Correct 4 ms 7252 KB Output is correct
21 Correct 4 ms 7368 KB Output is correct
22 Correct 4 ms 7380 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 5 ms 7252 KB Output is correct
25 Correct 4 ms 7252 KB Output is correct
26 Correct 4 ms 7372 KB Output is correct
27 Correct 6 ms 7252 KB Output is correct
28 Correct 5 ms 7380 KB Output is correct
29 Correct 5 ms 7380 KB Output is correct
30 Correct 4 ms 7348 KB Output is correct
31 Correct 4 ms 7252 KB Output is correct
32 Correct 4 ms 7252 KB Output is correct
33 Correct 4 ms 7252 KB Output is correct
34 Correct 6 ms 7252 KB Output is correct
35 Correct 4 ms 7252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7372 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7376 KB Output is correct
4 Correct 4 ms 7336 KB Output is correct
5 Correct 4 ms 7368 KB Output is correct
6 Correct 4 ms 7368 KB Output is correct
7 Correct 5 ms 7380 KB Output is correct
8 Correct 4 ms 7372 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7372 KB Output is correct
12 Correct 5 ms 7252 KB Output is correct
13 Correct 5 ms 7252 KB Output is correct
14 Correct 5 ms 7252 KB Output is correct
15 Correct 4 ms 7252 KB Output is correct
16 Correct 5 ms 7368 KB Output is correct
17 Correct 4 ms 7252 KB Output is correct
18 Correct 4 ms 7252 KB Output is correct
19 Correct 4 ms 7288 KB Output is correct
20 Correct 4 ms 7252 KB Output is correct
21 Correct 4 ms 7368 KB Output is correct
22 Correct 4 ms 7380 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 5 ms 7252 KB Output is correct
25 Correct 4 ms 7252 KB Output is correct
26 Correct 4 ms 7372 KB Output is correct
27 Correct 6 ms 7252 KB Output is correct
28 Correct 5 ms 7380 KB Output is correct
29 Correct 5 ms 7380 KB Output is correct
30 Correct 4 ms 7348 KB Output is correct
31 Correct 4 ms 7252 KB Output is correct
32 Correct 4 ms 7252 KB Output is correct
33 Correct 4 ms 7252 KB Output is correct
34 Correct 6 ms 7252 KB Output is correct
35 Correct 4 ms 7252 KB Output is correct
36 Correct 4 ms 7252 KB Output is correct
37 Correct 4 ms 7380 KB Output is correct
38 Correct 4 ms 7368 KB Output is correct
39 Correct 4 ms 7376 KB Output is correct
40 Correct 5 ms 7252 KB Output is correct
41 Correct 5 ms 7380 KB Output is correct
42 Correct 5 ms 7372 KB Output is correct
43 Correct 4 ms 7252 KB Output is correct
44 Correct 5 ms 7372 KB Output is correct
45 Correct 5 ms 7376 KB Output is correct
46 Correct 4 ms 7380 KB Output is correct
47 Correct 4 ms 7252 KB Output is correct
48 Correct 4 ms 7368 KB Output is correct
49 Correct 4 ms 7252 KB Output is correct
50 Correct 4 ms 7252 KB Output is correct
51 Correct 4 ms 7368 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 4 ms 7252 KB Output is correct
55 Correct 5 ms 7380 KB Output is correct
56 Correct 4 ms 7316 KB Output is correct
57 Correct 5 ms 7380 KB Output is correct
58 Correct 5 ms 7372 KB Output is correct
59 Correct 4 ms 7376 KB Output is correct
60 Correct 6 ms 7368 KB Output is correct
61 Correct 5 ms 7380 KB Output is correct
62 Correct 4 ms 7372 KB Output is correct
63 Correct 4 ms 7376 KB Output is correct
64 Correct 4 ms 7376 KB Output is correct
65 Correct 4 ms 7252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 75 ms 28764 KB Output is correct
2 Correct 73 ms 28724 KB Output is correct
3 Correct 89 ms 25288 KB Output is correct
4 Correct 74 ms 27924 KB Output is correct
5 Correct 92 ms 23816 KB Output is correct
6 Correct 95 ms 24564 KB Output is correct
7 Correct 82 ms 23324 KB Output is correct
8 Correct 83 ms 24176 KB Output is correct
9 Correct 85 ms 22172 KB Output is correct
10 Correct 79 ms 22856 KB Output is correct
11 Correct 64 ms 20288 KB Output is correct
12 Correct 66 ms 19996 KB Output is correct
13 Correct 59 ms 19828 KB Output is correct
14 Correct 71 ms 19604 KB Output is correct
15 Correct 47 ms 18340 KB Output is correct
16 Correct 48 ms 18068 KB Output is correct
17 Correct 7 ms 10452 KB Output is correct
18 Correct 7 ms 10452 KB Output is correct
19 Correct 8 ms 10452 KB Output is correct
20 Correct 7 ms 10452 KB Output is correct
21 Correct 7 ms 10452 KB Output is correct
22 Correct 7 ms 10452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7508 KB Output is correct
2 Correct 5 ms 7508 KB Output is correct
3 Correct 5 ms 7508 KB Output is correct
4 Correct 5 ms 7576 KB Output is correct
5 Correct 5 ms 7508 KB Output is correct
6 Correct 6 ms 7508 KB Output is correct
7 Correct 5 ms 7508 KB Output is correct
8 Correct 5 ms 7504 KB Output is correct
9 Correct 5 ms 7508 KB Output is correct
10 Correct 5 ms 7508 KB Output is correct
11 Correct 5 ms 7512 KB Output is correct
12 Correct 5 ms 7508 KB Output is correct
13 Correct 5 ms 7504 KB Output is correct
14 Correct 5 ms 7508 KB Output is correct
15 Correct 5 ms 7508 KB Output is correct
16 Correct 5 ms 7376 KB Output is correct
17 Correct 5 ms 7508 KB Output is correct
18 Correct 5 ms 7508 KB Output is correct
19 Correct 5 ms 7508 KB Output is correct
20 Correct 5 ms 7500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 22916 KB Output is correct
2 Correct 100 ms 23884 KB Output is correct
3 Correct 95 ms 23916 KB Output is correct
4 Correct 93 ms 23896 KB Output is correct
5 Correct 101 ms 23812 KB Output is correct
6 Correct 98 ms 28620 KB Output is correct
7 Correct 106 ms 27392 KB Output is correct
8 Correct 131 ms 26472 KB Output is correct
9 Correct 103 ms 25568 KB Output is correct
10 Correct 95 ms 23912 KB Output is correct
11 Correct 91 ms 23940 KB Output is correct
12 Correct 90 ms 23800 KB Output is correct
13 Correct 118 ms 23932 KB Output is correct
14 Correct 80 ms 22884 KB Output is correct
15 Correct 80 ms 21808 KB Output is correct
16 Correct 46 ms 18180 KB Output is correct
17 Correct 74 ms 24300 KB Output is correct
18 Correct 66 ms 24284 KB Output is correct
19 Correct 63 ms 24492 KB Output is correct
20 Correct 63 ms 24288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 7576 KB Output is correct
2 Correct 5 ms 7508 KB Output is correct
3 Correct 5 ms 7508 KB Output is correct
4 Correct 5 ms 7508 KB Output is correct
5 Correct 5 ms 7508 KB Output is correct
6 Correct 6 ms 7508 KB Output is correct
7 Correct 5 ms 7376 KB Output is correct
8 Correct 5 ms 7380 KB Output is correct
9 Correct 5 ms 7380 KB Output is correct
10 Correct 4 ms 7380 KB Output is correct
11 Correct 5 ms 7392 KB Output is correct
12 Correct 5 ms 7508 KB Output is correct
13 Correct 5 ms 7508 KB Output is correct
14 Correct 5 ms 7508 KB Output is correct
15 Correct 5 ms 7544 KB Output is correct
16 Correct 5 ms 7500 KB Output is correct
17 Correct 5 ms 7508 KB Output is correct
18 Correct 6 ms 7508 KB Output is correct
19 Correct 6 ms 7504 KB Output is correct
20 Correct 5 ms 7380 KB Output is correct
21 Correct 4 ms 7508 KB Output is correct
22 Correct 5 ms 7508 KB Output is correct
23 Correct 5 ms 7508 KB Output is correct
24 Correct 5 ms 7508 KB Output is correct
25 Correct 5 ms 7380 KB Output is correct
26 Correct 4 ms 7380 KB Output is correct
27 Correct 4 ms 7380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 23036 KB Output is correct
2 Correct 109 ms 23644 KB Output is correct
3 Correct 111 ms 23424 KB Output is correct
4 Correct 113 ms 22400 KB Output is correct
5 Correct 106 ms 21128 KB Output is correct
6 Correct 84 ms 20516 KB Output is correct
7 Correct 100 ms 20280 KB Output is correct
8 Correct 80 ms 19764 KB Output is correct
9 Correct 96 ms 19748 KB Output is correct
10 Correct 74 ms 19552 KB Output is correct
11 Correct 74 ms 19368 KB Output is correct
12 Correct 81 ms 19440 KB Output is correct
13 Correct 69 ms 19556 KB Output is correct
14 Correct 74 ms 21868 KB Output is correct
15 Correct 122 ms 27624 KB Output is correct
16 Correct 108 ms 26300 KB Output is correct
17 Correct 120 ms 26956 KB Output is correct
18 Correct 118 ms 25524 KB Output is correct
19 Correct 99 ms 22368 KB Output is correct
20 Correct 95 ms 22460 KB Output is correct
21 Correct 100 ms 22384 KB Output is correct
22 Correct 88 ms 21392 KB Output is correct
23 Correct 72 ms 20428 KB Output is correct
24 Correct 83 ms 23464 KB Output is correct
25 Correct 93 ms 23500 KB Output is correct
26 Correct 96 ms 22824 KB Output is correct
27 Correct 93 ms 22744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7372 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7376 KB Output is correct
4 Correct 4 ms 7336 KB Output is correct
5 Correct 4 ms 7368 KB Output is correct
6 Correct 4 ms 7368 KB Output is correct
7 Correct 5 ms 7380 KB Output is correct
8 Correct 4 ms 7372 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7372 KB Output is correct
12 Correct 5 ms 7252 KB Output is correct
13 Correct 5 ms 7252 KB Output is correct
14 Correct 5 ms 7252 KB Output is correct
15 Correct 4 ms 7252 KB Output is correct
16 Correct 5 ms 7368 KB Output is correct
17 Correct 4 ms 7252 KB Output is correct
18 Correct 4 ms 7252 KB Output is correct
19 Correct 4 ms 7288 KB Output is correct
20 Correct 4 ms 7252 KB Output is correct
21 Correct 4 ms 7368 KB Output is correct
22 Correct 4 ms 7380 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 5 ms 7252 KB Output is correct
25 Correct 4 ms 7252 KB Output is correct
26 Correct 4 ms 7372 KB Output is correct
27 Correct 6 ms 7252 KB Output is correct
28 Correct 5 ms 7380 KB Output is correct
29 Correct 5 ms 7380 KB Output is correct
30 Correct 4 ms 7348 KB Output is correct
31 Correct 4 ms 7252 KB Output is correct
32 Correct 4 ms 7252 KB Output is correct
33 Correct 4 ms 7252 KB Output is correct
34 Correct 6 ms 7252 KB Output is correct
35 Correct 4 ms 7252 KB Output is correct
36 Correct 4 ms 7252 KB Output is correct
37 Correct 4 ms 7380 KB Output is correct
38 Correct 4 ms 7368 KB Output is correct
39 Correct 4 ms 7376 KB Output is correct
40 Correct 5 ms 7252 KB Output is correct
41 Correct 5 ms 7380 KB Output is correct
42 Correct 5 ms 7372 KB Output is correct
43 Correct 4 ms 7252 KB Output is correct
44 Correct 5 ms 7372 KB Output is correct
45 Correct 5 ms 7376 KB Output is correct
46 Correct 4 ms 7380 KB Output is correct
47 Correct 4 ms 7252 KB Output is correct
48 Correct 4 ms 7368 KB Output is correct
49 Correct 4 ms 7252 KB Output is correct
50 Correct 4 ms 7252 KB Output is correct
51 Correct 4 ms 7368 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 4 ms 7252 KB Output is correct
55 Correct 5 ms 7380 KB Output is correct
56 Correct 4 ms 7316 KB Output is correct
57 Correct 5 ms 7380 KB Output is correct
58 Correct 5 ms 7372 KB Output is correct
59 Correct 4 ms 7376 KB Output is correct
60 Correct 6 ms 7368 KB Output is correct
61 Correct 5 ms 7380 KB Output is correct
62 Correct 4 ms 7372 KB Output is correct
63 Correct 4 ms 7376 KB Output is correct
64 Correct 4 ms 7376 KB Output is correct
65 Correct 4 ms 7252 KB Output is correct
66 Correct 4 ms 7380 KB Output is correct
67 Correct 4 ms 7376 KB Output is correct
68 Correct 4 ms 7508 KB Output is correct
69 Correct 5 ms 7508 KB Output is correct
70 Correct 5 ms 7512 KB Output is correct
71 Correct 5 ms 7424 KB Output is correct
72 Correct 6 ms 7380 KB Output is correct
73 Correct 5 ms 7380 KB Output is correct
74 Correct 5 ms 7508 KB Output is correct
75 Correct 5 ms 7508 KB Output is correct
76 Correct 4 ms 7380 KB Output is correct
77 Correct 5 ms 7504 KB Output is correct
78 Correct 5 ms 7508 KB Output is correct
79 Correct 5 ms 7376 KB Output is correct
80 Correct 5 ms 7380 KB Output is correct
81 Correct 5 ms 7380 KB Output is correct
82 Correct 5 ms 7508 KB Output is correct
83 Correct 5 ms 7504 KB Output is correct
84 Correct 5 ms 7504 KB Output is correct
85 Correct 5 ms 7508 KB Output is correct
86 Correct 5 ms 7508 KB Output is correct
87 Correct 5 ms 7508 KB Output is correct
88 Correct 5 ms 7508 KB Output is correct
89 Correct 4 ms 7380 KB Output is correct
90 Correct 5 ms 7380 KB Output is correct
91 Correct 5 ms 7508 KB Output is correct
92 Correct 5 ms 7508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7372 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7376 KB Output is correct
4 Correct 4 ms 7336 KB Output is correct
5 Correct 4 ms 7368 KB Output is correct
6 Correct 4 ms 7368 KB Output is correct
7 Correct 5 ms 7380 KB Output is correct
8 Correct 4 ms 7372 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7372 KB Output is correct
12 Correct 5 ms 7252 KB Output is correct
13 Correct 5 ms 7252 KB Output is correct
14 Correct 5 ms 7252 KB Output is correct
15 Correct 4 ms 7252 KB Output is correct
16 Correct 5 ms 7368 KB Output is correct
17 Correct 4 ms 7252 KB Output is correct
18 Correct 4 ms 7252 KB Output is correct
19 Correct 4 ms 7288 KB Output is correct
20 Correct 4 ms 7252 KB Output is correct
21 Correct 4 ms 7368 KB Output is correct
22 Correct 4 ms 7380 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 5 ms 7252 KB Output is correct
25 Correct 4 ms 7252 KB Output is correct
26 Correct 4 ms 7372 KB Output is correct
27 Correct 6 ms 7252 KB Output is correct
28 Correct 5 ms 7380 KB Output is correct
29 Correct 5 ms 7380 KB Output is correct
30 Correct 4 ms 7348 KB Output is correct
31 Correct 4 ms 7252 KB Output is correct
32 Correct 4 ms 7252 KB Output is correct
33 Correct 4 ms 7252 KB Output is correct
34 Correct 6 ms 7252 KB Output is correct
35 Correct 4 ms 7252 KB Output is correct
36 Correct 4 ms 7252 KB Output is correct
37 Correct 4 ms 7380 KB Output is correct
38 Correct 4 ms 7368 KB Output is correct
39 Correct 4 ms 7376 KB Output is correct
40 Correct 5 ms 7252 KB Output is correct
41 Correct 5 ms 7380 KB Output is correct
42 Correct 5 ms 7372 KB Output is correct
43 Correct 4 ms 7252 KB Output is correct
44 Correct 5 ms 7372 KB Output is correct
45 Correct 5 ms 7376 KB Output is correct
46 Correct 4 ms 7380 KB Output is correct
47 Correct 4 ms 7252 KB Output is correct
48 Correct 4 ms 7368 KB Output is correct
49 Correct 4 ms 7252 KB Output is correct
50 Correct 4 ms 7252 KB Output is correct
51 Correct 4 ms 7368 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 4 ms 7252 KB Output is correct
55 Correct 5 ms 7380 KB Output is correct
56 Correct 4 ms 7316 KB Output is correct
57 Correct 5 ms 7380 KB Output is correct
58 Correct 5 ms 7372 KB Output is correct
59 Correct 4 ms 7376 KB Output is correct
60 Correct 6 ms 7368 KB Output is correct
61 Correct 5 ms 7380 KB Output is correct
62 Correct 4 ms 7372 KB Output is correct
63 Correct 4 ms 7376 KB Output is correct
64 Correct 4 ms 7376 KB Output is correct
65 Correct 4 ms 7252 KB Output is correct
66 Correct 75 ms 28764 KB Output is correct
67 Correct 73 ms 28724 KB Output is correct
68 Correct 89 ms 25288 KB Output is correct
69 Correct 74 ms 27924 KB Output is correct
70 Correct 92 ms 23816 KB Output is correct
71 Correct 95 ms 24564 KB Output is correct
72 Correct 82 ms 23324 KB Output is correct
73 Correct 83 ms 24176 KB Output is correct
74 Correct 85 ms 22172 KB Output is correct
75 Correct 79 ms 22856 KB Output is correct
76 Correct 64 ms 20288 KB Output is correct
77 Correct 66 ms 19996 KB Output is correct
78 Correct 59 ms 19828 KB Output is correct
79 Correct 71 ms 19604 KB Output is correct
80 Correct 47 ms 18340 KB Output is correct
81 Correct 48 ms 18068 KB Output is correct
82 Correct 7 ms 10452 KB Output is correct
83 Correct 7 ms 10452 KB Output is correct
84 Correct 8 ms 10452 KB Output is correct
85 Correct 7 ms 10452 KB Output is correct
86 Correct 7 ms 10452 KB Output is correct
87 Correct 7 ms 10452 KB Output is correct
88 Correct 5 ms 7508 KB Output is correct
89 Correct 5 ms 7508 KB Output is correct
90 Correct 5 ms 7508 KB Output is correct
91 Correct 5 ms 7576 KB Output is correct
92 Correct 5 ms 7508 KB Output is correct
93 Correct 6 ms 7508 KB Output is correct
94 Correct 5 ms 7508 KB Output is correct
95 Correct 5 ms 7504 KB Output is correct
96 Correct 5 ms 7508 KB Output is correct
97 Correct 5 ms 7508 KB Output is correct
98 Correct 5 ms 7512 KB Output is correct
99 Correct 5 ms 7508 KB Output is correct
100 Correct 5 ms 7504 KB Output is correct
101 Correct 5 ms 7508 KB Output is correct
102 Correct 5 ms 7508 KB Output is correct
103 Correct 5 ms 7376 KB Output is correct
104 Correct 5 ms 7508 KB Output is correct
105 Correct 5 ms 7508 KB Output is correct
106 Correct 5 ms 7508 KB Output is correct
107 Correct 5 ms 7500 KB Output is correct
108 Correct 113 ms 22916 KB Output is correct
109 Correct 100 ms 23884 KB Output is correct
110 Correct 95 ms 23916 KB Output is correct
111 Correct 93 ms 23896 KB Output is correct
112 Correct 101 ms 23812 KB Output is correct
113 Correct 98 ms 28620 KB Output is correct
114 Correct 106 ms 27392 KB Output is correct
115 Correct 131 ms 26472 KB Output is correct
116 Correct 103 ms 25568 KB Output is correct
117 Correct 95 ms 23912 KB Output is correct
118 Correct 91 ms 23940 KB Output is correct
119 Correct 90 ms 23800 KB Output is correct
120 Correct 118 ms 23932 KB Output is correct
121 Correct 80 ms 22884 KB Output is correct
122 Correct 80 ms 21808 KB Output is correct
123 Correct 46 ms 18180 KB Output is correct
124 Correct 74 ms 24300 KB Output is correct
125 Correct 66 ms 24284 KB Output is correct
126 Correct 63 ms 24492 KB Output is correct
127 Correct 63 ms 24288 KB Output is correct
128 Correct 6 ms 7576 KB Output is correct
129 Correct 5 ms 7508 KB Output is correct
130 Correct 5 ms 7508 KB Output is correct
131 Correct 5 ms 7508 KB Output is correct
132 Correct 5 ms 7508 KB Output is correct
133 Correct 6 ms 7508 KB Output is correct
134 Correct 5 ms 7376 KB Output is correct
135 Correct 5 ms 7380 KB Output is correct
136 Correct 5 ms 7380 KB Output is correct
137 Correct 4 ms 7380 KB Output is correct
138 Correct 5 ms 7392 KB Output is correct
139 Correct 5 ms 7508 KB Output is correct
140 Correct 5 ms 7508 KB Output is correct
141 Correct 5 ms 7508 KB Output is correct
142 Correct 5 ms 7544 KB Output is correct
143 Correct 5 ms 7500 KB Output is correct
144 Correct 5 ms 7508 KB Output is correct
145 Correct 6 ms 7508 KB Output is correct
146 Correct 6 ms 7504 KB Output is correct
147 Correct 5 ms 7380 KB Output is correct
148 Correct 4 ms 7508 KB Output is correct
149 Correct 5 ms 7508 KB Output is correct
150 Correct 5 ms 7508 KB Output is correct
151 Correct 5 ms 7508 KB Output is correct
152 Correct 5 ms 7380 KB Output is correct
153 Correct 4 ms 7380 KB Output is correct
154 Correct 4 ms 7380 KB Output is correct
155 Correct 94 ms 23036 KB Output is correct
156 Correct 109 ms 23644 KB Output is correct
157 Correct 111 ms 23424 KB Output is correct
158 Correct 113 ms 22400 KB Output is correct
159 Correct 106 ms 21128 KB Output is correct
160 Correct 84 ms 20516 KB Output is correct
161 Correct 100 ms 20280 KB Output is correct
162 Correct 80 ms 19764 KB Output is correct
163 Correct 96 ms 19748 KB Output is correct
164 Correct 74 ms 19552 KB Output is correct
165 Correct 74 ms 19368 KB Output is correct
166 Correct 81 ms 19440 KB Output is correct
167 Correct 69 ms 19556 KB Output is correct
168 Correct 74 ms 21868 KB Output is correct
169 Correct 122 ms 27624 KB Output is correct
170 Correct 108 ms 26300 KB Output is correct
171 Correct 120 ms 26956 KB Output is correct
172 Correct 118 ms 25524 KB Output is correct
173 Correct 99 ms 22368 KB Output is correct
174 Correct 95 ms 22460 KB Output is correct
175 Correct 100 ms 22384 KB Output is correct
176 Correct 88 ms 21392 KB Output is correct
177 Correct 72 ms 20428 KB Output is correct
178 Correct 83 ms 23464 KB Output is correct
179 Correct 93 ms 23500 KB Output is correct
180 Correct 96 ms 22824 KB Output is correct
181 Correct 93 ms 22744 KB Output is correct
182 Correct 4 ms 7380 KB Output is correct
183 Correct 4 ms 7376 KB Output is correct
184 Correct 4 ms 7508 KB Output is correct
185 Correct 5 ms 7508 KB Output is correct
186 Correct 5 ms 7512 KB Output is correct
187 Correct 5 ms 7424 KB Output is correct
188 Correct 6 ms 7380 KB Output is correct
189 Correct 5 ms 7380 KB Output is correct
190 Correct 5 ms 7508 KB Output is correct
191 Correct 5 ms 7508 KB Output is correct
192 Correct 4 ms 7380 KB Output is correct
193 Correct 5 ms 7504 KB Output is correct
194 Correct 5 ms 7508 KB Output is correct
195 Correct 5 ms 7376 KB Output is correct
196 Correct 5 ms 7380 KB Output is correct
197 Correct 5 ms 7380 KB Output is correct
198 Correct 5 ms 7508 KB Output is correct
199 Correct 5 ms 7504 KB Output is correct
200 Correct 5 ms 7504 KB Output is correct
201 Correct 5 ms 7508 KB Output is correct
202 Correct 5 ms 7508 KB Output is correct
203 Correct 5 ms 7508 KB Output is correct
204 Correct 5 ms 7508 KB Output is correct
205 Correct 4 ms 7380 KB Output is correct
206 Correct 5 ms 7380 KB Output is correct
207 Correct 5 ms 7508 KB Output is correct
208 Correct 5 ms 7508 KB Output is correct
209 Correct 7 ms 10452 KB Output is correct
210 Correct 48 ms 17672 KB Output is correct
211 Correct 78 ms 22852 KB Output is correct
212 Correct 106 ms 26428 KB Output is correct
213 Correct 114 ms 29316 KB Output is correct
214 Correct 55 ms 21052 KB Output is correct
215 Correct 49 ms 20892 KB Output is correct
216 Correct 95 ms 23564 KB Output is correct
217 Correct 94 ms 21936 KB Output is correct
218 Correct 96 ms 19948 KB Output is correct
219 Correct 72 ms 19564 KB Output is correct
220 Correct 72 ms 19400 KB Output is correct
221 Correct 67 ms 19296 KB Output is correct
222 Correct 74 ms 20512 KB Output is correct
223 Correct 116 ms 24880 KB Output is correct
224 Correct 101 ms 23904 KB Output is correct
225 Correct 93 ms 21620 KB Output is correct
226 Correct 87 ms 21664 KB Output is correct
227 Correct 105 ms 21640 KB Output is correct
228 Correct 89 ms 20892 KB Output is correct
229 Correct 69 ms 20140 KB Output is correct
230 Correct 89 ms 21920 KB Output is correct
231 Correct 116 ms 21972 KB Output is correct