답안 #48856

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
48856 2018-05-19T10:29:44 Z model_code 철인 이종 경기 (APIO18_duathlon) C++17
100 / 100
341 ms 68796 KB
#define NDEBUG
// #define USE_FILE_IO

#include <cassert>
#include <cstdio>
#include <cstring>
#include <climits>

#include <stack>
#include <vector>
#include <algorithm>
#define size razmer

using namespace std;

#ifdef NDEBUG
#define DEBUG(...)
#else

template <typename ... TArgs>
void DEBUG(const char *msg, const TArgs& ...args) {
    fprintf(stderr, msg, args...);
}

template <>
void DEBUG(const char *msg) {
    fputs(msg, stderr);
}

#endif

#define NMAX 500000
#define MMAX 600000

typedef long long i64;

struct Pair {
    Pair(int _u, int _v) : u(_u), v(_v) {}

    int u, v;
};

static int n, m, cnt;  // cnt: number of blocks
static vector<int> G[NMAX + 10], T[NMAX + 10];
static int father[NMAX + 10], in[NMAX + 10];
static i64 num[NMAX + 10];
static i64 size[NMAX + 10], g[NMAX + 10];  // g: explained in document

#define IS_BLOCK(x) (x > n)
#define CNT(x) (IS_BLOCK(x) ? 0 : 1)

// Biconnected components
void bcc(int u, int f = 0) {
    static stack<Pair> stk;
    static bool marked[NMAX + 10];
    static int low[NMAX + 10], cur;
    in[u] = low[u] = ++cur;

    for (int v : G[u]) {
        if (v == f) {
            f = 0;  // Cancel on the first edge to father
            continue;
        }

        if (in[v]) 
            low[u] = min(low[u], in[v]);
        else {
            stk.push(Pair(u, v));
            bcc(v, u);
            low[u] = min(low[u], low[v]);

            if (low[v] > in[u]) {
                DEBUG("bcc: cut edge: (%d, %d)\n", u, v);
                T[u].push_back(v);
                T[v].push_back(u);
                stk.pop();
            } else if (low[v] >= in[u]) {
                cnt++;
                DEBUG("bcc: %d: ", cnt);
                int linked = 0, p = n + cnt;
                auto add = [p, &linked](int x) {
                    if (!marked[x]) {
                        marked[x] = true;
                        T[p].push_back(x);
                        T[x].push_back(p);
                        linked++;

                        DEBUG("%d ", x);
                    }
                };

                while (!stk.empty()) {
                    Pair x = stk.top();
                    stk.pop();
                    add(x.u);
                    add(x.v);

                    if (x.u == u && x.v == v)
                        break;
                }

                for (int v : T[p])
                    marked[v] = false;

                num[p] = linked;
                if (linked == 0) {
                    cnt--;
                    DEBUG("(empty)");
                }

                DEBUG("\n");
            }
        }
    }
}

void dfs(int x, int f) {
    i64 sum = 0;
    for (int v : T[x]) {
        if (v == f)
            continue;

        father[v] = x;
        dfs(v, x);
        g[x] += sum * size[v];
        sum += size[v];
    }

    size[x] = sum + (IS_BLOCK(x) ? 0 : 1);
}

void initialize() {
    scanf("%d%d", &n, &m);

    int u, v;
    for (int i = 0; i < m; i++) {
        scanf("%d%d", &u, &v);

        if (u == v)
            continue;

        G[u].push_back(v);
        G[v].push_back(u);
    }

    for (int i = 1; i <= n; i++) {
        if (!in[i])
            bcc(i);
    }

    for (int u = 1; u <= n; u++) {
        bool found = false;
        for (int v : T[u]) {
            if (IS_BLOCK(v)) {
                found = true;
                break;
            }
        }

        if (!found) {  // Add blocks for cut nodes for convenience
            int p = n + (++cnt);
            T[u].push_back(p);
            T[p].push_back(u);
            num[p] = 1;
        }
    }

    for (int i = 1; i <= n; i++) {
        if (!size[i])
            dfs(i, 0);
    }
}

inline i64 c(i64 m) {  // m choose 2
    return m * (m - 1) / 2;
}

void rotate(int u, int v) {
    g[u] -= size[v] * (size[u] - size[v] - CNT(u));
    i64 tmp = size[u];
    size[u] -= size[v];
    size[v] = tmp;
    g[v] += size[u] * (size[v] - size[u] - CNT(v));
}

i64 eval(int u, int f) {
    i64 ret = g[u];
    if (IS_BLOCK(u))
        ret *= (num[u] - 2);

    for (int v : T[u]) {
        if (v == f)
            continue;

        rotate(u, v);
        ret += eval(v, u);
        rotate(v, u);
    }

    return ret;
}

int main() {
#ifdef USE_FILE_IO
    freopen("data.in", "r", stdin);
    // freopen("data.out", "w", stdout);
#endif
    initialize();

    i64 ans = 0;
    for (int u = 1; u <= n; u++) {
        if (!father[u])
            ans += eval(u, 0);
    }

    printf("%lld\n", ans * 2);
    return 0;
}

Compilation message

count_triplets.cpp: In function 'void initialize()':
count_triplets.cpp:133:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
count_triplets.cpp:137:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &u, &v);
         ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 23800 KB Output is correct
2 Correct 28 ms 23912 KB Output is correct
3 Correct 24 ms 23912 KB Output is correct
4 Correct 26 ms 23988 KB Output is correct
5 Correct 24 ms 23988 KB Output is correct
6 Correct 27 ms 23988 KB Output is correct
7 Correct 27 ms 23988 KB Output is correct
8 Correct 22 ms 24036 KB Output is correct
9 Correct 23 ms 24036 KB Output is correct
10 Correct 22 ms 24036 KB Output is correct
11 Correct 24 ms 24036 KB Output is correct
12 Correct 26 ms 24036 KB Output is correct
13 Correct 24 ms 24036 KB Output is correct
14 Correct 24 ms 24036 KB Output is correct
15 Correct 23 ms 24036 KB Output is correct
16 Correct 24 ms 24036 KB Output is correct
17 Correct 23 ms 24036 KB Output is correct
18 Correct 25 ms 24036 KB Output is correct
19 Correct 27 ms 24036 KB Output is correct
20 Correct 23 ms 24036 KB Output is correct
21 Correct 27 ms 24036 KB Output is correct
22 Correct 26 ms 24036 KB Output is correct
23 Correct 22 ms 24036 KB Output is correct
24 Correct 22 ms 24044 KB Output is correct
25 Correct 25 ms 24044 KB Output is correct
26 Correct 27 ms 24044 KB Output is correct
27 Correct 23 ms 24044 KB Output is correct
28 Correct 23 ms 24076 KB Output is correct
29 Correct 22 ms 24076 KB Output is correct
30 Correct 22 ms 24076 KB Output is correct
31 Correct 23 ms 24076 KB Output is correct
32 Correct 28 ms 24076 KB Output is correct
33 Correct 23 ms 24088 KB Output is correct
34 Correct 20 ms 24088 KB Output is correct
35 Correct 21 ms 24088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 23800 KB Output is correct
2 Correct 28 ms 23912 KB Output is correct
3 Correct 24 ms 23912 KB Output is correct
4 Correct 26 ms 23988 KB Output is correct
5 Correct 24 ms 23988 KB Output is correct
6 Correct 27 ms 23988 KB Output is correct
7 Correct 27 ms 23988 KB Output is correct
8 Correct 22 ms 24036 KB Output is correct
9 Correct 23 ms 24036 KB Output is correct
10 Correct 22 ms 24036 KB Output is correct
11 Correct 24 ms 24036 KB Output is correct
12 Correct 26 ms 24036 KB Output is correct
13 Correct 24 ms 24036 KB Output is correct
14 Correct 24 ms 24036 KB Output is correct
15 Correct 23 ms 24036 KB Output is correct
16 Correct 24 ms 24036 KB Output is correct
17 Correct 23 ms 24036 KB Output is correct
18 Correct 25 ms 24036 KB Output is correct
19 Correct 27 ms 24036 KB Output is correct
20 Correct 23 ms 24036 KB Output is correct
21 Correct 27 ms 24036 KB Output is correct
22 Correct 26 ms 24036 KB Output is correct
23 Correct 22 ms 24036 KB Output is correct
24 Correct 22 ms 24044 KB Output is correct
25 Correct 25 ms 24044 KB Output is correct
26 Correct 27 ms 24044 KB Output is correct
27 Correct 23 ms 24044 KB Output is correct
28 Correct 23 ms 24076 KB Output is correct
29 Correct 22 ms 24076 KB Output is correct
30 Correct 22 ms 24076 KB Output is correct
31 Correct 23 ms 24076 KB Output is correct
32 Correct 28 ms 24076 KB Output is correct
33 Correct 23 ms 24088 KB Output is correct
34 Correct 20 ms 24088 KB Output is correct
35 Correct 21 ms 24088 KB Output is correct
36 Correct 20 ms 24088 KB Output is correct
37 Correct 20 ms 24088 KB Output is correct
38 Correct 22 ms 24088 KB Output is correct
39 Correct 20 ms 24088 KB Output is correct
40 Correct 20 ms 24088 KB Output is correct
41 Correct 23 ms 24088 KB Output is correct
42 Correct 23 ms 24088 KB Output is correct
43 Correct 23 ms 24088 KB Output is correct
44 Correct 20 ms 24088 KB Output is correct
45 Correct 23 ms 24088 KB Output is correct
46 Correct 19 ms 24088 KB Output is correct
47 Correct 21 ms 24088 KB Output is correct
48 Correct 20 ms 24088 KB Output is correct
49 Correct 20 ms 24088 KB Output is correct
50 Correct 21 ms 24088 KB Output is correct
51 Correct 20 ms 24088 KB Output is correct
52 Correct 24 ms 24088 KB Output is correct
53 Correct 22 ms 24108 KB Output is correct
54 Correct 23 ms 24108 KB Output is correct
55 Correct 25 ms 24108 KB Output is correct
56 Correct 22 ms 24108 KB Output is correct
57 Correct 25 ms 24128 KB Output is correct
58 Correct 23 ms 24260 KB Output is correct
59 Correct 29 ms 24260 KB Output is correct
60 Correct 23 ms 24260 KB Output is correct
61 Correct 22 ms 24260 KB Output is correct
62 Correct 22 ms 24260 KB Output is correct
63 Correct 25 ms 24260 KB Output is correct
64 Correct 22 ms 24260 KB Output is correct
65 Correct 24 ms 24260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 188 ms 47748 KB Output is correct
2 Correct 212 ms 47880 KB Output is correct
3 Correct 232 ms 47880 KB Output is correct
4 Correct 190 ms 47880 KB Output is correct
5 Correct 210 ms 47880 KB Output is correct
6 Correct 257 ms 47880 KB Output is correct
7 Correct 270 ms 47880 KB Output is correct
8 Correct 258 ms 47880 KB Output is correct
9 Correct 227 ms 47880 KB Output is correct
10 Correct 207 ms 47880 KB Output is correct
11 Correct 189 ms 47880 KB Output is correct
12 Correct 226 ms 47880 KB Output is correct
13 Correct 203 ms 47880 KB Output is correct
14 Correct 269 ms 47880 KB Output is correct
15 Correct 204 ms 47880 KB Output is correct
16 Correct 188 ms 47880 KB Output is correct
17 Correct 50 ms 47880 KB Output is correct
18 Correct 73 ms 47880 KB Output is correct
19 Correct 49 ms 47880 KB Output is correct
20 Correct 47 ms 47880 KB Output is correct
21 Correct 49 ms 47880 KB Output is correct
22 Correct 48 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 47880 KB Output is correct
2 Correct 24 ms 47880 KB Output is correct
3 Correct 22 ms 47880 KB Output is correct
4 Correct 23 ms 47880 KB Output is correct
5 Correct 23 ms 47880 KB Output is correct
6 Correct 27 ms 47880 KB Output is correct
7 Correct 24 ms 47880 KB Output is correct
8 Correct 24 ms 47880 KB Output is correct
9 Correct 24 ms 47880 KB Output is correct
10 Correct 27 ms 47880 KB Output is correct
11 Correct 28 ms 47880 KB Output is correct
12 Correct 23 ms 47880 KB Output is correct
13 Correct 27 ms 47880 KB Output is correct
14 Correct 24 ms 47880 KB Output is correct
15 Correct 23 ms 47880 KB Output is correct
16 Correct 23 ms 47880 KB Output is correct
17 Correct 24 ms 47880 KB Output is correct
18 Correct 24 ms 47880 KB Output is correct
19 Correct 24 ms 47880 KB Output is correct
20 Correct 23 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 231 ms 47880 KB Output is correct
2 Correct 230 ms 47880 KB Output is correct
3 Correct 288 ms 47880 KB Output is correct
4 Correct 266 ms 47880 KB Output is correct
5 Correct 330 ms 47880 KB Output is correct
6 Correct 320 ms 47880 KB Output is correct
7 Correct 297 ms 47880 KB Output is correct
8 Correct 293 ms 47880 KB Output is correct
9 Correct 318 ms 47880 KB Output is correct
10 Correct 265 ms 47880 KB Output is correct
11 Correct 231 ms 47880 KB Output is correct
12 Correct 222 ms 47880 KB Output is correct
13 Correct 212 ms 47880 KB Output is correct
14 Correct 207 ms 47880 KB Output is correct
15 Correct 203 ms 47880 KB Output is correct
16 Correct 217 ms 47880 KB Output is correct
17 Correct 310 ms 47880 KB Output is correct
18 Correct 248 ms 47880 KB Output is correct
19 Correct 251 ms 47880 KB Output is correct
20 Correct 266 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 47880 KB Output is correct
2 Correct 25 ms 47880 KB Output is correct
3 Correct 24 ms 47880 KB Output is correct
4 Correct 26 ms 47880 KB Output is correct
5 Correct 27 ms 47880 KB Output is correct
6 Correct 22 ms 47880 KB Output is correct
7 Correct 21 ms 47880 KB Output is correct
8 Correct 22 ms 47880 KB Output is correct
9 Correct 23 ms 47880 KB Output is correct
10 Correct 22 ms 47880 KB Output is correct
11 Correct 21 ms 47880 KB Output is correct
12 Correct 22 ms 47880 KB Output is correct
13 Correct 23 ms 47880 KB Output is correct
14 Correct 22 ms 47880 KB Output is correct
15 Correct 22 ms 47880 KB Output is correct
16 Correct 21 ms 47880 KB Output is correct
17 Correct 29 ms 47880 KB Output is correct
18 Correct 26 ms 47880 KB Output is correct
19 Correct 24 ms 47880 KB Output is correct
20 Correct 25 ms 47880 KB Output is correct
21 Correct 25 ms 47880 KB Output is correct
22 Correct 30 ms 47880 KB Output is correct
23 Correct 25 ms 47880 KB Output is correct
24 Correct 22 ms 47880 KB Output is correct
25 Correct 21 ms 47880 KB Output is correct
26 Correct 21 ms 47880 KB Output is correct
27 Correct 20 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 288 ms 47880 KB Output is correct
2 Correct 278 ms 47880 KB Output is correct
3 Correct 253 ms 47880 KB Output is correct
4 Correct 225 ms 47880 KB Output is correct
5 Correct 188 ms 47880 KB Output is correct
6 Correct 196 ms 47880 KB Output is correct
7 Correct 197 ms 47880 KB Output is correct
8 Correct 159 ms 47880 KB Output is correct
9 Correct 183 ms 47880 KB Output is correct
10 Correct 182 ms 47880 KB Output is correct
11 Correct 175 ms 47880 KB Output is correct
12 Correct 192 ms 47880 KB Output is correct
13 Correct 181 ms 47880 KB Output is correct
14 Correct 215 ms 47880 KB Output is correct
15 Correct 277 ms 47880 KB Output is correct
16 Correct 268 ms 47880 KB Output is correct
17 Correct 207 ms 47880 KB Output is correct
18 Correct 341 ms 47880 KB Output is correct
19 Correct 205 ms 47880 KB Output is correct
20 Correct 240 ms 47880 KB Output is correct
21 Correct 231 ms 47880 KB Output is correct
22 Correct 176 ms 47880 KB Output is correct
23 Correct 208 ms 47880 KB Output is correct
24 Correct 231 ms 47880 KB Output is correct
25 Correct 254 ms 47880 KB Output is correct
26 Correct 201 ms 47880 KB Output is correct
27 Correct 265 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 23800 KB Output is correct
2 Correct 28 ms 23912 KB Output is correct
3 Correct 24 ms 23912 KB Output is correct
4 Correct 26 ms 23988 KB Output is correct
5 Correct 24 ms 23988 KB Output is correct
6 Correct 27 ms 23988 KB Output is correct
7 Correct 27 ms 23988 KB Output is correct
8 Correct 22 ms 24036 KB Output is correct
9 Correct 23 ms 24036 KB Output is correct
10 Correct 22 ms 24036 KB Output is correct
11 Correct 24 ms 24036 KB Output is correct
12 Correct 26 ms 24036 KB Output is correct
13 Correct 24 ms 24036 KB Output is correct
14 Correct 24 ms 24036 KB Output is correct
15 Correct 23 ms 24036 KB Output is correct
16 Correct 24 ms 24036 KB Output is correct
17 Correct 23 ms 24036 KB Output is correct
18 Correct 25 ms 24036 KB Output is correct
19 Correct 27 ms 24036 KB Output is correct
20 Correct 23 ms 24036 KB Output is correct
21 Correct 27 ms 24036 KB Output is correct
22 Correct 26 ms 24036 KB Output is correct
23 Correct 22 ms 24036 KB Output is correct
24 Correct 22 ms 24044 KB Output is correct
25 Correct 25 ms 24044 KB Output is correct
26 Correct 27 ms 24044 KB Output is correct
27 Correct 23 ms 24044 KB Output is correct
28 Correct 23 ms 24076 KB Output is correct
29 Correct 22 ms 24076 KB Output is correct
30 Correct 22 ms 24076 KB Output is correct
31 Correct 23 ms 24076 KB Output is correct
32 Correct 28 ms 24076 KB Output is correct
33 Correct 23 ms 24088 KB Output is correct
34 Correct 20 ms 24088 KB Output is correct
35 Correct 21 ms 24088 KB Output is correct
36 Correct 20 ms 24088 KB Output is correct
37 Correct 20 ms 24088 KB Output is correct
38 Correct 22 ms 24088 KB Output is correct
39 Correct 20 ms 24088 KB Output is correct
40 Correct 20 ms 24088 KB Output is correct
41 Correct 23 ms 24088 KB Output is correct
42 Correct 23 ms 24088 KB Output is correct
43 Correct 23 ms 24088 KB Output is correct
44 Correct 20 ms 24088 KB Output is correct
45 Correct 23 ms 24088 KB Output is correct
46 Correct 19 ms 24088 KB Output is correct
47 Correct 21 ms 24088 KB Output is correct
48 Correct 20 ms 24088 KB Output is correct
49 Correct 20 ms 24088 KB Output is correct
50 Correct 21 ms 24088 KB Output is correct
51 Correct 20 ms 24088 KB Output is correct
52 Correct 24 ms 24088 KB Output is correct
53 Correct 22 ms 24108 KB Output is correct
54 Correct 23 ms 24108 KB Output is correct
55 Correct 25 ms 24108 KB Output is correct
56 Correct 22 ms 24108 KB Output is correct
57 Correct 25 ms 24128 KB Output is correct
58 Correct 23 ms 24260 KB Output is correct
59 Correct 29 ms 24260 KB Output is correct
60 Correct 23 ms 24260 KB Output is correct
61 Correct 22 ms 24260 KB Output is correct
62 Correct 22 ms 24260 KB Output is correct
63 Correct 25 ms 24260 KB Output is correct
64 Correct 22 ms 24260 KB Output is correct
65 Correct 24 ms 24260 KB Output is correct
66 Correct 24 ms 47880 KB Output is correct
67 Correct 33 ms 47880 KB Output is correct
68 Correct 29 ms 47880 KB Output is correct
69 Correct 26 ms 47880 KB Output is correct
70 Correct 21 ms 47880 KB Output is correct
71 Correct 24 ms 47880 KB Output is correct
72 Correct 24 ms 47880 KB Output is correct
73 Correct 25 ms 47880 KB Output is correct
74 Correct 24 ms 47880 KB Output is correct
75 Correct 24 ms 47880 KB Output is correct
76 Correct 22 ms 47880 KB Output is correct
77 Correct 24 ms 47880 KB Output is correct
78 Correct 22 ms 47880 KB Output is correct
79 Correct 24 ms 47880 KB Output is correct
80 Correct 24 ms 47880 KB Output is correct
81 Correct 24 ms 47880 KB Output is correct
82 Correct 25 ms 47880 KB Output is correct
83 Correct 24 ms 47880 KB Output is correct
84 Correct 28 ms 47880 KB Output is correct
85 Correct 31 ms 47880 KB Output is correct
86 Correct 27 ms 47880 KB Output is correct
87 Correct 26 ms 47880 KB Output is correct
88 Correct 24 ms 47880 KB Output is correct
89 Correct 22 ms 47880 KB Output is correct
90 Correct 30 ms 47880 KB Output is correct
91 Correct 30 ms 47880 KB Output is correct
92 Correct 30 ms 47880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 23800 KB Output is correct
2 Correct 28 ms 23912 KB Output is correct
3 Correct 24 ms 23912 KB Output is correct
4 Correct 26 ms 23988 KB Output is correct
5 Correct 24 ms 23988 KB Output is correct
6 Correct 27 ms 23988 KB Output is correct
7 Correct 27 ms 23988 KB Output is correct
8 Correct 22 ms 24036 KB Output is correct
9 Correct 23 ms 24036 KB Output is correct
10 Correct 22 ms 24036 KB Output is correct
11 Correct 24 ms 24036 KB Output is correct
12 Correct 26 ms 24036 KB Output is correct
13 Correct 24 ms 24036 KB Output is correct
14 Correct 24 ms 24036 KB Output is correct
15 Correct 23 ms 24036 KB Output is correct
16 Correct 24 ms 24036 KB Output is correct
17 Correct 23 ms 24036 KB Output is correct
18 Correct 25 ms 24036 KB Output is correct
19 Correct 27 ms 24036 KB Output is correct
20 Correct 23 ms 24036 KB Output is correct
21 Correct 27 ms 24036 KB Output is correct
22 Correct 26 ms 24036 KB Output is correct
23 Correct 22 ms 24036 KB Output is correct
24 Correct 22 ms 24044 KB Output is correct
25 Correct 25 ms 24044 KB Output is correct
26 Correct 27 ms 24044 KB Output is correct
27 Correct 23 ms 24044 KB Output is correct
28 Correct 23 ms 24076 KB Output is correct
29 Correct 22 ms 24076 KB Output is correct
30 Correct 22 ms 24076 KB Output is correct
31 Correct 23 ms 24076 KB Output is correct
32 Correct 28 ms 24076 KB Output is correct
33 Correct 23 ms 24088 KB Output is correct
34 Correct 20 ms 24088 KB Output is correct
35 Correct 21 ms 24088 KB Output is correct
36 Correct 20 ms 24088 KB Output is correct
37 Correct 20 ms 24088 KB Output is correct
38 Correct 22 ms 24088 KB Output is correct
39 Correct 20 ms 24088 KB Output is correct
40 Correct 20 ms 24088 KB Output is correct
41 Correct 23 ms 24088 KB Output is correct
42 Correct 23 ms 24088 KB Output is correct
43 Correct 23 ms 24088 KB Output is correct
44 Correct 20 ms 24088 KB Output is correct
45 Correct 23 ms 24088 KB Output is correct
46 Correct 19 ms 24088 KB Output is correct
47 Correct 21 ms 24088 KB Output is correct
48 Correct 20 ms 24088 KB Output is correct
49 Correct 20 ms 24088 KB Output is correct
50 Correct 21 ms 24088 KB Output is correct
51 Correct 20 ms 24088 KB Output is correct
52 Correct 24 ms 24088 KB Output is correct
53 Correct 22 ms 24108 KB Output is correct
54 Correct 23 ms 24108 KB Output is correct
55 Correct 25 ms 24108 KB Output is correct
56 Correct 22 ms 24108 KB Output is correct
57 Correct 25 ms 24128 KB Output is correct
58 Correct 23 ms 24260 KB Output is correct
59 Correct 29 ms 24260 KB Output is correct
60 Correct 23 ms 24260 KB Output is correct
61 Correct 22 ms 24260 KB Output is correct
62 Correct 22 ms 24260 KB Output is correct
63 Correct 25 ms 24260 KB Output is correct
64 Correct 22 ms 24260 KB Output is correct
65 Correct 24 ms 24260 KB Output is correct
66 Correct 188 ms 47748 KB Output is correct
67 Correct 212 ms 47880 KB Output is correct
68 Correct 232 ms 47880 KB Output is correct
69 Correct 190 ms 47880 KB Output is correct
70 Correct 210 ms 47880 KB Output is correct
71 Correct 257 ms 47880 KB Output is correct
72 Correct 270 ms 47880 KB Output is correct
73 Correct 258 ms 47880 KB Output is correct
74 Correct 227 ms 47880 KB Output is correct
75 Correct 207 ms 47880 KB Output is correct
76 Correct 189 ms 47880 KB Output is correct
77 Correct 226 ms 47880 KB Output is correct
78 Correct 203 ms 47880 KB Output is correct
79 Correct 269 ms 47880 KB Output is correct
80 Correct 204 ms 47880 KB Output is correct
81 Correct 188 ms 47880 KB Output is correct
82 Correct 50 ms 47880 KB Output is correct
83 Correct 73 ms 47880 KB Output is correct
84 Correct 49 ms 47880 KB Output is correct
85 Correct 47 ms 47880 KB Output is correct
86 Correct 49 ms 47880 KB Output is correct
87 Correct 48 ms 47880 KB Output is correct
88 Correct 28 ms 47880 KB Output is correct
89 Correct 24 ms 47880 KB Output is correct
90 Correct 22 ms 47880 KB Output is correct
91 Correct 23 ms 47880 KB Output is correct
92 Correct 23 ms 47880 KB Output is correct
93 Correct 27 ms 47880 KB Output is correct
94 Correct 24 ms 47880 KB Output is correct
95 Correct 24 ms 47880 KB Output is correct
96 Correct 24 ms 47880 KB Output is correct
97 Correct 27 ms 47880 KB Output is correct
98 Correct 28 ms 47880 KB Output is correct
99 Correct 23 ms 47880 KB Output is correct
100 Correct 27 ms 47880 KB Output is correct
101 Correct 24 ms 47880 KB Output is correct
102 Correct 23 ms 47880 KB Output is correct
103 Correct 23 ms 47880 KB Output is correct
104 Correct 24 ms 47880 KB Output is correct
105 Correct 24 ms 47880 KB Output is correct
106 Correct 24 ms 47880 KB Output is correct
107 Correct 23 ms 47880 KB Output is correct
108 Correct 231 ms 47880 KB Output is correct
109 Correct 230 ms 47880 KB Output is correct
110 Correct 288 ms 47880 KB Output is correct
111 Correct 266 ms 47880 KB Output is correct
112 Correct 330 ms 47880 KB Output is correct
113 Correct 320 ms 47880 KB Output is correct
114 Correct 297 ms 47880 KB Output is correct
115 Correct 293 ms 47880 KB Output is correct
116 Correct 318 ms 47880 KB Output is correct
117 Correct 265 ms 47880 KB Output is correct
118 Correct 231 ms 47880 KB Output is correct
119 Correct 222 ms 47880 KB Output is correct
120 Correct 212 ms 47880 KB Output is correct
121 Correct 207 ms 47880 KB Output is correct
122 Correct 203 ms 47880 KB Output is correct
123 Correct 217 ms 47880 KB Output is correct
124 Correct 310 ms 47880 KB Output is correct
125 Correct 248 ms 47880 KB Output is correct
126 Correct 251 ms 47880 KB Output is correct
127 Correct 266 ms 47880 KB Output is correct
128 Correct 24 ms 47880 KB Output is correct
129 Correct 25 ms 47880 KB Output is correct
130 Correct 24 ms 47880 KB Output is correct
131 Correct 26 ms 47880 KB Output is correct
132 Correct 27 ms 47880 KB Output is correct
133 Correct 22 ms 47880 KB Output is correct
134 Correct 21 ms 47880 KB Output is correct
135 Correct 22 ms 47880 KB Output is correct
136 Correct 23 ms 47880 KB Output is correct
137 Correct 22 ms 47880 KB Output is correct
138 Correct 21 ms 47880 KB Output is correct
139 Correct 22 ms 47880 KB Output is correct
140 Correct 23 ms 47880 KB Output is correct
141 Correct 22 ms 47880 KB Output is correct
142 Correct 22 ms 47880 KB Output is correct
143 Correct 21 ms 47880 KB Output is correct
144 Correct 29 ms 47880 KB Output is correct
145 Correct 26 ms 47880 KB Output is correct
146 Correct 24 ms 47880 KB Output is correct
147 Correct 25 ms 47880 KB Output is correct
148 Correct 25 ms 47880 KB Output is correct
149 Correct 30 ms 47880 KB Output is correct
150 Correct 25 ms 47880 KB Output is correct
151 Correct 22 ms 47880 KB Output is correct
152 Correct 21 ms 47880 KB Output is correct
153 Correct 21 ms 47880 KB Output is correct
154 Correct 20 ms 47880 KB Output is correct
155 Correct 288 ms 47880 KB Output is correct
156 Correct 278 ms 47880 KB Output is correct
157 Correct 253 ms 47880 KB Output is correct
158 Correct 225 ms 47880 KB Output is correct
159 Correct 188 ms 47880 KB Output is correct
160 Correct 196 ms 47880 KB Output is correct
161 Correct 197 ms 47880 KB Output is correct
162 Correct 159 ms 47880 KB Output is correct
163 Correct 183 ms 47880 KB Output is correct
164 Correct 182 ms 47880 KB Output is correct
165 Correct 175 ms 47880 KB Output is correct
166 Correct 192 ms 47880 KB Output is correct
167 Correct 181 ms 47880 KB Output is correct
168 Correct 215 ms 47880 KB Output is correct
169 Correct 277 ms 47880 KB Output is correct
170 Correct 268 ms 47880 KB Output is correct
171 Correct 207 ms 47880 KB Output is correct
172 Correct 341 ms 47880 KB Output is correct
173 Correct 205 ms 47880 KB Output is correct
174 Correct 240 ms 47880 KB Output is correct
175 Correct 231 ms 47880 KB Output is correct
176 Correct 176 ms 47880 KB Output is correct
177 Correct 208 ms 47880 KB Output is correct
178 Correct 231 ms 47880 KB Output is correct
179 Correct 254 ms 47880 KB Output is correct
180 Correct 201 ms 47880 KB Output is correct
181 Correct 265 ms 47880 KB Output is correct
182 Correct 24 ms 47880 KB Output is correct
183 Correct 33 ms 47880 KB Output is correct
184 Correct 29 ms 47880 KB Output is correct
185 Correct 26 ms 47880 KB Output is correct
186 Correct 21 ms 47880 KB Output is correct
187 Correct 24 ms 47880 KB Output is correct
188 Correct 24 ms 47880 KB Output is correct
189 Correct 25 ms 47880 KB Output is correct
190 Correct 24 ms 47880 KB Output is correct
191 Correct 24 ms 47880 KB Output is correct
192 Correct 22 ms 47880 KB Output is correct
193 Correct 24 ms 47880 KB Output is correct
194 Correct 22 ms 47880 KB Output is correct
195 Correct 24 ms 47880 KB Output is correct
196 Correct 24 ms 47880 KB Output is correct
197 Correct 24 ms 47880 KB Output is correct
198 Correct 25 ms 47880 KB Output is correct
199 Correct 24 ms 47880 KB Output is correct
200 Correct 28 ms 47880 KB Output is correct
201 Correct 31 ms 47880 KB Output is correct
202 Correct 27 ms 47880 KB Output is correct
203 Correct 26 ms 47880 KB Output is correct
204 Correct 24 ms 47880 KB Output is correct
205 Correct 22 ms 47880 KB Output is correct
206 Correct 30 ms 47880 KB Output is correct
207 Correct 30 ms 47880 KB Output is correct
208 Correct 30 ms 47880 KB Output is correct
209 Correct 66 ms 47880 KB Output is correct
210 Correct 189 ms 47880 KB Output is correct
211 Correct 247 ms 47880 KB Output is correct
212 Correct 265 ms 47880 KB Output is correct
213 Correct 284 ms 49880 KB Output is correct
214 Correct 115 ms 49880 KB Output is correct
215 Correct 109 ms 49880 KB Output is correct
216 Correct 256 ms 49880 KB Output is correct
217 Correct 279 ms 49880 KB Output is correct
218 Correct 215 ms 49880 KB Output is correct
219 Correct 175 ms 49880 KB Output is correct
220 Correct 218 ms 51100 KB Output is correct
221 Correct 202 ms 52432 KB Output is correct
222 Correct 188 ms 55424 KB Output is correct
223 Correct 255 ms 60812 KB Output is correct
224 Correct 231 ms 61380 KB Output is correct
225 Correct 213 ms 61380 KB Output is correct
226 Correct 216 ms 61836 KB Output is correct
227 Correct 193 ms 63580 KB Output is correct
228 Correct 216 ms 64784 KB Output is correct
229 Correct 154 ms 65776 KB Output is correct
230 Correct 218 ms 68676 KB Output is correct
231 Correct 216 ms 68796 KB Output is correct