답안 #839711

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
839711 2023-08-30T15:46:29 Z model_code 봉쇄 시간 (IOI23_closing) C++17
100 / 100
596 ms 48476 KB
// correct/solution-jonathanirvings.cpp

#include "closing.h"

#ifndef ATCODER_INTERNAL_TYPE_TRAITS_HPP
#define ATCODER_INTERNAL_TYPE_TRAITS_HPP 1

#include <cassert>
#include <numeric>
#include <type_traits>

namespace atcoder
{

    namespace internal
    {

#ifndef _MSC_VER
        template <class T>
        using is_signed_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value ||
                                          std::is_same<T, __int128>::value,
                                      std::true_type,
                                      std::false_type>::type;

        template <class T>
        using is_unsigned_int128 =
            typename std::conditional<std::is_same<T, __uint128_t>::value ||
                                          std::is_same<T, unsigned __int128>::value,
                                      std::true_type,
                                      std::false_type>::type;

        template <class T>
        using make_unsigned_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value,
                                      __uint128_t,
                                      unsigned __int128>;

        template <class T>
        using is_integral = typename std::conditional<std::is_integral<T>::value ||
                                                          is_signed_int128<T>::value ||
                                                          is_unsigned_int128<T>::value,
                                                      std::true_type,
                                                      std::false_type>::type;

        template <class T>
        using is_signed_int = typename std::conditional<(is_integral<T>::value &&
                                                         std::is_signed<T>::value) ||
                                                            is_signed_int128<T>::value,
                                                        std::true_type,
                                                        std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<(is_integral<T>::value &&
                                       std::is_unsigned<T>::value) ||
                                          is_unsigned_int128<T>::value,
                                      std::true_type,
                                      std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<
            is_signed_int128<T>::value,
            make_unsigned_int128<T>,
            typename std::conditional<std::is_signed<T>::value,
                                      std::make_unsigned<T>,
                                      std::common_type<T>>::type>::type;

#else

        template <class T>
        using is_integral = typename std::is_integral<T>;

        template <class T>
        using is_signed_int =
            typename std::conditional<is_integral<T>::value && std::is_signed<T>::value,
                                      std::true_type,
                                      std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<is_integral<T>::value &&
                                          std::is_unsigned<T>::value,
                                      std::true_type,
                                      std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<is_signed_int<T>::value,
                                                      std::make_unsigned<T>,
                                                      std::common_type<T>>::type;

#endif

        template <class T>
        using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;

        template <class T>
        using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;

        template <class T>
        using to_unsigned_t = typename to_unsigned<T>::type;

    } // namespace internal

} // namespace atcoder

#endif // ATCODER_INTERNAL_TYPE_TRAITS_HPP

#ifndef ATCODER_FENWICKTREE_HPP
#define ATCODER_FENWICKTREE_HPP 1

#include <cassert>
#include <vector>

namespace atcoder
{

    // Reference: https://en.wikipedia.org/wiki/Fenwick_tree
    template <class T>
    struct fenwick_tree
    {
        using U = internal::to_unsigned_t<T>;

    public:
        fenwick_tree() : _n(0) {}
        explicit fenwick_tree(int n) : _n(n), data(n) {}

        void add(int p, T x)
        {
            assert(0 <= p && p < _n);
            p++;
            while (p <= _n)
            {
                data[p - 1] += U(x);
                p += p & -p;
            }
        }

        T sum(int l, int r)
        {
            assert(0 <= l && l <= r && r <= _n);
            return sum(r) - sum(l);
        }

    private:
        int _n;
        std::vector<U> data;

        U sum(int r)
        {
            U s = 0;
            while (r > 0)
            {
                s += data[r - 1];
                r -= r & -r;
            }
            return s;
        }
    };

} // namespace atcoder

#endif // ATCODER_FENWICKTREE_HPP

#include <bits/stdc++.h>
using namespace std;

vector<vector<pair<int, int>>> adj;

struct SumCntFenwickTree
{
    SumCntFenwickTree(vector<pair<long long, int>> num)
        : _bit_cnt(num.size()), _bit_sum(num.size())
    {
        for (auto [a, _] : num)
        {
            _num.push_back(a);
        }
    }

    void Add(int x)
    {
        _bit_cnt.add(x, 1);
        _bit_sum.add(x, _num[x]);
    }

    void Remove(int x)
    {
        _bit_cnt.add(x, -1);
        _bit_sum.add(x, -_num[x]);
    }

    int Cnt(int x)
    {
        return _bit_cnt.sum(0, x);
    }

    long long Sum(int x)
    {
        return _bit_sum.sum(0, x);
    }

    vector<long long> _num;
    atcoder::fenwick_tree<int> _bit_cnt;
    atcoder::fenwick_tree<long long> _bit_sum;
};

void fill_distance(int u, int from, vector<long long> &distance)
{
    for (auto [v, w] : adj[u])
    {
        if (v != from)
        {
            distance[v] = distance[u] + w;
            fill_distance(v, u, distance);
        }
    }
}

int non_intersecting(
    int N, long long K,
    const vector<long long> &fromX, const vector<long long> &fromY)
{
    vector<long long> smaller(N);
    for (int i = 0; i < N; ++i)
    {
        smaller[i] = min(fromX[i], fromY[i]);
    }
    sort(smaller.begin(), smaller.end());
    for (int i = 0; i < N; ++i)
    {
        if (smaller[i] <= K)
        {
            K -= smaller[i];
        }
        else
        {
            return i;
        }
    }
    return N;
}

int max_score(int N, int X, int Y, long long K,
              std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
    adj.assign(N, vector<pair<int, int>>());
    for (int i = 0; i < N - 1; ++i)
    {
        adj[U[i]].emplace_back(V[i], W[i]);
        adj[V[i]].emplace_back(U[i], W[i]);
    }
    vector<long long> fromX(N), fromY(N);
    fill_distance(X, -1, fromX);
    fill_distance(Y, -1, fromY);
    vector<bool> is_in_path(N);
    vector<int> in_path;
    for (int i = 0; i < N; ++i)
    {
        is_in_path[i] = fromX[i] + fromY[i] == fromX[Y];
        if (is_in_path[i])
        {
            in_path.push_back(i);
        }
    }

    int answer = non_intersecting(N, K, fromX, fromY);
    for (int u : in_path)
    {
        K -= min(fromX[u], fromY[u]);
    }
    if (K >= 0)
    {
        vector<int> order(N);
        iota(order.begin(), order.end(), 0);
        sort(order.begin(), order.end(), [&](int a, int b)
             { return make_pair(max(fromX[a], fromY[a]) - min(fromX[a], fromY[a]), a) < make_pair(max(fromX[b], fromY[b]) - min(fromX[b], fromY[b]), b); });

        vector<pair<long long, int>> cost_one, cost_two;
        for (int i = 0; i < N; ++i)
        {
            if (is_in_path[i])
            {
                cost_one.emplace_back(
                    max(fromX[i], fromY[i]) - min(fromX[i], fromY[i]), i);
            }
            else
            {
                cost_two.emplace_back(max(fromX[i], fromY[i]), i);
                cost_one.emplace_back(min(fromX[i], fromY[i]), i);
            }
        }
        sort(cost_one.begin(), cost_one.end());
        sort(cost_two.begin(), cost_two.end());

        vector<int> ix_cost_one(N), ix_cost_two(N);
        for (int i = 0; i < N; ++i)
        {
            ix_cost_one[cost_one[i].second] = i;
            if (i < static_cast<int>(cost_two.size()))
            {
                ix_cost_two[cost_two[i].second] = i;
            }
        }

        SumCntFenwickTree bit_cost_one(cost_one);
        SumCntFenwickTree bit_cost_two(cost_two);
        for (int i = 0; i < N; ++i)
        {
            if (!is_in_path[i])
            {
                bit_cost_one.Add(ix_cost_one[i]);
            }
        }

        for (int i = 0; i < N; ++i)
        {
            int u = order[i];
            if (is_in_path[u])
            {
                bit_cost_one.Add(ix_cost_one[u]);
            }
            else
            {
                bit_cost_one.Remove(ix_cost_one[u]);
                bit_cost_two.Add(ix_cost_two[u]);
            }

            auto check = [&](int mid)
            {
                int lowest_cannot_take = lower_bound(
                                             cost_one.begin(),
                                             cost_one.end(),
                                             make_pair((cost_two[mid].first + 1) >> 1, 0)) -
                                         cost_one.begin();
                return bit_cost_two.Sum(mid + 1) + bit_cost_one.Sum(lowest_cannot_take) <= K;
            };

            int take_until_two = -1;
            {
                int lo = 0;
                int hi = static_cast<int>(cost_two.size()) - 1;
                while (lo <= hi)
                {
                    int mid = (lo + hi) >> 1;
                    if (check(mid))
                    {
                        take_until_two = mid;
                        lo = mid + 1;
                    }
                    else
                    {
                        hi = mid - 1;
                    }
                }
            }

            int take_until_one = -1;
            if (false)
            {
                while (take_until_one + 1 < N &&
                       bit_cost_two.Sum(take_until_two + 1) + bit_cost_one.Sum(take_until_one + 2) <= K)
                    ++take_until_one;
            }
            else
            {
                int lo = 0;
                int hi = N - 1;
                while (lo <= hi)
                {
                    int mid = (lo + hi) >> 1;
                    if (bit_cost_two.Sum(take_until_two + 1) + bit_cost_one.Sum(mid + 1) <= K)
                    {
                        take_until_one = mid;
                        lo = mid + 1;
                    }
                    else
                    {
                        hi = mid - 1;
                    }
                }
            }
            answer = max(answer, static_cast<int>(in_path.size()) + 2 * bit_cost_two.Cnt(take_until_two + 1) + bit_cost_one.Cnt(take_until_one + 1));

            if (take_until_one >= 0)
            {
                long long target_cost = bit_cost_one.Sum(take_until_one + 1);
                {
                    take_until_one = -1;
                    int lo = 0;
                    int hi = N - 1;
                    while (lo <= hi)
                    {
                        int mid = (lo + hi) >> 1;
                        if (bit_cost_one.Sum(mid + 1) < target_cost)
                        {
                            take_until_one = mid;
                            lo = mid + 1;
                        }
                        else
                        {
                            hi = mid - 1;
                        }
                    }
                }
                int lo = 0;
                int hi = static_cast<int>(cost_two.size()) - 1;
                while (lo <= hi)
                {
                    int mid = (lo + hi) >> 1;
                    if (bit_cost_two.Sum(mid + 1) + bit_cost_one.Sum(take_until_one + 1) <= K)
                    {
                        take_until_two = mid;
                        lo = mid + 1;
                    }
                    else
                    {
                        hi = mid - 1;
                    }
                }
                answer = max(answer, static_cast<int>(in_path.size()) + 2 * bit_cost_two.Cnt(take_until_two + 1) + bit_cost_one.Cnt(take_until_one + 1));
            }
        }
    }
    return answer;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 26412 KB Output is correct
2 Correct 116 ms 33216 KB Output is correct
3 Correct 57 ms 4684 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 296 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 304 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 296 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 304 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 2 ms 380 KB Output is correct
26 Correct 4 ms 1060 KB Output is correct
27 Correct 4 ms 1000 KB Output is correct
28 Correct 4 ms 948 KB Output is correct
29 Correct 4 ms 980 KB Output is correct
30 Correct 1 ms 724 KB Output is correct
31 Correct 2 ms 724 KB Output is correct
32 Correct 2 ms 852 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 296 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 300 KB Output is correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 1 ms 300 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 296 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 296 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 300 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 296 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 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 1 ms 300 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 296 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 304 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 296 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 300 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 296 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 0 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 384 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 308 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 296 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 304 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 2 ms 380 KB Output is correct
27 Correct 4 ms 1060 KB Output is correct
28 Correct 4 ms 1000 KB Output is correct
29 Correct 4 ms 948 KB Output is correct
30 Correct 4 ms 980 KB Output is correct
31 Correct 1 ms 724 KB Output is correct
32 Correct 2 ms 724 KB Output is correct
33 Correct 2 ms 852 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 1 ms 296 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 296 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 0 ms 212 KB Output is correct
48 Correct 1 ms 300 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 1 ms 212 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 0 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 384 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 308 KB Output is correct
78 Correct 1 ms 340 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 3 ms 340 KB Output is correct
85 Correct 3 ms 340 KB Output is correct
86 Correct 2 ms 340 KB Output is correct
87 Correct 3 ms 340 KB Output is correct
88 Correct 3 ms 340 KB Output is correct
89 Correct 4 ms 880 KB Output is correct
90 Correct 4 ms 852 KB Output is correct
91 Correct 4 ms 852 KB Output is correct
92 Correct 5 ms 852 KB Output is correct
93 Correct 2 ms 596 KB Output is correct
94 Correct 4 ms 852 KB Output is correct
95 Correct 4 ms 980 KB Output is correct
96 Correct 2 ms 724 KB Output is correct
97 Correct 6 ms 884 KB Output is correct
98 Correct 6 ms 852 KB Output is correct
99 Correct 4 ms 980 KB Output is correct
100 Correct 4 ms 728 KB Output is correct
101 Correct 4 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 296 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 304 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 2 ms 380 KB Output is correct
27 Correct 4 ms 1060 KB Output is correct
28 Correct 4 ms 1000 KB Output is correct
29 Correct 4 ms 948 KB Output is correct
30 Correct 4 ms 980 KB Output is correct
31 Correct 1 ms 724 KB Output is correct
32 Correct 2 ms 724 KB Output is correct
33 Correct 2 ms 852 KB Output is correct
34 Correct 1 ms 212 KB Output is correct
35 Correct 1 ms 212 KB Output is correct
36 Correct 1 ms 212 KB Output is correct
37 Correct 1 ms 296 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 1 ms 300 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 296 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 0 ms 212 KB Output is correct
48 Correct 1 ms 300 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 0 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 1 ms 212 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 0 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 384 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 308 KB Output is correct
78 Correct 1 ms 340 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 3 ms 340 KB Output is correct
85 Correct 3 ms 340 KB Output is correct
86 Correct 2 ms 340 KB Output is correct
87 Correct 3 ms 340 KB Output is correct
88 Correct 3 ms 340 KB Output is correct
89 Correct 4 ms 880 KB Output is correct
90 Correct 4 ms 852 KB Output is correct
91 Correct 4 ms 852 KB Output is correct
92 Correct 5 ms 852 KB Output is correct
93 Correct 2 ms 596 KB Output is correct
94 Correct 4 ms 852 KB Output is correct
95 Correct 4 ms 980 KB Output is correct
96 Correct 2 ms 724 KB Output is correct
97 Correct 6 ms 884 KB Output is correct
98 Correct 6 ms 852 KB Output is correct
99 Correct 4 ms 980 KB Output is correct
100 Correct 4 ms 728 KB Output is correct
101 Correct 4 ms 468 KB Output is correct
102 Correct 157 ms 4632 KB Output is correct
103 Correct 175 ms 4728 KB Output is correct
104 Correct 446 ms 46256 KB Output is correct
105 Correct 251 ms 6780 KB Output is correct
106 Correct 263 ms 6164 KB Output is correct
107 Correct 341 ms 40544 KB Output is correct
108 Correct 485 ms 41468 KB Output is correct
109 Correct 82 ms 32488 KB Output is correct
110 Correct 596 ms 45040 KB Output is correct
111 Correct 411 ms 48476 KB Output is correct
112 Correct 502 ms 44304 KB Output is correct
113 Correct 177 ms 23280 KB Output is correct
114 Correct 436 ms 43996 KB Output is correct
115 Correct 274 ms 47720 KB Output is correct
116 Correct 551 ms 46564 KB Output is correct
117 Correct 179 ms 26864 KB Output is correct
118 Correct 481 ms 45312 KB Output is correct
119 Correct 294 ms 9672 KB Output is correct
120 Correct 138 ms 4552 KB Output is correct