답안 #789322

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
789322 2023-07-21T09:14:07 Z Johann Council (JOI23_council) C++14
100 / 100
2390 ms 236928 KB
#include "bits/stdc++.h"
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
pii operator+(const pii &a, const pii &b) { return {a.first + b.first, a.second + b.second}; }
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

int N, M;
vvi A;
vi votes;
int vr; // votes required
vi trans, transR;

struct node
{
    bool state;
    node *par = nullptr;
    node *next[2] = {nullptr, nullptr};
    vpii result;
};
void addRes(node *n, pii res)
{
    for (int i = 0; i < 2; ++i)
        if (n->result[i] < res)
            swap(n->result[i], res);
}
struct Trie
{
    vector<vector<node *>> layers;
    node *root;
    void init()
    {
        layers.resize(M + 1);
        root = new node();
        root->result.assign(2, {-1, -1});
        layers[0].push_back(root);
    }
    void insert(int v, pii id)
    {
        insert(v, id, 0, root);
    }
    void insert(int v, pii id, int idx, node *n)
    {
        if (idx == M)
        {
            addRes(n, id);
            return;
        }
        int st = (v >> idx) & 1;
        if (n->next[st] == nullptr)
        {
            n->next[st] = new node();
            n->next[st]->par = n;
            n->next[st]->state = st;
            n->next[st]->result.assign(2, {-1, -1});
            layers[idx + 1].push_back(n->next[st]);
        }
        insert(v, id, idx + 1, n->next[st]);
    }
    node *query(int v) { return query(v, 0, root); }
    node *query(int v, int idx, node *n)
    {
        if (n == nullptr)
            return nullptr;
        if (idx == M)
            return n;
        int st = (v >> idx) & 1;
        return query(v, idx + 1, n->next[st]);
    }
};
Trie Tid; // Tid
Trie Tma; // matching
const pii add1 = {1, 0};

void cleanuplayer(int idx)
{
    for (node *n : Tma.layers[M - idx])
        n->result.assign(2, {-1, -1});
}
void dfs(node *nid, int idx)
{
    // idx := layer in tid
    // M - idx := corespoding layer in Tma
    if (idx == M)
    {
        nid->result = Tma.layers[M - idx][0]->result;
    }
    else
    {
        for (int i = 0; i < 2; ++i)
        {
            if (nid->next[i] == nullptr)
                continue;

            for (node *n : Tma.layers[M - idx])
            {
                for (pii p : n->result)
                {
                    if (p.first == -1)
                        continue;
                    if (votes[idx] - i - n->state >= vr)
                        addRes(n->par, p + add1);
                    else
                        addRes(n->par, p);
                }
            }
            dfs(nid->next[i], idx + 1);

            cleanuplayer(idx + 1);
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> N >> M;
    vr = N / 2;

    A.assign(N, vi(M));
    votes.assign(M, 0);
    trans.assign(N, 0);
    transR.assign(N, 0);
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < M; ++j)
        {
            cin >> A[i][j];
            votes[j] += A[i][j];
            trans[i] |= (A[i][j]) ? (1 << j) : 0;
            transR[i] |= (A[i][j]) ? (1 << (M - 1 - j)) : 0;
        }
    }

    Tid.init();
    Tma.init();
    for (int i = 0; i < N; ++i)
        Tid.insert(trans[i], {-1, -1}), Tma.insert(transR[i], {0, i});

    dfs(Tid.root, 0);

    for (int i = 0; i < N; ++i)
    {
        node *tmp = Tid.query(trans[i]);
        if (tmp->result[0].second != i)
            cout << tmp->result[0].first << "\n";
        else
            cout << tmp->result[1].first << "\n";
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1108 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 11 ms 1216 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 228 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 320 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 320 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 316 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 320 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 452 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1108 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 11 ms 1216 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 228 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 320 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 320 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 316 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 320 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 452 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 4 ms 724 KB Output is correct
52 Correct 3 ms 816 KB Output is correct
53 Correct 145 ms 6772 KB Output is correct
54 Correct 227 ms 6760 KB Output is correct
55 Correct 1 ms 456 KB Output is correct
56 Correct 53 ms 4784 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 65 ms 20880 KB Output is correct
3 Correct 58 ms 20784 KB Output is correct
4 Correct 44 ms 20236 KB Output is correct
5 Correct 64 ms 20764 KB Output is correct
6 Correct 45 ms 20284 KB Output is correct
7 Correct 58 ms 20852 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 316 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 65 ms 20880 KB Output is correct
3 Correct 58 ms 20784 KB Output is correct
4 Correct 44 ms 20236 KB Output is correct
5 Correct 64 ms 20764 KB Output is correct
6 Correct 45 ms 20284 KB Output is correct
7 Correct 58 ms 20852 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 316 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 320 KB Output is correct
19 Correct 1 ms 320 KB Output is correct
20 Correct 183 ms 30412 KB Output is correct
21 Correct 166 ms 29676 KB Output is correct
22 Correct 161 ms 29772 KB Output is correct
23 Correct 159 ms 30560 KB Output is correct
24 Correct 155 ms 30184 KB Output is correct
25 Correct 184 ms 30580 KB Output is correct
26 Correct 182 ms 30696 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 304 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 468 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 65 ms 20880 KB Output is correct
3 Correct 58 ms 20784 KB Output is correct
4 Correct 44 ms 20236 KB Output is correct
5 Correct 64 ms 20764 KB Output is correct
6 Correct 45 ms 20284 KB Output is correct
7 Correct 58 ms 20852 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 316 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 320 KB Output is correct
19 Correct 1 ms 320 KB Output is correct
20 Correct 183 ms 30412 KB Output is correct
21 Correct 166 ms 29676 KB Output is correct
22 Correct 161 ms 29772 KB Output is correct
23 Correct 159 ms 30560 KB Output is correct
24 Correct 155 ms 30184 KB Output is correct
25 Correct 184 ms 30580 KB Output is correct
26 Correct 182 ms 30696 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 304 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 468 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 468 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 303 ms 39868 KB Output is correct
48 Correct 246 ms 37952 KB Output is correct
49 Correct 247 ms 37944 KB Output is correct
50 Correct 241 ms 37568 KB Output is correct
51 Correct 208 ms 37236 KB Output is correct
52 Correct 309 ms 44092 KB Output is correct
53 Correct 289 ms 44160 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 65 ms 20880 KB Output is correct
3 Correct 58 ms 20784 KB Output is correct
4 Correct 44 ms 20236 KB Output is correct
5 Correct 64 ms 20764 KB Output is correct
6 Correct 45 ms 20284 KB Output is correct
7 Correct 58 ms 20852 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 316 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 316 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 320 KB Output is correct
19 Correct 1 ms 320 KB Output is correct
20 Correct 183 ms 30412 KB Output is correct
21 Correct 166 ms 29676 KB Output is correct
22 Correct 161 ms 29772 KB Output is correct
23 Correct 159 ms 30560 KB Output is correct
24 Correct 155 ms 30184 KB Output is correct
25 Correct 184 ms 30580 KB Output is correct
26 Correct 182 ms 30696 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 304 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 468 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 468 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 303 ms 39868 KB Output is correct
48 Correct 246 ms 37952 KB Output is correct
49 Correct 247 ms 37944 KB Output is correct
50 Correct 241 ms 37568 KB Output is correct
51 Correct 208 ms 37236 KB Output is correct
52 Correct 309 ms 44092 KB Output is correct
53 Correct 289 ms 44160 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 395 ms 61792 KB Output is correct
60 Correct 369 ms 65392 KB Output is correct
61 Correct 377 ms 69052 KB Output is correct
62 Correct 410 ms 70896 KB Output is correct
63 Correct 366 ms 53144 KB Output is correct
64 Correct 459 ms 61308 KB Output is correct
65 Correct 468 ms 61192 KB Output is correct
66 Correct 260 ms 44048 KB Output is correct
67 Correct 248 ms 43672 KB Output is correct
68 Correct 716 ms 94228 KB Output is correct
69 Correct 776 ms 94480 KB Output is correct
70 Correct 1 ms 316 KB Output is correct
71 Correct 0 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 2 ms 340 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 51 ms 4784 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1108 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 11 ms 1216 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 228 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 320 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 320 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 468 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 316 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 320 KB Output is correct
38 Correct 1 ms 316 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 452 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 4 ms 724 KB Output is correct
52 Correct 3 ms 816 KB Output is correct
53 Correct 145 ms 6772 KB Output is correct
54 Correct 227 ms 6760 KB Output is correct
55 Correct 1 ms 456 KB Output is correct
56 Correct 53 ms 4784 KB Output is correct
57 Correct 1 ms 212 KB Output is correct
58 Correct 65 ms 20880 KB Output is correct
59 Correct 58 ms 20784 KB Output is correct
60 Correct 44 ms 20236 KB Output is correct
61 Correct 64 ms 20764 KB Output is correct
62 Correct 45 ms 20284 KB Output is correct
63 Correct 58 ms 20852 KB Output is correct
64 Correct 1 ms 324 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 316 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 316 KB Output is correct
73 Correct 1 ms 452 KB Output is correct
74 Correct 1 ms 320 KB Output is correct
75 Correct 1 ms 320 KB Output is correct
76 Correct 183 ms 30412 KB Output is correct
77 Correct 166 ms 29676 KB Output is correct
78 Correct 161 ms 29772 KB Output is correct
79 Correct 159 ms 30560 KB Output is correct
80 Correct 155 ms 30184 KB Output is correct
81 Correct 184 ms 30580 KB Output is correct
82 Correct 182 ms 30696 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 0 ms 212 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 304 KB Output is correct
89 Correct 1 ms 340 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 468 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 1 ms 316 KB Output is correct
95 Correct 1 ms 212 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 340 KB Output is correct
101 Correct 1 ms 468 KB Output is correct
102 Correct 1 ms 212 KB Output is correct
103 Correct 303 ms 39868 KB Output is correct
104 Correct 246 ms 37952 KB Output is correct
105 Correct 247 ms 37944 KB Output is correct
106 Correct 241 ms 37568 KB Output is correct
107 Correct 208 ms 37236 KB Output is correct
108 Correct 309 ms 44092 KB Output is correct
109 Correct 289 ms 44160 KB Output is correct
110 Correct 1 ms 340 KB Output is correct
111 Correct 1 ms 340 KB Output is correct
112 Correct 1 ms 340 KB Output is correct
113 Correct 1 ms 340 KB Output is correct
114 Correct 1 ms 340 KB Output is correct
115 Correct 395 ms 61792 KB Output is correct
116 Correct 369 ms 65392 KB Output is correct
117 Correct 377 ms 69052 KB Output is correct
118 Correct 410 ms 70896 KB Output is correct
119 Correct 366 ms 53144 KB Output is correct
120 Correct 459 ms 61308 KB Output is correct
121 Correct 468 ms 61192 KB Output is correct
122 Correct 260 ms 44048 KB Output is correct
123 Correct 248 ms 43672 KB Output is correct
124 Correct 716 ms 94228 KB Output is correct
125 Correct 776 ms 94480 KB Output is correct
126 Correct 1 ms 316 KB Output is correct
127 Correct 0 ms 340 KB Output is correct
128 Correct 1 ms 340 KB Output is correct
129 Correct 2 ms 340 KB Output is correct
130 Correct 1 ms 340 KB Output is correct
131 Correct 51 ms 4784 KB Output is correct
132 Correct 2013 ms 200208 KB Output is correct
133 Correct 2061 ms 200036 KB Output is correct
134 Correct 2158 ms 211564 KB Output is correct
135 Correct 2154 ms 194032 KB Output is correct
136 Correct 1941 ms 172776 KB Output is correct
137 Correct 1177 ms 114280 KB Output is correct
138 Correct 1159 ms 114432 KB Output is correct
139 Correct 293 ms 50416 KB Output is correct
140 Correct 285 ms 50156 KB Output is correct
141 Correct 2327 ms 236640 KB Output is correct
142 Correct 2390 ms 236928 KB Output is correct