답안 #624860

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
624860 2022-08-08T21:49:47 Z boris_mihov Jail (JOI22_jail) C++14
100 / 100
1028 ms 82740 KB
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

typedef long long llong;
const int MAXN = 120000 + 10;
const int INF  = 2e9;

int n, q;
int vis[10 * MAXN];
int sz[MAXN], head[MAXN];
int from[MAXN], to[MAXN];
int depth[MAXN], inS[MAXN], inE[MAXN];
int parent[MAXN], heavy[MAXN];
int start[MAXN], end[MAXN];
int in[MAXN], out[MAXN], timer;
std::vector <int> g[MAXN];
std::vector <int> v[10 * MAXN];
std::vector <int> chainS, chainE;

inline bool inSubtree(int x, int y)
{
    return in[y] <= in[x] && in[x] <= out[y];
}

void dfs(int node, int p)
{
    in[node] = ++timer;
    parent[node] = p;
    depth[node] = depth[p] + 1;
    sz[node] = 1;

    for (const int &i : g[node])
    {
        if (i == p) continue;
        dfs(i, node);
        sz[node] += sz[i];
        if (sz[i] > sz[heavy[node]])
        {
            heavy[node] = i;
        }
    }

    out[node] = ++timer;
}

void decompose(int node, int h)
{
    head[node] = h;
    if (start[node] != 0) chainS.push_back(start[node]);
    if (end[node] != 0) chainE.push_back(end[node]);
    inS[node] = chainS.size() - 1;
    inE[node] = chainE.size() - 1;
    if (heavy[node] != 0) decompose(heavy[node], h);

    for (const int &i : g[node])
    {
        if (i == parent[node] || i == heavy[node]) continue;
        decompose(i, i);
    }
}

int treeS[4 * MAXN];
int treeE[4 * MAXN];
int cnt;

void buildS(int l, int r, int node)
{
    if (l == r)
    {
        treeS[node] = chainS[l];
        return;
    }

    treeS[node] = ++cnt;
    int mid = (l + r) / 2;
    buildS(l, mid, 2*node);
    buildS(mid + 1, r, 2*node + 1);
    v[treeS[2*node]].push_back(treeS[node]);
    v[treeS[2*node + 1]].push_back(treeS[node]);
}

void buildE(int l, int r, int node)
{
    if (l == r)
    {
        treeE[node] = chainE[l];
        return;
    }

    treeE[node] = ++cnt;
    int mid = (l + r) / 2;
    buildE(l, mid, 2*node);
    buildE(mid + 1, r, 2*node + 1);
    v[treeE[node]].push_back(treeE[2*node]);
    v[treeE[node]].push_back(treeE[2*node + 1]);
}

void addEdgesS(int l, int r, int node, int queryL, int queryR, int fromNode)
{
    if (queryL <= l && r <= queryR)
    {
        v[treeS[node]].push_back(fromNode);
        return;
    }

    int mid = (l + r) / 2;
    if (queryL <= mid) addEdgesS(l, mid, 2*node, queryL, queryR, fromNode);
    if (mid + 1 <= queryR) addEdgesS(mid + 1, r, 2*node + 1, queryL, queryR, fromNode);
}

void addEdgesE(int l, int r, int node, int queryL, int queryR, int fromNode)
{
    if (queryL <= l && r <= queryR)
    {
        v[fromNode].push_back(treeE[node]);
        return;
    }

    int mid = (l + r) / 2;
    if (queryL <= mid) addEdgesE(l, mid, 2*node, queryL, queryR, fromNode);
    if (mid + 1 <= queryR) addEdgesE(mid + 1, r, 2*node + 1, queryL, queryR, fromNode);
}

void hldAddS(int x, int y, int node)
{
    while (head[x] != head[y])
    {
        if (depth[head[x]] <= depth[head[y]]) std::swap(x, y);
        int addFrom = inS[head[x]];
        int addTo = inS[x];
        if (start[head[x]] == 0) ++addFrom;
        if (addFrom >= 0 && addFrom <= addTo) addEdgesS(0, chainS.size()-1, 1, addFrom, addTo, node);
        x = parent[head[x]];
    }

    if (depth[x] > depth[y]) std::swap(x, y);
    int addFrom = inS[x];
    int addTo = inS[y];
    if (start[x] == 0) ++addFrom;
    if (addFrom >= 0 && addFrom <= addTo) addEdgesS(0, chainS.size()-1, 1, addFrom, addTo, node);
}

void hldAddE(int x, int y, int node)
{
    while (head[x] != head[y])
    {
        if (depth[head[x]] <= depth[head[y]]) std::swap(x, y);
        int addFrom = inE[head[x]];
        int addTo = inE[x];
        if (end[head[x]] == 0) ++addFrom;
        if (addFrom >= 0 && addFrom <= addTo) addEdgesE(0, chainE.size()-1, 1, addFrom, addTo, node);
        x = parent[head[x]];
    }

    if (depth[x] > depth[y]) std::swap(x, y);
    int addFrom = inE[x];
    int addTo = inE[y];
    if (end[x] == 0) ++addFrom;
    if (addFrom >= 0 && addFrom <= addTo) addEdgesE(0, chainE.size()-1, 1, addFrom, addTo, node);
}

bool findCycle(int node)
{
    vis[node] = 1;
    for (const int &i : v[node])
    {
        if (vis[i] == 2) continue;
        if (vis[i] == 1) return true;
        if (findCycle(i)) return true;
    }

    vis[node] = 2;
    return false;
}

void solve()
{
    dfs(1, 0);
    decompose(1, 1); cnt = q;
    buildS(0, chainS.size()-1, 1);
    buildE(0, chainE.size()-1, 1);

    for (int i = 1 ; i <= q ; ++i)
    {
        if (from[i] == to[i]) continue;
        if (!inSubtree(to[i], from[i])) 
        {
            hldAddS(parent[from[i]], to[i], i);
        }
        else
        {
            for (const int &neigh : g[from[i]])
            {
                if (neigh == parent[from[i]]) continue;
                if (inSubtree(to[i], neigh))
                {
                    hldAddS(neigh, to[i], i);
                    break;
                }
            }
        }

        if (!inSubtree(from[i], to[i])) 
        {
            hldAddE(from[i], parent[to[i]], i);
        }
        else
        {
            for (const int &neigh : g[to[i]])
            {
                if (neigh == parent[to[i]]) continue;
                if (inSubtree(from[i], neigh))
                {
                    hldAddE(from[i], neigh, i);
                    break;
                }
            }
        }
    }

    for (int i = 1 ; i <= cnt ; ++i)
    {
        if (vis[i] == 2) continue;
        if (findCycle(i))
        {
            std::cout << "No\n";
            return;
        }
    }

    std::cout << "Yes\n";
}

void read()
{
    int x, y;
    std::cin >> n;
    for (int i = 2 ; i <= n ; ++i)
    {
        std::cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    std::cin >> q;
    for (int i = 1 ; i <= q ; ++i)
    {
        std::cin >> from[i] >> to[i];
        start[from[i]] = i;
        end[to[i]] = i;
    }
}

void reset()
{
    for (int i = 1 ; i <= cnt ; ++i)
    {
        v[i].clear();
        vis[i] = 0;
    }

    timer = 0;
    chainS.clear();
    chainE.clear();
    for (int i = 1 ; i <= n ; ++i)
    {
        in[i] = 0;
        out[i] = 0;
        g[i].clear();
        start[i] = 0;
        end[i] = 0;
        sz[i] = 0;
        head[i] = 0;
        from[i] = 0;
        to[i] = 0;
        depth[i] = 0;
        inS[i] = 0;
        inE[i] = 0;
        parent[i] = 0;
        heavy[i] = 0;
        start[i] = 0;
        end[i] = 0;
        in[i] = 0;
        out[i] = 0;
    }
}

void fastIO()
{
    std::ios_base :: sync_with_stdio(0);
    std::cout.tie(nullptr);
    std::cin.tie(nullptr);
}

int tests;
int main()
{
    fastIO();
    std::cin >> tests;

    while (tests--)
    {
        reset();
        read();
        solve();
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 31316 KB Output is correct
2 Correct 16 ms 31292 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 21 ms 31424 KB Output is correct
5 Correct 32 ms 31400 KB Output is correct
6 Correct 17 ms 31316 KB Output is correct
7 Correct 16 ms 31436 KB Output is correct
8 Correct 18 ms 31456 KB Output is correct
9 Correct 40 ms 32412 KB Output is correct
10 Correct 50 ms 46820 KB Output is correct
11 Correct 19 ms 31316 KB Output is correct
12 Correct 46 ms 31428 KB Output is correct
13 Correct 127 ms 57180 KB Output is correct
14 Correct 96 ms 56784 KB Output is correct
15 Correct 191 ms 61816 KB Output is correct
16 Correct 450 ms 82568 KB Output is correct
17 Correct 110 ms 59972 KB Output is correct
18 Correct 126 ms 64416 KB Output is correct
19 Correct 116 ms 61440 KB Output is correct
20 Correct 116 ms 61004 KB Output is correct
21 Correct 134 ms 64392 KB Output is correct
22 Correct 70 ms 55336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 31316 KB Output is correct
2 Correct 19 ms 31356 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 17 ms 31420 KB Output is correct
5 Correct 17 ms 31368 KB Output is correct
6 Correct 20 ms 31316 KB Output is correct
7 Correct 17 ms 31384 KB Output is correct
8 Correct 17 ms 31412 KB Output is correct
9 Correct 17 ms 31316 KB Output is correct
10 Correct 17 ms 31316 KB Output is correct
11 Correct 16 ms 31376 KB Output is correct
12 Correct 16 ms 31316 KB Output is correct
13 Correct 17 ms 31428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 31316 KB Output is correct
2 Correct 19 ms 31356 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 17 ms 31420 KB Output is correct
5 Correct 17 ms 31368 KB Output is correct
6 Correct 20 ms 31316 KB Output is correct
7 Correct 17 ms 31384 KB Output is correct
8 Correct 17 ms 31412 KB Output is correct
9 Correct 17 ms 31316 KB Output is correct
10 Correct 17 ms 31316 KB Output is correct
11 Correct 16 ms 31376 KB Output is correct
12 Correct 16 ms 31316 KB Output is correct
13 Correct 17 ms 31428 KB Output is correct
14 Correct 17 ms 31352 KB Output is correct
15 Correct 19 ms 31380 KB Output is correct
16 Correct 23 ms 31408 KB Output is correct
17 Correct 17 ms 31384 KB Output is correct
18 Correct 17 ms 31328 KB Output is correct
19 Correct 17 ms 31400 KB Output is correct
20 Correct 18 ms 31316 KB Output is correct
21 Correct 17 ms 31364 KB Output is correct
22 Correct 17 ms 31316 KB Output is correct
23 Correct 16 ms 31384 KB Output is correct
24 Correct 17 ms 31416 KB Output is correct
25 Correct 19 ms 31412 KB Output is correct
26 Correct 17 ms 31428 KB Output is correct
27 Correct 18 ms 31316 KB Output is correct
28 Correct 18 ms 31416 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 31316 KB Output is correct
2 Correct 19 ms 31356 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 17 ms 31420 KB Output is correct
5 Correct 17 ms 31368 KB Output is correct
6 Correct 20 ms 31316 KB Output is correct
7 Correct 17 ms 31384 KB Output is correct
8 Correct 17 ms 31412 KB Output is correct
9 Correct 17 ms 31316 KB Output is correct
10 Correct 17 ms 31316 KB Output is correct
11 Correct 16 ms 31376 KB Output is correct
12 Correct 16 ms 31316 KB Output is correct
13 Correct 17 ms 31428 KB Output is correct
14 Correct 17 ms 31352 KB Output is correct
15 Correct 19 ms 31380 KB Output is correct
16 Correct 23 ms 31408 KB Output is correct
17 Correct 17 ms 31384 KB Output is correct
18 Correct 17 ms 31328 KB Output is correct
19 Correct 17 ms 31400 KB Output is correct
20 Correct 18 ms 31316 KB Output is correct
21 Correct 17 ms 31364 KB Output is correct
22 Correct 17 ms 31316 KB Output is correct
23 Correct 16 ms 31384 KB Output is correct
24 Correct 17 ms 31416 KB Output is correct
25 Correct 19 ms 31412 KB Output is correct
26 Correct 17 ms 31428 KB Output is correct
27 Correct 18 ms 31316 KB Output is correct
28 Correct 18 ms 31416 KB Output is correct
29 Correct 17 ms 31444 KB Output is correct
30 Correct 17 ms 31428 KB Output is correct
31 Correct 17 ms 31348 KB Output is correct
32 Correct 18 ms 31316 KB Output is correct
33 Correct 17 ms 31432 KB Output is correct
34 Correct 18 ms 31444 KB Output is correct
35 Correct 18 ms 31444 KB Output is correct
36 Correct 17 ms 31444 KB Output is correct
37 Correct 20 ms 31444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 31316 KB Output is correct
2 Correct 19 ms 31356 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 17 ms 31420 KB Output is correct
5 Correct 17 ms 31368 KB Output is correct
6 Correct 20 ms 31316 KB Output is correct
7 Correct 17 ms 31384 KB Output is correct
8 Correct 17 ms 31412 KB Output is correct
9 Correct 17 ms 31316 KB Output is correct
10 Correct 17 ms 31316 KB Output is correct
11 Correct 16 ms 31376 KB Output is correct
12 Correct 16 ms 31316 KB Output is correct
13 Correct 17 ms 31428 KB Output is correct
14 Correct 17 ms 31352 KB Output is correct
15 Correct 19 ms 31380 KB Output is correct
16 Correct 23 ms 31408 KB Output is correct
17 Correct 17 ms 31384 KB Output is correct
18 Correct 17 ms 31328 KB Output is correct
19 Correct 17 ms 31400 KB Output is correct
20 Correct 18 ms 31316 KB Output is correct
21 Correct 17 ms 31364 KB Output is correct
22 Correct 17 ms 31316 KB Output is correct
23 Correct 16 ms 31384 KB Output is correct
24 Correct 17 ms 31416 KB Output is correct
25 Correct 19 ms 31412 KB Output is correct
26 Correct 17 ms 31428 KB Output is correct
27 Correct 18 ms 31316 KB Output is correct
28 Correct 18 ms 31416 KB Output is correct
29 Correct 17 ms 31444 KB Output is correct
30 Correct 17 ms 31428 KB Output is correct
31 Correct 17 ms 31348 KB Output is correct
32 Correct 18 ms 31316 KB Output is correct
33 Correct 17 ms 31432 KB Output is correct
34 Correct 18 ms 31444 KB Output is correct
35 Correct 18 ms 31444 KB Output is correct
36 Correct 17 ms 31444 KB Output is correct
37 Correct 20 ms 31444 KB Output is correct
38 Correct 48 ms 32352 KB Output is correct
39 Correct 53 ms 46944 KB Output is correct
40 Correct 43 ms 32204 KB Output is correct
41 Correct 44 ms 31956 KB Output is correct
42 Correct 44 ms 32360 KB Output is correct
43 Correct 38 ms 32040 KB Output is correct
44 Correct 33 ms 31632 KB Output is correct
45 Correct 93 ms 40268 KB Output is correct
46 Correct 68 ms 40360 KB Output is correct
47 Correct 51 ms 44028 KB Output is correct
48 Correct 52 ms 44036 KB Output is correct
49 Correct 60 ms 40564 KB Output is correct
50 Correct 61 ms 40440 KB Output is correct
51 Correct 55 ms 41416 KB Output is correct
52 Correct 52 ms 41340 KB Output is correct
53 Correct 25 ms 32064 KB Output is correct
54 Correct 82 ms 40264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 31324 KB Output is correct
2 Correct 17 ms 31388 KB Output is correct
3 Correct 19 ms 31304 KB Output is correct
4 Correct 18 ms 31400 KB Output is correct
5 Correct 25 ms 31316 KB Output is correct
6 Correct 18 ms 31432 KB Output is correct
7 Correct 17 ms 31420 KB Output is correct
8 Correct 19 ms 31444 KB Output is correct
9 Correct 16 ms 31316 KB Output is correct
10 Correct 16 ms 31308 KB Output is correct
11 Correct 17 ms 31316 KB Output is correct
12 Correct 17 ms 31444 KB Output is correct
13 Correct 38 ms 31460 KB Output is correct
14 Correct 42 ms 31424 KB Output is correct
15 Correct 40 ms 31412 KB Output is correct
16 Correct 76 ms 41920 KB Output is correct
17 Correct 283 ms 52316 KB Output is correct
18 Correct 675 ms 72212 KB Output is correct
19 Correct 90 ms 43388 KB Output is correct
20 Correct 83 ms 43260 KB Output is correct
21 Correct 88 ms 43304 KB Output is correct
22 Correct 204 ms 51528 KB Output is correct
23 Correct 188 ms 50896 KB Output is correct
24 Correct 176 ms 51920 KB Output is correct
25 Correct 179 ms 51916 KB Output is correct
26 Correct 178 ms 51916 KB Output is correct
27 Correct 221 ms 58248 KB Output is correct
28 Correct 227 ms 62144 KB Output is correct
29 Correct 248 ms 59136 KB Output is correct
30 Correct 125 ms 51064 KB Output is correct
31 Correct 121 ms 51312 KB Output is correct
32 Correct 127 ms 50220 KB Output is correct
33 Correct 135 ms 51316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 31316 KB Output is correct
2 Correct 16 ms 31292 KB Output is correct
3 Correct 17 ms 31316 KB Output is correct
4 Correct 21 ms 31424 KB Output is correct
5 Correct 32 ms 31400 KB Output is correct
6 Correct 17 ms 31316 KB Output is correct
7 Correct 16 ms 31436 KB Output is correct
8 Correct 18 ms 31456 KB Output is correct
9 Correct 40 ms 32412 KB Output is correct
10 Correct 50 ms 46820 KB Output is correct
11 Correct 19 ms 31316 KB Output is correct
12 Correct 46 ms 31428 KB Output is correct
13 Correct 127 ms 57180 KB Output is correct
14 Correct 96 ms 56784 KB Output is correct
15 Correct 191 ms 61816 KB Output is correct
16 Correct 450 ms 82568 KB Output is correct
17 Correct 110 ms 59972 KB Output is correct
18 Correct 126 ms 64416 KB Output is correct
19 Correct 116 ms 61440 KB Output is correct
20 Correct 116 ms 61004 KB Output is correct
21 Correct 134 ms 64392 KB Output is correct
22 Correct 70 ms 55336 KB Output is correct
23 Correct 16 ms 31316 KB Output is correct
24 Correct 19 ms 31356 KB Output is correct
25 Correct 17 ms 31316 KB Output is correct
26 Correct 17 ms 31420 KB Output is correct
27 Correct 17 ms 31368 KB Output is correct
28 Correct 20 ms 31316 KB Output is correct
29 Correct 17 ms 31384 KB Output is correct
30 Correct 17 ms 31412 KB Output is correct
31 Correct 17 ms 31316 KB Output is correct
32 Correct 17 ms 31316 KB Output is correct
33 Correct 16 ms 31376 KB Output is correct
34 Correct 16 ms 31316 KB Output is correct
35 Correct 17 ms 31428 KB Output is correct
36 Correct 17 ms 31352 KB Output is correct
37 Correct 19 ms 31380 KB Output is correct
38 Correct 23 ms 31408 KB Output is correct
39 Correct 17 ms 31384 KB Output is correct
40 Correct 17 ms 31328 KB Output is correct
41 Correct 17 ms 31400 KB Output is correct
42 Correct 18 ms 31316 KB Output is correct
43 Correct 17 ms 31364 KB Output is correct
44 Correct 17 ms 31316 KB Output is correct
45 Correct 16 ms 31384 KB Output is correct
46 Correct 17 ms 31416 KB Output is correct
47 Correct 19 ms 31412 KB Output is correct
48 Correct 17 ms 31428 KB Output is correct
49 Correct 18 ms 31316 KB Output is correct
50 Correct 18 ms 31416 KB Output is correct
51 Correct 17 ms 31444 KB Output is correct
52 Correct 17 ms 31428 KB Output is correct
53 Correct 17 ms 31348 KB Output is correct
54 Correct 18 ms 31316 KB Output is correct
55 Correct 17 ms 31432 KB Output is correct
56 Correct 18 ms 31444 KB Output is correct
57 Correct 18 ms 31444 KB Output is correct
58 Correct 17 ms 31444 KB Output is correct
59 Correct 20 ms 31444 KB Output is correct
60 Correct 48 ms 32352 KB Output is correct
61 Correct 53 ms 46944 KB Output is correct
62 Correct 43 ms 32204 KB Output is correct
63 Correct 44 ms 31956 KB Output is correct
64 Correct 44 ms 32360 KB Output is correct
65 Correct 38 ms 32040 KB Output is correct
66 Correct 33 ms 31632 KB Output is correct
67 Correct 93 ms 40268 KB Output is correct
68 Correct 68 ms 40360 KB Output is correct
69 Correct 51 ms 44028 KB Output is correct
70 Correct 52 ms 44036 KB Output is correct
71 Correct 60 ms 40564 KB Output is correct
72 Correct 61 ms 40440 KB Output is correct
73 Correct 55 ms 41416 KB Output is correct
74 Correct 52 ms 41340 KB Output is correct
75 Correct 25 ms 32064 KB Output is correct
76 Correct 82 ms 40264 KB Output is correct
77 Correct 19 ms 31324 KB Output is correct
78 Correct 17 ms 31388 KB Output is correct
79 Correct 19 ms 31304 KB Output is correct
80 Correct 18 ms 31400 KB Output is correct
81 Correct 25 ms 31316 KB Output is correct
82 Correct 18 ms 31432 KB Output is correct
83 Correct 17 ms 31420 KB Output is correct
84 Correct 19 ms 31444 KB Output is correct
85 Correct 16 ms 31316 KB Output is correct
86 Correct 16 ms 31308 KB Output is correct
87 Correct 17 ms 31316 KB Output is correct
88 Correct 17 ms 31444 KB Output is correct
89 Correct 38 ms 31460 KB Output is correct
90 Correct 42 ms 31424 KB Output is correct
91 Correct 40 ms 31412 KB Output is correct
92 Correct 76 ms 41920 KB Output is correct
93 Correct 283 ms 52316 KB Output is correct
94 Correct 675 ms 72212 KB Output is correct
95 Correct 90 ms 43388 KB Output is correct
96 Correct 83 ms 43260 KB Output is correct
97 Correct 88 ms 43304 KB Output is correct
98 Correct 204 ms 51528 KB Output is correct
99 Correct 188 ms 50896 KB Output is correct
100 Correct 176 ms 51920 KB Output is correct
101 Correct 179 ms 51916 KB Output is correct
102 Correct 178 ms 51916 KB Output is correct
103 Correct 221 ms 58248 KB Output is correct
104 Correct 227 ms 62144 KB Output is correct
105 Correct 248 ms 59136 KB Output is correct
106 Correct 125 ms 51064 KB Output is correct
107 Correct 121 ms 51312 KB Output is correct
108 Correct 127 ms 50220 KB Output is correct
109 Correct 135 ms 51316 KB Output is correct
110 Correct 48 ms 31476 KB Output is correct
111 Correct 33 ms 31420 KB Output is correct
112 Correct 213 ms 60484 KB Output is correct
113 Correct 73 ms 46956 KB Output is correct
114 Correct 158 ms 56380 KB Output is correct
115 Correct 54 ms 40996 KB Output is correct
116 Correct 140 ms 48896 KB Output is correct
117 Correct 1028 ms 82740 KB Output is correct
118 Correct 88 ms 40400 KB Output is correct
119 Correct 84 ms 40348 KB Output is correct
120 Correct 26 ms 32932 KB Output is correct
121 Correct 165 ms 49924 KB Output is correct
122 Correct 155 ms 49952 KB Output is correct
123 Correct 84 ms 48624 KB Output is correct
124 Correct 88 ms 50248 KB Output is correct
125 Correct 78 ms 48972 KB Output is correct
126 Correct 488 ms 80408 KB Output is correct
127 Correct 135 ms 57448 KB Output is correct
128 Correct 129 ms 57572 KB Output is correct
129 Correct 134 ms 58088 KB Output is correct
130 Correct 125 ms 57604 KB Output is correct