Submission #1061767

# Submission time Handle Problem Language Result Execution time Memory
1061767 2024-08-16T13:07:24 Z n1k Closing Time (IOI23_closing) C++17
100 / 100
206 ms 42864 KB
#include "closing.h"
#include <bits/stdc++.h>

using namespace std;

struct node
{
    long long t;
    int x, cnt = 0;
    bool operator<(const node &n) const
    {
        return t < n.t;
    }
    bool operator>(const node &n) const
    {
        return n < (*this);
    }
};

vector<vector<pair<int, long long>>> g;
vector<long long> distX, distY;
vector<bool> vis;

void dfs(vector<long long> &dist, int x, long long d)
{
    vis[x] = true;
    dist[x] = d;
    for (auto [y, w] : g[x])
    {
        if (!vis[y])
        {
            dfs(dist, y, d + w);
        }
    }
}

int solve(int N, int max_cnt, long long K, long long min_sum)
{
    int res = 0;
    vector<int> cnt(N, 0);
    priority_queue<node, vector<node>, greater<node>> pq_one, pq_two;

    for (int i = 0; i < N; i++)
    {
        if (max_cnt == 2 && distX[i] + distY[i] == min_sum)
        {
            res++;
            cnt[i]++;
            K -= min(distX[i], distY[i]);
            pq_one.push({abs(distX[i] - distY[i]), i, 1});
        }
        else
        {
            pq_one.push({min(distX[i], distY[i]), i, 0});
            if (max_cnt == 2)
                pq_two.push({max(distX[i], distY[i]), i, 0});
        }
    }

    auto get_top = [](priority_queue<node, vector<node>, greater<node>> &pq) -> node
    {
        return pq.empty() ? node{(long long)1e18, 0} : pq.top();
    };

    auto reduce = [&cnt, &max_cnt, &K](priority_queue<node, vector<node>, greater<node>> &pq) -> void
    {
        while (!pq.empty() && (cnt[pq.top().x] != pq.top().cnt || K < pq.top().t))
        {
            pq.pop();
        }
    };

    while (!pq_one.empty() || !pq_two.empty())
    {
        reduce(pq_one);
        reduce(pq_two);
        if (pq_one.empty() && pq_two.empty())
            break;
        node one1 = get_top(pq_one), one2;
        if (!pq_one.empty())
        {
            pq_one.pop();
            cnt[one1.x]++;
            reduce(pq_one);
            cnt[one1.x]--;
            one2 = get_top(pq_one);
        }
        node two = get_top(pq_two);
        if (pq_two.empty() || one1.t + one2.t < two.t)
        {
            K -= one1.t;
            res++;
            cnt[one1.x]++;
            if (max_cnt == 2 && cnt[one1.x] == 1)
            {
                pq_one.push({abs(distX[one1.x] - distY[one1.x]), one1.x, 1});
            }
        }
        else
        {
            pq_one.push(one1);
            K -= min(distX[two.x], distY[two.x]);
            res++;
            cnt[two.x]++;
            pq_one.push({abs(distX[two.x] - distY[two.x]), two.x, 1});
            pq_two.pop();
        }
    }

    return K < 0 ? 0 : res;
}

int max_score(int N, int X, int Y, long long K, std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
    g.assign(N, std::vector<std::pair<int, long long>>());
    for (int i = 0; i < N - 1; i++)
    {
        g[U[i]].emplace_back(V[i], W[i]);
        g[V[i]].emplace_back(U[i], W[i]);
    }
    distX.resize(N);
    distY.resize(N);
    vis.assign(N, false);
    dfs(distX, X, 0);
    vis.assign(N, false);
    dfs(distY, Y, 0);

    return max(solve(N, 2, K, distX[Y]), solve(N, 1, K, distX[Y]));
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 158 ms 38864 KB Output is correct
2 Correct 163 ms 42864 KB Output is correct
3 Correct 76 ms 5676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 440 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 352 KB Output is correct
21 Correct 1 ms 444 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 356 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 440 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 352 KB Output is correct
21 Correct 1 ms 444 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 1 ms 356 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 2 ms 860 KB Output is correct
28 Correct 2 ms 860 KB Output is correct
29 Correct 2 ms 868 KB Output is correct
30 Correct 2 ms 956 KB Output is correct
31 Correct 2 ms 864 KB Output is correct
32 Correct 3 ms 1636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 612 KB Output is correct
8 Correct 0 ms 356 KB Output is correct
9 Correct 0 ms 356 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 352 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 436 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 612 KB Output is correct
20 Correct 0 ms 356 KB Output is correct
21 Correct 0 ms 356 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 352 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 436 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 1 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 356 KB Output is correct
48 Correct 0 ms 356 KB Output is correct
49 Correct 0 ms 356 KB Output is correct
50 Correct 0 ms 356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 440 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 352 KB Output is correct
22 Correct 1 ms 444 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 0 ms 612 KB Output is correct
27 Correct 0 ms 356 KB Output is correct
28 Correct 0 ms 356 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 352 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 1 ms 436 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 356 KB Output is correct
55 Correct 0 ms 356 KB Output is correct
56 Correct 0 ms 356 KB Output is correct
57 Correct 0 ms 356 KB Output is correct
58 Correct 1 ms 356 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 448 KB Output is correct
62 Correct 1 ms 356 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 352 KB Output is correct
66 Correct 1 ms 356 KB Output is correct
67 Correct 1 ms 612 KB Output is correct
68 Correct 1 ms 360 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 356 KB Output is correct
71 Correct 1 ms 360 KB Output is correct
72 Correct 1 ms 360 KB Output is correct
73 Correct 1 ms 360 KB Output is correct
74 Correct 1 ms 356 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 440 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 352 KB Output is correct
22 Correct 1 ms 444 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 2 ms 860 KB Output is correct
28 Correct 2 ms 860 KB Output is correct
29 Correct 2 ms 860 KB Output is correct
30 Correct 2 ms 868 KB Output is correct
31 Correct 2 ms 956 KB Output is correct
32 Correct 2 ms 864 KB Output is correct
33 Correct 3 ms 1636 KB Output is correct
34 Correct 0 ms 612 KB Output is correct
35 Correct 0 ms 356 KB Output is correct
36 Correct 0 ms 356 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 352 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 1 ms 436 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 356 KB Output is correct
63 Correct 0 ms 356 KB Output is correct
64 Correct 0 ms 356 KB Output is correct
65 Correct 0 ms 356 KB Output is correct
66 Correct 1 ms 356 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 448 KB Output is correct
70 Correct 1 ms 356 KB Output is correct
71 Correct 1 ms 344 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 352 KB Output is correct
74 Correct 1 ms 356 KB Output is correct
75 Correct 1 ms 612 KB Output is correct
76 Correct 1 ms 360 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 1 ms 356 KB Output is correct
79 Correct 1 ms 360 KB Output is correct
80 Correct 1 ms 360 KB Output is correct
81 Correct 1 ms 360 KB Output is correct
82 Correct 1 ms 356 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 2 ms 360 KB Output is correct
85 Correct 2 ms 360 KB Output is correct
86 Correct 1 ms 356 KB Output is correct
87 Correct 1 ms 352 KB Output is correct
88 Correct 2 ms 360 KB Output is correct
89 Correct 3 ms 788 KB Output is correct
90 Correct 3 ms 872 KB Output is correct
91 Correct 2 ms 864 KB Output is correct
92 Correct 2 ms 872 KB Output is correct
93 Correct 2 ms 872 KB Output is correct
94 Correct 2 ms 864 KB Output is correct
95 Correct 2 ms 868 KB Output is correct
96 Correct 2 ms 1008 KB Output is correct
97 Correct 3 ms 864 KB Output is correct
98 Correct 2 ms 872 KB Output is correct
99 Correct 3 ms 872 KB Output is correct
100 Correct 3 ms 864 KB Output is correct
101 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 440 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 352 KB Output is correct
22 Correct 1 ms 444 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 356 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 2 ms 860 KB Output is correct
28 Correct 2 ms 860 KB Output is correct
29 Correct 2 ms 860 KB Output is correct
30 Correct 2 ms 868 KB Output is correct
31 Correct 2 ms 956 KB Output is correct
32 Correct 2 ms 864 KB Output is correct
33 Correct 3 ms 1636 KB Output is correct
34 Correct 0 ms 612 KB Output is correct
35 Correct 0 ms 356 KB Output is correct
36 Correct 0 ms 356 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 352 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 1 ms 348 KB Output is correct
41 Correct 1 ms 348 KB Output is correct
42 Correct 1 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 1 ms 436 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 1 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 356 KB Output is correct
63 Correct 0 ms 356 KB Output is correct
64 Correct 0 ms 356 KB Output is correct
65 Correct 0 ms 356 KB Output is correct
66 Correct 1 ms 356 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 448 KB Output is correct
70 Correct 1 ms 356 KB Output is correct
71 Correct 1 ms 344 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 352 KB Output is correct
74 Correct 1 ms 356 KB Output is correct
75 Correct 1 ms 612 KB Output is correct
76 Correct 1 ms 360 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 1 ms 356 KB Output is correct
79 Correct 1 ms 360 KB Output is correct
80 Correct 1 ms 360 KB Output is correct
81 Correct 1 ms 360 KB Output is correct
82 Correct 1 ms 356 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 2 ms 360 KB Output is correct
85 Correct 2 ms 360 KB Output is correct
86 Correct 1 ms 356 KB Output is correct
87 Correct 1 ms 352 KB Output is correct
88 Correct 2 ms 360 KB Output is correct
89 Correct 3 ms 788 KB Output is correct
90 Correct 3 ms 872 KB Output is correct
91 Correct 2 ms 864 KB Output is correct
92 Correct 2 ms 872 KB Output is correct
93 Correct 2 ms 872 KB Output is correct
94 Correct 2 ms 864 KB Output is correct
95 Correct 2 ms 868 KB Output is correct
96 Correct 2 ms 1008 KB Output is correct
97 Correct 3 ms 864 KB Output is correct
98 Correct 2 ms 872 KB Output is correct
99 Correct 3 ms 872 KB Output is correct
100 Correct 3 ms 864 KB Output is correct
101 Correct 2 ms 348 KB Output is correct
102 Correct 92 ms 5440 KB Output is correct
103 Correct 94 ms 5716 KB Output is correct
104 Correct 173 ms 41624 KB Output is correct
105 Correct 112 ms 7780 KB Output is correct
106 Correct 101 ms 7096 KB Output is correct
107 Correct 82 ms 35488 KB Output is correct
108 Correct 79 ms 35696 KB Output is correct
109 Correct 95 ms 40280 KB Output is correct
110 Correct 206 ms 41348 KB Output is correct
111 Correct 147 ms 41976 KB Output is correct
112 Correct 179 ms 41448 KB Output is correct
113 Correct 199 ms 39388 KB Output is correct
114 Correct 153 ms 38108 KB Output is correct
115 Correct 93 ms 41376 KB Output is correct
116 Correct 184 ms 40876 KB Output is correct
117 Correct 158 ms 38776 KB Output is correct
118 Correct 175 ms 41088 KB Output is correct
119 Correct 135 ms 10468 KB Output is correct
120 Correct 89 ms 4944 KB Output is correct