Submission #380942

# Submission time Handle Problem Language Result Execution time Memory
380942 2021-03-23T18:42:02 Z usachevd0 Duathlon (APIO18_duathlon) C++14
100 / 100
189 ms 55144 KB
#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using ld = long double;
template<typename T1, typename T2> bool chkmin(T1 &x, T2 y) { return y < x ? (x = y, true) : false; }
template<typename T1, typename T2> bool chkmax(T1 &x, T2 y) { return y > x ? (x = y, true) : false; }
void debug_out() { cerr << endl; }
template<typename T1, typename... T2> void debug_out(T1 A, T2... B) { cerr << ' ' << A; debug_out(B...); }
template<typename T> void mdebug_out(T* a, int n) { for (int i = 0; i < n; ++i) cerr << a[i] << ' '; cerr << endl; }
#ifdef DEBUG
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
    #define mdebug(a, n) cerr << #a << ": ", mdebug_out(a, n)
#else
    #define debug(...) 1337
    #define mdebug(a, n) 1337
#endif
template<typename T> ostream& operator << (ostream& stream, const vector<T> &v) { for (auto x : v) stream << x << ' '; return stream; }
template<typename T1, typename T2> ostream& operator << (ostream& stream, const pair<T1, T2>& p) { return stream << p.first << ' ' << p.second; }

const int N = 100005;
int n, m;
vector<int> G[N];
int tin[N], fup[N], timer;
int used[3 * N];
bool cut[N];

vector<int> block[2 * N];
int blocks;

vector<int> stk;
void dfs1(int v, int p = -1)
{
    used[v] = 1;
    tin[v] = fup[v] = timer++;
    stk.push_back(v);

    int cnt_down = 0;
    for (int& u : G[v])
    {
        if (u == p) continue;
        if (!used[u])
        {   
            dfs1(u, v);
            chkmin(fup[v], fup[u]);
            if (fup[u] >= tin[v])
            {
                // v is a cut
                ++cnt_down;
                cut[v] = true;
                auto &b = block[blocks++];
                for (; tin[stk.back()] >= tin[u]; stk.pop_back())
                    b.push_back(stk.back());
                b.push_back(v);
            }
        }
        else
        {
            chkmin(fup[v], tin[u]);
        }
    }
    if (p == -1 && cnt_down <= 1)
        cut[v] = false;
}

vector<int> T[3 * N]; // block-cut tree
ll C[3 * N], nC[3 * N];
ll cnt[3 * N];
ll sum[3 * N];
ll sum2[3 * N];
ll ans;

void add_edge(int u, int v)
{
//    debug(u, v);
    T[u].pb(v);
    T[v].pb(u);
}

ll curSum;
void dfs2(int v, int p = -1)
{
    used[v] = 1;
    sum[v] = nC[v];
    for (int& u : T[v]) if (u != p)
    {
        dfs2(u, v);
        sum[v] += sum[u];
    }
}

void dfs3(int v, int p = -1)
{
    for (int& u : T[v]) if (u != p)
    {
        dfs3(u, v);
    }
    if (v <= n) // v is a cut
    {
        vector<pii> a = {{C[p] - 1, curSum - sum[v]}};
        for (int& u : T[v]) if (u != p)
            a.emplace_back(C[u] - 1, sum[u]);
        ll sumSe = 0;
        for (auto& p : a)
            sumSe += p.se;
        for (int i = 0; i < a.size(); ++i)
        {
            ll x = a[i].fi;
            ll rem = 1 + sumSe - a[i].se;
            ans -= x * rem * (rem - 1);
        }
    }
}

signed main()
{
#ifdef DEBUG
    freopen("in", "r", stdin);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> m;
    for (int i = 0; i < m; ++i)
    {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    for (int v = 1; v <= n; ++v) if (!used[v])
    {
        // new component
        dfs1(v);
    }
    for (int bi = 0; bi < blocks; ++bi)
    {
        auto& b = block[bi];
//        debug(bi, b);
        for (auto& v : b)
        {
            if (cut[v])
            {
                add_edge(v, bi + n + 1);
            }
            else
            {
                nC[bi + n + 1]++;
            }
        }
        C[bi + n + 1] = b.size();
    }
    for (int v = 1; v <= n; ++v)
        if (cut[v])
            nC[v] = C[v] = 1;
//    mdebug(C + 1, n + blocks);
    ans = 0;
    memset(used, 0, sizeof used);
    for (int bi = 0; bi < blocks; ++bi)
    {
        int v = bi + n + 1;
        if (!used[v])
        {
            dfs2(v);
            curSum = sum[v];
//            debug(curSum);
            ans += curSum * (curSum - 1) * (curSum - 2);
            dfs3(v);
        }
    }
    cout << ans << '\n';
    
    return 0;
}
/*
6 9

6 2
5 6
4 1
1 2
5 4
6 1
5 3
2 4
2 5


7 10
3 5
2 3
1 5
6 4
5 7
6 5
1 3
4 1
3 6
1 6


10 20
5 6
10 5
7 3
7 4
2 4
10 3
1 10
7 1
8 10
4 6
6 10
10 4
1 3
4 5
4 1
7 2
3 4
9 7
5 1
2 3
*/

Compilation message

count_triplets.cpp: In function 'void dfs3(int, int)':
count_triplets.cpp:117:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  117 |         for (int i = 0; i < a.size(); ++i)
      |                         ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15596 KB Output is correct
2 Correct 10 ms 15596 KB Output is correct
3 Correct 11 ms 15596 KB Output is correct
4 Correct 11 ms 15596 KB Output is correct
5 Correct 10 ms 15596 KB Output is correct
6 Correct 10 ms 15596 KB Output is correct
7 Correct 10 ms 15596 KB Output is correct
8 Correct 10 ms 15596 KB Output is correct
9 Correct 10 ms 15596 KB Output is correct
10 Correct 10 ms 15596 KB Output is correct
11 Correct 10 ms 15596 KB Output is correct
12 Correct 10 ms 15596 KB Output is correct
13 Correct 11 ms 15596 KB Output is correct
14 Correct 11 ms 15644 KB Output is correct
15 Correct 10 ms 15596 KB Output is correct
16 Correct 11 ms 15596 KB Output is correct
17 Correct 10 ms 15596 KB Output is correct
18 Correct 10 ms 15596 KB Output is correct
19 Correct 10 ms 15596 KB Output is correct
20 Correct 13 ms 15596 KB Output is correct
21 Correct 10 ms 15596 KB Output is correct
22 Correct 10 ms 15596 KB Output is correct
23 Correct 10 ms 15596 KB Output is correct
24 Correct 10 ms 15596 KB Output is correct
25 Correct 10 ms 15596 KB Output is correct
26 Correct 10 ms 15596 KB Output is correct
27 Correct 10 ms 15596 KB Output is correct
28 Correct 10 ms 15596 KB Output is correct
29 Correct 10 ms 15596 KB Output is correct
30 Correct 10 ms 15596 KB Output is correct
31 Correct 10 ms 15596 KB Output is correct
32 Correct 10 ms 15596 KB Output is correct
33 Correct 11 ms 15596 KB Output is correct
34 Correct 10 ms 15724 KB Output is correct
35 Correct 11 ms 15616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15596 KB Output is correct
2 Correct 10 ms 15596 KB Output is correct
3 Correct 11 ms 15596 KB Output is correct
4 Correct 11 ms 15596 KB Output is correct
5 Correct 10 ms 15596 KB Output is correct
6 Correct 10 ms 15596 KB Output is correct
7 Correct 10 ms 15596 KB Output is correct
8 Correct 10 ms 15596 KB Output is correct
9 Correct 10 ms 15596 KB Output is correct
10 Correct 10 ms 15596 KB Output is correct
11 Correct 10 ms 15596 KB Output is correct
12 Correct 10 ms 15596 KB Output is correct
13 Correct 11 ms 15596 KB Output is correct
14 Correct 11 ms 15644 KB Output is correct
15 Correct 10 ms 15596 KB Output is correct
16 Correct 11 ms 15596 KB Output is correct
17 Correct 10 ms 15596 KB Output is correct
18 Correct 10 ms 15596 KB Output is correct
19 Correct 10 ms 15596 KB Output is correct
20 Correct 13 ms 15596 KB Output is correct
21 Correct 10 ms 15596 KB Output is correct
22 Correct 10 ms 15596 KB Output is correct
23 Correct 10 ms 15596 KB Output is correct
24 Correct 10 ms 15596 KB Output is correct
25 Correct 10 ms 15596 KB Output is correct
26 Correct 10 ms 15596 KB Output is correct
27 Correct 10 ms 15596 KB Output is correct
28 Correct 10 ms 15596 KB Output is correct
29 Correct 10 ms 15596 KB Output is correct
30 Correct 10 ms 15596 KB Output is correct
31 Correct 10 ms 15596 KB Output is correct
32 Correct 10 ms 15596 KB Output is correct
33 Correct 11 ms 15596 KB Output is correct
34 Correct 10 ms 15724 KB Output is correct
35 Correct 11 ms 15616 KB Output is correct
36 Correct 10 ms 15596 KB Output is correct
37 Correct 10 ms 15596 KB Output is correct
38 Correct 10 ms 15596 KB Output is correct
39 Correct 10 ms 15596 KB Output is correct
40 Correct 10 ms 15596 KB Output is correct
41 Correct 10 ms 15724 KB Output is correct
42 Correct 10 ms 15596 KB Output is correct
43 Correct 10 ms 15596 KB Output is correct
44 Correct 10 ms 15596 KB Output is correct
45 Correct 10 ms 15596 KB Output is correct
46 Correct 10 ms 15596 KB Output is correct
47 Correct 10 ms 15596 KB Output is correct
48 Correct 12 ms 15596 KB Output is correct
49 Correct 11 ms 15596 KB Output is correct
50 Correct 10 ms 15596 KB Output is correct
51 Correct 10 ms 15596 KB Output is correct
52 Correct 10 ms 15596 KB Output is correct
53 Correct 10 ms 15596 KB Output is correct
54 Correct 10 ms 15596 KB Output is correct
55 Correct 10 ms 15596 KB Output is correct
56 Correct 10 ms 15596 KB Output is correct
57 Correct 10 ms 15596 KB Output is correct
58 Correct 10 ms 15596 KB Output is correct
59 Correct 10 ms 15724 KB Output is correct
60 Correct 12 ms 15596 KB Output is correct
61 Correct 10 ms 15596 KB Output is correct
62 Correct 10 ms 15596 KB Output is correct
63 Correct 10 ms 15596 KB Output is correct
64 Correct 12 ms 15596 KB Output is correct
65 Correct 10 ms 15596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 81 ms 31464 KB Output is correct
2 Correct 89 ms 31408 KB Output is correct
3 Correct 116 ms 38764 KB Output is correct
4 Correct 97 ms 33572 KB Output is correct
5 Correct 117 ms 33264 KB Output is correct
6 Correct 147 ms 40552 KB Output is correct
7 Correct 149 ms 33260 KB Output is correct
8 Correct 135 ms 36756 KB Output is correct
9 Correct 117 ms 31084 KB Output is correct
10 Correct 124 ms 31468 KB Output is correct
11 Correct 93 ms 26732 KB Output is correct
12 Correct 92 ms 26604 KB Output is correct
13 Correct 76 ms 26216 KB Output is correct
14 Correct 73 ms 25960 KB Output is correct
15 Correct 58 ms 24680 KB Output is correct
16 Correct 61 ms 24552 KB Output is correct
17 Correct 13 ms 17004 KB Output is correct
18 Correct 14 ms 17008 KB Output is correct
19 Correct 12 ms 17008 KB Output is correct
20 Correct 13 ms 17008 KB Output is correct
21 Correct 13 ms 17000 KB Output is correct
22 Correct 12 ms 17000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 15852 KB Output is correct
2 Correct 11 ms 15852 KB Output is correct
3 Correct 11 ms 15852 KB Output is correct
4 Correct 12 ms 15980 KB Output is correct
5 Correct 11 ms 15980 KB Output is correct
6 Correct 11 ms 15852 KB Output is correct
7 Correct 11 ms 15980 KB Output is correct
8 Correct 14 ms 15852 KB Output is correct
9 Correct 11 ms 15852 KB Output is correct
10 Correct 11 ms 15852 KB Output is correct
11 Correct 12 ms 15852 KB Output is correct
12 Correct 11 ms 15852 KB Output is correct
13 Correct 11 ms 15852 KB Output is correct
14 Correct 10 ms 15852 KB Output is correct
15 Correct 10 ms 15724 KB Output is correct
16 Correct 12 ms 15724 KB Output is correct
17 Correct 11 ms 15852 KB Output is correct
18 Correct 10 ms 15852 KB Output is correct
19 Correct 10 ms 15852 KB Output is correct
20 Correct 12 ms 15852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 131 ms 32364 KB Output is correct
2 Correct 133 ms 32492 KB Output is correct
3 Correct 130 ms 32364 KB Output is correct
4 Correct 131 ms 32428 KB Output is correct
5 Correct 137 ms 32376 KB Output is correct
6 Correct 189 ms 55144 KB Output is correct
7 Correct 161 ms 41064 KB Output is correct
8 Correct 153 ms 38892 KB Output is correct
9 Correct 153 ms 36716 KB Output is correct
10 Correct 134 ms 32492 KB Output is correct
11 Correct 135 ms 32376 KB Output is correct
12 Correct 130 ms 32364 KB Output is correct
13 Correct 133 ms 32364 KB Output is correct
14 Correct 114 ms 31340 KB Output is correct
15 Correct 96 ms 30060 KB Output is correct
16 Correct 60 ms 25960 KB Output is correct
17 Correct 76 ms 30180 KB Output is correct
18 Correct 76 ms 30040 KB Output is correct
19 Correct 76 ms 29920 KB Output is correct
20 Correct 92 ms 29644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 15852 KB Output is correct
2 Correct 11 ms 15852 KB Output is correct
3 Correct 11 ms 15852 KB Output is correct
4 Correct 13 ms 15724 KB Output is correct
5 Correct 12 ms 15872 KB Output is correct
6 Correct 11 ms 15724 KB Output is correct
7 Correct 10 ms 15724 KB Output is correct
8 Correct 11 ms 15724 KB Output is correct
9 Correct 10 ms 15724 KB Output is correct
10 Correct 11 ms 15724 KB Output is correct
11 Correct 11 ms 15724 KB Output is correct
12 Correct 11 ms 15852 KB Output is correct
13 Correct 11 ms 15852 KB Output is correct
14 Correct 11 ms 15852 KB Output is correct
15 Correct 11 ms 15852 KB Output is correct
16 Correct 11 ms 15724 KB Output is correct
17 Correct 11 ms 15724 KB Output is correct
18 Correct 11 ms 15724 KB Output is correct
19 Correct 12 ms 15724 KB Output is correct
20 Correct 10 ms 15724 KB Output is correct
21 Correct 10 ms 15852 KB Output is correct
22 Correct 11 ms 15852 KB Output is correct
23 Correct 10 ms 15724 KB Output is correct
24 Correct 12 ms 15852 KB Output is correct
25 Correct 10 ms 15724 KB Output is correct
26 Correct 10 ms 15724 KB Output is correct
27 Correct 11 ms 15724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 128 ms 32492 KB Output is correct
2 Correct 130 ms 32748 KB Output is correct
3 Correct 140 ms 30956 KB Output is correct
4 Correct 158 ms 28652 KB Output is correct
5 Correct 127 ms 26092 KB Output is correct
6 Correct 94 ms 25068 KB Output is correct
7 Correct 96 ms 24684 KB Output is correct
8 Correct 103 ms 23916 KB Output is correct
9 Correct 101 ms 23624 KB Output is correct
10 Correct 85 ms 23404 KB Output is correct
11 Correct 75 ms 23148 KB Output is correct
12 Correct 72 ms 23020 KB Output is correct
13 Correct 74 ms 22764 KB Output is correct
14 Correct 74 ms 23656 KB Output is correct
15 Correct 150 ms 39784 KB Output is correct
16 Correct 160 ms 36860 KB Output is correct
17 Correct 161 ms 37096 KB Output is correct
18 Correct 144 ms 34540 KB Output is correct
19 Correct 122 ms 28780 KB Output is correct
20 Correct 129 ms 28652 KB Output is correct
21 Correct 127 ms 28652 KB Output is correct
22 Correct 103 ms 27500 KB Output is correct
23 Correct 91 ms 25964 KB Output is correct
24 Correct 116 ms 31012 KB Output is correct
25 Correct 124 ms 32516 KB Output is correct
26 Correct 125 ms 31592 KB Output is correct
27 Correct 120 ms 31084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15596 KB Output is correct
2 Correct 10 ms 15596 KB Output is correct
3 Correct 11 ms 15596 KB Output is correct
4 Correct 11 ms 15596 KB Output is correct
5 Correct 10 ms 15596 KB Output is correct
6 Correct 10 ms 15596 KB Output is correct
7 Correct 10 ms 15596 KB Output is correct
8 Correct 10 ms 15596 KB Output is correct
9 Correct 10 ms 15596 KB Output is correct
10 Correct 10 ms 15596 KB Output is correct
11 Correct 10 ms 15596 KB Output is correct
12 Correct 10 ms 15596 KB Output is correct
13 Correct 11 ms 15596 KB Output is correct
14 Correct 11 ms 15644 KB Output is correct
15 Correct 10 ms 15596 KB Output is correct
16 Correct 11 ms 15596 KB Output is correct
17 Correct 10 ms 15596 KB Output is correct
18 Correct 10 ms 15596 KB Output is correct
19 Correct 10 ms 15596 KB Output is correct
20 Correct 13 ms 15596 KB Output is correct
21 Correct 10 ms 15596 KB Output is correct
22 Correct 10 ms 15596 KB Output is correct
23 Correct 10 ms 15596 KB Output is correct
24 Correct 10 ms 15596 KB Output is correct
25 Correct 10 ms 15596 KB Output is correct
26 Correct 10 ms 15596 KB Output is correct
27 Correct 10 ms 15596 KB Output is correct
28 Correct 10 ms 15596 KB Output is correct
29 Correct 10 ms 15596 KB Output is correct
30 Correct 10 ms 15596 KB Output is correct
31 Correct 10 ms 15596 KB Output is correct
32 Correct 10 ms 15596 KB Output is correct
33 Correct 11 ms 15596 KB Output is correct
34 Correct 10 ms 15724 KB Output is correct
35 Correct 11 ms 15616 KB Output is correct
36 Correct 10 ms 15596 KB Output is correct
37 Correct 10 ms 15596 KB Output is correct
38 Correct 10 ms 15596 KB Output is correct
39 Correct 10 ms 15596 KB Output is correct
40 Correct 10 ms 15596 KB Output is correct
41 Correct 10 ms 15724 KB Output is correct
42 Correct 10 ms 15596 KB Output is correct
43 Correct 10 ms 15596 KB Output is correct
44 Correct 10 ms 15596 KB Output is correct
45 Correct 10 ms 15596 KB Output is correct
46 Correct 10 ms 15596 KB Output is correct
47 Correct 10 ms 15596 KB Output is correct
48 Correct 12 ms 15596 KB Output is correct
49 Correct 11 ms 15596 KB Output is correct
50 Correct 10 ms 15596 KB Output is correct
51 Correct 10 ms 15596 KB Output is correct
52 Correct 10 ms 15596 KB Output is correct
53 Correct 10 ms 15596 KB Output is correct
54 Correct 10 ms 15596 KB Output is correct
55 Correct 10 ms 15596 KB Output is correct
56 Correct 10 ms 15596 KB Output is correct
57 Correct 10 ms 15596 KB Output is correct
58 Correct 10 ms 15596 KB Output is correct
59 Correct 10 ms 15724 KB Output is correct
60 Correct 12 ms 15596 KB Output is correct
61 Correct 10 ms 15596 KB Output is correct
62 Correct 10 ms 15596 KB Output is correct
63 Correct 10 ms 15596 KB Output is correct
64 Correct 12 ms 15596 KB Output is correct
65 Correct 10 ms 15596 KB Output is correct
66 Correct 10 ms 15596 KB Output is correct
67 Correct 11 ms 15724 KB Output is correct
68 Correct 11 ms 15724 KB Output is correct
69 Correct 10 ms 15724 KB Output is correct
70 Correct 11 ms 15852 KB Output is correct
71 Correct 10 ms 15724 KB Output is correct
72 Correct 10 ms 15724 KB Output is correct
73 Correct 10 ms 15852 KB Output is correct
74 Correct 10 ms 15724 KB Output is correct
75 Correct 10 ms 15724 KB Output is correct
76 Correct 12 ms 15596 KB Output is correct
77 Correct 12 ms 15724 KB Output is correct
78 Correct 11 ms 15724 KB Output is correct
79 Correct 10 ms 15724 KB Output is correct
80 Correct 11 ms 15724 KB Output is correct
81 Correct 10 ms 15724 KB Output is correct
82 Correct 11 ms 15852 KB Output is correct
83 Correct 10 ms 15852 KB Output is correct
84 Correct 11 ms 15852 KB Output is correct
85 Correct 11 ms 15724 KB Output is correct
86 Correct 11 ms 15724 KB Output is correct
87 Correct 11 ms 15724 KB Output is correct
88 Correct 12 ms 15724 KB Output is correct
89 Correct 10 ms 15724 KB Output is correct
90 Correct 10 ms 15724 KB Output is correct
91 Correct 10 ms 15724 KB Output is correct
92 Correct 11 ms 15724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15596 KB Output is correct
2 Correct 10 ms 15596 KB Output is correct
3 Correct 11 ms 15596 KB Output is correct
4 Correct 11 ms 15596 KB Output is correct
5 Correct 10 ms 15596 KB Output is correct
6 Correct 10 ms 15596 KB Output is correct
7 Correct 10 ms 15596 KB Output is correct
8 Correct 10 ms 15596 KB Output is correct
9 Correct 10 ms 15596 KB Output is correct
10 Correct 10 ms 15596 KB Output is correct
11 Correct 10 ms 15596 KB Output is correct
12 Correct 10 ms 15596 KB Output is correct
13 Correct 11 ms 15596 KB Output is correct
14 Correct 11 ms 15644 KB Output is correct
15 Correct 10 ms 15596 KB Output is correct
16 Correct 11 ms 15596 KB Output is correct
17 Correct 10 ms 15596 KB Output is correct
18 Correct 10 ms 15596 KB Output is correct
19 Correct 10 ms 15596 KB Output is correct
20 Correct 13 ms 15596 KB Output is correct
21 Correct 10 ms 15596 KB Output is correct
22 Correct 10 ms 15596 KB Output is correct
23 Correct 10 ms 15596 KB Output is correct
24 Correct 10 ms 15596 KB Output is correct
25 Correct 10 ms 15596 KB Output is correct
26 Correct 10 ms 15596 KB Output is correct
27 Correct 10 ms 15596 KB Output is correct
28 Correct 10 ms 15596 KB Output is correct
29 Correct 10 ms 15596 KB Output is correct
30 Correct 10 ms 15596 KB Output is correct
31 Correct 10 ms 15596 KB Output is correct
32 Correct 10 ms 15596 KB Output is correct
33 Correct 11 ms 15596 KB Output is correct
34 Correct 10 ms 15724 KB Output is correct
35 Correct 11 ms 15616 KB Output is correct
36 Correct 10 ms 15596 KB Output is correct
37 Correct 10 ms 15596 KB Output is correct
38 Correct 10 ms 15596 KB Output is correct
39 Correct 10 ms 15596 KB Output is correct
40 Correct 10 ms 15596 KB Output is correct
41 Correct 10 ms 15724 KB Output is correct
42 Correct 10 ms 15596 KB Output is correct
43 Correct 10 ms 15596 KB Output is correct
44 Correct 10 ms 15596 KB Output is correct
45 Correct 10 ms 15596 KB Output is correct
46 Correct 10 ms 15596 KB Output is correct
47 Correct 10 ms 15596 KB Output is correct
48 Correct 12 ms 15596 KB Output is correct
49 Correct 11 ms 15596 KB Output is correct
50 Correct 10 ms 15596 KB Output is correct
51 Correct 10 ms 15596 KB Output is correct
52 Correct 10 ms 15596 KB Output is correct
53 Correct 10 ms 15596 KB Output is correct
54 Correct 10 ms 15596 KB Output is correct
55 Correct 10 ms 15596 KB Output is correct
56 Correct 10 ms 15596 KB Output is correct
57 Correct 10 ms 15596 KB Output is correct
58 Correct 10 ms 15596 KB Output is correct
59 Correct 10 ms 15724 KB Output is correct
60 Correct 12 ms 15596 KB Output is correct
61 Correct 10 ms 15596 KB Output is correct
62 Correct 10 ms 15596 KB Output is correct
63 Correct 10 ms 15596 KB Output is correct
64 Correct 12 ms 15596 KB Output is correct
65 Correct 10 ms 15596 KB Output is correct
66 Correct 81 ms 31464 KB Output is correct
67 Correct 89 ms 31408 KB Output is correct
68 Correct 116 ms 38764 KB Output is correct
69 Correct 97 ms 33572 KB Output is correct
70 Correct 117 ms 33264 KB Output is correct
71 Correct 147 ms 40552 KB Output is correct
72 Correct 149 ms 33260 KB Output is correct
73 Correct 135 ms 36756 KB Output is correct
74 Correct 117 ms 31084 KB Output is correct
75 Correct 124 ms 31468 KB Output is correct
76 Correct 93 ms 26732 KB Output is correct
77 Correct 92 ms 26604 KB Output is correct
78 Correct 76 ms 26216 KB Output is correct
79 Correct 73 ms 25960 KB Output is correct
80 Correct 58 ms 24680 KB Output is correct
81 Correct 61 ms 24552 KB Output is correct
82 Correct 13 ms 17004 KB Output is correct
83 Correct 14 ms 17008 KB Output is correct
84 Correct 12 ms 17008 KB Output is correct
85 Correct 13 ms 17008 KB Output is correct
86 Correct 13 ms 17000 KB Output is correct
87 Correct 12 ms 17000 KB Output is correct
88 Correct 12 ms 15852 KB Output is correct
89 Correct 11 ms 15852 KB Output is correct
90 Correct 11 ms 15852 KB Output is correct
91 Correct 12 ms 15980 KB Output is correct
92 Correct 11 ms 15980 KB Output is correct
93 Correct 11 ms 15852 KB Output is correct
94 Correct 11 ms 15980 KB Output is correct
95 Correct 14 ms 15852 KB Output is correct
96 Correct 11 ms 15852 KB Output is correct
97 Correct 11 ms 15852 KB Output is correct
98 Correct 12 ms 15852 KB Output is correct
99 Correct 11 ms 15852 KB Output is correct
100 Correct 11 ms 15852 KB Output is correct
101 Correct 10 ms 15852 KB Output is correct
102 Correct 10 ms 15724 KB Output is correct
103 Correct 12 ms 15724 KB Output is correct
104 Correct 11 ms 15852 KB Output is correct
105 Correct 10 ms 15852 KB Output is correct
106 Correct 10 ms 15852 KB Output is correct
107 Correct 12 ms 15852 KB Output is correct
108 Correct 131 ms 32364 KB Output is correct
109 Correct 133 ms 32492 KB Output is correct
110 Correct 130 ms 32364 KB Output is correct
111 Correct 131 ms 32428 KB Output is correct
112 Correct 137 ms 32376 KB Output is correct
113 Correct 189 ms 55144 KB Output is correct
114 Correct 161 ms 41064 KB Output is correct
115 Correct 153 ms 38892 KB Output is correct
116 Correct 153 ms 36716 KB Output is correct
117 Correct 134 ms 32492 KB Output is correct
118 Correct 135 ms 32376 KB Output is correct
119 Correct 130 ms 32364 KB Output is correct
120 Correct 133 ms 32364 KB Output is correct
121 Correct 114 ms 31340 KB Output is correct
122 Correct 96 ms 30060 KB Output is correct
123 Correct 60 ms 25960 KB Output is correct
124 Correct 76 ms 30180 KB Output is correct
125 Correct 76 ms 30040 KB Output is correct
126 Correct 76 ms 29920 KB Output is correct
127 Correct 92 ms 29644 KB Output is correct
128 Correct 11 ms 15852 KB Output is correct
129 Correct 11 ms 15852 KB Output is correct
130 Correct 11 ms 15852 KB Output is correct
131 Correct 13 ms 15724 KB Output is correct
132 Correct 12 ms 15872 KB Output is correct
133 Correct 11 ms 15724 KB Output is correct
134 Correct 10 ms 15724 KB Output is correct
135 Correct 11 ms 15724 KB Output is correct
136 Correct 10 ms 15724 KB Output is correct
137 Correct 11 ms 15724 KB Output is correct
138 Correct 11 ms 15724 KB Output is correct
139 Correct 11 ms 15852 KB Output is correct
140 Correct 11 ms 15852 KB Output is correct
141 Correct 11 ms 15852 KB Output is correct
142 Correct 11 ms 15852 KB Output is correct
143 Correct 11 ms 15724 KB Output is correct
144 Correct 11 ms 15724 KB Output is correct
145 Correct 11 ms 15724 KB Output is correct
146 Correct 12 ms 15724 KB Output is correct
147 Correct 10 ms 15724 KB Output is correct
148 Correct 10 ms 15852 KB Output is correct
149 Correct 11 ms 15852 KB Output is correct
150 Correct 10 ms 15724 KB Output is correct
151 Correct 12 ms 15852 KB Output is correct
152 Correct 10 ms 15724 KB Output is correct
153 Correct 10 ms 15724 KB Output is correct
154 Correct 11 ms 15724 KB Output is correct
155 Correct 128 ms 32492 KB Output is correct
156 Correct 130 ms 32748 KB Output is correct
157 Correct 140 ms 30956 KB Output is correct
158 Correct 158 ms 28652 KB Output is correct
159 Correct 127 ms 26092 KB Output is correct
160 Correct 94 ms 25068 KB Output is correct
161 Correct 96 ms 24684 KB Output is correct
162 Correct 103 ms 23916 KB Output is correct
163 Correct 101 ms 23624 KB Output is correct
164 Correct 85 ms 23404 KB Output is correct
165 Correct 75 ms 23148 KB Output is correct
166 Correct 72 ms 23020 KB Output is correct
167 Correct 74 ms 22764 KB Output is correct
168 Correct 74 ms 23656 KB Output is correct
169 Correct 150 ms 39784 KB Output is correct
170 Correct 160 ms 36860 KB Output is correct
171 Correct 161 ms 37096 KB Output is correct
172 Correct 144 ms 34540 KB Output is correct
173 Correct 122 ms 28780 KB Output is correct
174 Correct 129 ms 28652 KB Output is correct
175 Correct 127 ms 28652 KB Output is correct
176 Correct 103 ms 27500 KB Output is correct
177 Correct 91 ms 25964 KB Output is correct
178 Correct 116 ms 31012 KB Output is correct
179 Correct 124 ms 32516 KB Output is correct
180 Correct 125 ms 31592 KB Output is correct
181 Correct 120 ms 31084 KB Output is correct
182 Correct 10 ms 15596 KB Output is correct
183 Correct 11 ms 15724 KB Output is correct
184 Correct 11 ms 15724 KB Output is correct
185 Correct 10 ms 15724 KB Output is correct
186 Correct 11 ms 15852 KB Output is correct
187 Correct 10 ms 15724 KB Output is correct
188 Correct 10 ms 15724 KB Output is correct
189 Correct 10 ms 15852 KB Output is correct
190 Correct 10 ms 15724 KB Output is correct
191 Correct 10 ms 15724 KB Output is correct
192 Correct 12 ms 15596 KB Output is correct
193 Correct 12 ms 15724 KB Output is correct
194 Correct 11 ms 15724 KB Output is correct
195 Correct 10 ms 15724 KB Output is correct
196 Correct 11 ms 15724 KB Output is correct
197 Correct 10 ms 15724 KB Output is correct
198 Correct 11 ms 15852 KB Output is correct
199 Correct 10 ms 15852 KB Output is correct
200 Correct 11 ms 15852 KB Output is correct
201 Correct 11 ms 15724 KB Output is correct
202 Correct 11 ms 15724 KB Output is correct
203 Correct 11 ms 15724 KB Output is correct
204 Correct 12 ms 15724 KB Output is correct
205 Correct 10 ms 15724 KB Output is correct
206 Correct 10 ms 15724 KB Output is correct
207 Correct 10 ms 15724 KB Output is correct
208 Correct 11 ms 15724 KB Output is correct
209 Correct 12 ms 17004 KB Output is correct
210 Correct 63 ms 26728 KB Output is correct
211 Correct 116 ms 30184 KB Output is correct
212 Correct 124 ms 31856 KB Output is correct
213 Correct 150 ms 33432 KB Output is correct
214 Correct 78 ms 27372 KB Output is correct
215 Correct 63 ms 26476 KB Output is correct
216 Correct 129 ms 30828 KB Output is correct
217 Correct 110 ms 28268 KB Output is correct
218 Correct 111 ms 25324 KB Output is correct
219 Correct 90 ms 24644 KB Output is correct
220 Correct 79 ms 24300 KB Output is correct
221 Correct 73 ms 23788 KB Output is correct
222 Correct 78 ms 23404 KB Output is correct
223 Correct 119 ms 31724 KB Output is correct
224 Correct 118 ms 30604 KB Output is correct
225 Correct 107 ms 27500 KB Output is correct
226 Correct 119 ms 27500 KB Output is correct
227 Correct 118 ms 27628 KB Output is correct
228 Correct 96 ms 26732 KB Output is correct
229 Correct 83 ms 25580 KB Output is correct
230 Correct 98 ms 25496 KB Output is correct
231 Correct 102 ms 25580 KB Output is correct