답안 #1023254

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1023254 2024-07-14T14:17:46 Z vjudge1 꿈 (IOI13_dreaming) C++17
100 / 100
61 ms 43440 KB
#ifndef LOCAL
#pragma GCC optimize("Ofast,unroll-loops,inline")
// Bitwise pragma fuck
// #pragma GCC target("avx,avx2,bmi")
 
// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("arch=skylake")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
#endif
 
#ifndef LOCAL
#include "dreaming.h"
#endif
#include <bits/stdc++.h>
using namespace std;
 
// Wish you can debug? YesYes
#ifndef LOCAL
#define cerr \
    if (0)   \
    cerr
#endif
 
// Policy based DS?
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
 
// Who tf deal with overflow
// #define int long long
 
/*
pbds blog :
https://codeforces.com/blog/entry/11080
https://codeforces.com/blog/entry/13279
*/
// Useful pbds
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// template <typename T>
// using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
// typedef trie<string, null_type, trie_string_access_traits<>, pat_trie_tag, trie_prefix_search_node_update> pref_trie;
 
#define el '\n'
#define mpp make_pair
#define pb push_back
#define ppb pop_back
#define pf push_front
#define emp emplace_back
#define fi first
#define nd second
#define forinc(i, a, b) for (int i = (a); i <= (b); i++)
#define fordec(i, a, b) for (int i = (a); i >= (b); i--)
#define alle(x) (x).begin(), (x).end()
#define ralle(x) (x).rbegin(), (x).rend()
#define mms(a, v) memset(a, v, sizeof(a))
#define lwb(a, v) lower_bound((a).begin(), (a).end(), v)
#define upb(a, v) upper_bound((a).begin(), (a).end(), v)
#define bit(i, a) (((a) >> (i)) & 1)
 
#define BIT_SET(a, b) ((a) |= (1ULL << (b)))
#define BIT_CLEAR(a, b) ((a) &= ~(1ULL << (b)))
#define BIT_FLIP(a, b) ((a) ^= (1ULL << (b)))
#define BIT_CHECK(a, b) (!!((a) & (1ULL << (b))))
#define BITMASK_SET(x, mask) ((x) |= (mask))
#define BITMASK_CLEAR(x, mask) ((x) &= (~(mask)))
#define BITMASK_FLIP(x, mask) ((x) ^= (mask))
#define BITMASK_CHECK_ALL(x, mask) (!(~(x) & (mask)))
#define BITMASK_CHECK_ANY(x, mask) ((x) & (mask))
#define POPCNT(mask) __builtin_popcount(mask)
#define POPCNTLL(mask) __builtin_popcountll(mask)
#define CTZ(mask) __builtin_ctz(mask)
#define CTZLL(mask) __builtin_ctzll(mask)
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef vector<bool> vb;
 
template <typename T, typename U>
inline void maximize(T &x, U y)
{
    if (y < x)
        x = y;
}
template <typename T, typename U>
inline void minimize(T &x, U y)
{
    if (x < y)
        x = y;
}
inline int add_m(int a, int b, int mod)
{
    int res = a + b;
    return (res >= mod ? res - mod : res);
}
inline int mod_neg(int a, int b, int mod)
{
    int res;
    if (abs(a - b) < mod)
        res = a - b;
    else
        res = (a - b) % mod;
    return (res < 0 ? res + mod : res);
}
inline int mul_wmod(int a, int b, int c)
{
    ll res = (ll)a * b;
    return (res >= c ? res % c : res);
}
inline int mul_wnmod(int a, int b, int c)
{
    ll res = (ll)a * b;
    return ((res % c) + c) % c;
}
 
// Debugger Utils
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
 
template <size_t i, class T>
ostream &print_tuple_utils(ostream &out, const T &tup)
{
    if constexpr (i == tuple_size<T>::value)
        return out << ")";
    else
        return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup);
}
template <class... U>
ostream &operator<<(ostream &out, const tuple<U...> &t)
{
    return print_tuple_utils<0, tuple<U...>>(out, t);
}
#define db(val) "[" #val " = " << (val) << "] "
// End if debugger utils
 
namespace Hasher
{
    struct custom_hash
    {
        static uint32_t splitmix64(uint32_t x)
        {
            x += 0x9e3779b97f4a7c15;
            x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
            x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
            return x ^ (x >> 31);
        }
        size_t operator()(uint64_t x) const
        {
            static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
            return splitmix64(x + FIXED_RANDOM);
        }
    };
    struct hash_pair
    {
        template <class T1, class T2>
        size_t operator()(const pair<T1, T2> &p) const
        {
            auto hash1 = custom_hash{}(p.first);
            auto hash2 = custom_hash{}(p.second);
            if (hash1 != hash2)
                return hash1 ^ hash2;
            return hash1;
        }
    };
    struct hash_pair_pair
    {
        template <class T1, class T2>
        size_t operator()(const pair<T1, T2> &p) const
        {
            auto hash1 = custom_hash{}(p.first);
            auto hash2 = hash_pair{}(p.second);
            if (hash1 != hash2)
                return hash1 ^ hash2;
            return hash1;
        }
    };
}
using namespace Hasher;
 
const string taskname = "";
const bool tc = false;
 
const int oo = 1e9, mod = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll ool = 1e18;
const ldb eps = 1e-6;
const int MAXN = 1e6;
 
/*
Author: normankr07
Problem:
    - IOI 2013 - Dreaming
Submission links:
    - https://oj.uz/problem/view/IOI13_dreaming
Editorial links:
    - https://www.quora.com/What-is-the-solution-for-Dreaming-on-IOI-2013
    - http://blog.brucemerry.org.za/2013/07/ioi-2013-day-1-analysis.html
    - http://math.fau.edu/locke/Center.htm
Algorithm:
    - Find the center with maxmimum eccentricity, connect all of the center with that center
 
*/
 
vector<pii> adj[MAXN];
bool vis[MAXN];
pii max1[MAXN];
int max2[MAXN], dep[MAXN];
void DFS_maxcen(int u, int p)
{
    vis[u] = 1;
    max1[u] = {0, u};
    for (auto &[v, w] : adj[u])
    {
        if (v == p)
            continue;
        DFS_maxcen(v, u);
        max1[u] = max(max1[u], {max1[v].fi + w, max1[v].nd});
    }
}
 
int reDFS(int u, int p)
{
    max2[u] = max(max2[u], dep[u]);
    int ans = max2[u];
    for (auto &[v, w] : adj[u])
    {
        if (v == p)
            continue;
        dep[v] = dep[u] + w;
        ans = min(ans, reDFS(v, u));
    }
    return ans;
}
 
int travelTime(int N, int M, int L, int A[], int B[], int T[])
{
    for (int i = 0; i < M; i++)
    {
        adj[A[i]].pb({B[i], T[i]});
        adj[B[i]].pb({A[i], T[i]});
    }
    int ans = 0;
    vi dia;
    forinc(i, 0, N - 1)
    {
        if (vis[i])
            continue;
        DFS_maxcen(i, i);
        // Center with max ecc of subtree r[i];
        int x = max1[i].second;
        cerr << "Current root: " << i << el;
        cerr << db(max1[i]) << el;
        DFS_maxcen(x, x);
        // Check root x;
        int y = max1[x].second;
        cerr << db(max1[x]) << el;
        cerr << db(x) << db(y) << el;
        ans = max(ans, max1[x].first);
        dep[x] = 0;
        reDFS(x, x);
        dep[y] = 0;
        int die = reDFS(y, y);
        cerr << db(dep[x]) << db(dep[y]) << el;
        dia.pb(die);
    }
    sort(ralle(dia));
    if (dia.size() >= 2)
        ans = max(dia[0] + dia[1] + L, ans);
    if (dia.size() >= 3)
        ans = max(dia[1] + dia[2] + L * 2, ans);
    return ans;
}
 
#ifdef LOCAL
#define MAX_N 100000
 
static int A[MAX_N];
static int B[MAX_N];
static int T[MAX_N];
 
void solve()
{
    int N, M, L, i;
    int res;
    cin >> N >> M >> L;
    for (i = 0; i < M; i++)
        cin >> A[i] >> B[i] >> T[i];
    int answer = travelTime(N, M, L, A, B, T);
    cout << answer;
}
 
int32_t main()
{
    if (fopen((taskname + ".inp").c_str(), "r"))
    {
        freopen((taskname + ".inp").c_str(), "r", stdin);
        freopen((taskname + ".out").c_str(), "w", stdout);
    }
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tsc = 1;
    if (tc)
    {
        cin >> tsc;
    }
    while (tsc--)
    {
        solve();
        cout << el;
    }
 
    cerr << "\n"
         << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
}
#endif
#undef int
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 41676 KB Output is correct
2 Correct 53 ms 41556 KB Output is correct
3 Correct 38 ms 35920 KB Output is correct
4 Correct 18 ms 27480 KB Output is correct
5 Correct 17 ms 26200 KB Output is correct
6 Correct 20 ms 28764 KB Output is correct
7 Correct 13 ms 25048 KB Output is correct
8 Correct 36 ms 30544 KB Output is correct
9 Correct 38 ms 33112 KB Output is correct
10 Correct 13 ms 25180 KB Output is correct
11 Correct 50 ms 35556 KB Output is correct
12 Correct 53 ms 38288 KB Output is correct
13 Correct 13 ms 25180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 25180 KB Output is correct
2 Correct 12 ms 25180 KB Output is correct
3 Correct 14 ms 25180 KB Output is correct
4 Correct 17 ms 25188 KB Output is correct
5 Correct 12 ms 25140 KB Output is correct
6 Correct 14 ms 25180 KB Output is correct
7 Correct 11 ms 25124 KB Output is correct
8 Correct 12 ms 25064 KB Output is correct
9 Correct 13 ms 25140 KB Output is correct
10 Correct 13 ms 25180 KB Output is correct
11 Correct 13 ms 25136 KB Output is correct
12 Correct 13 ms 24920 KB Output is correct
13 Correct 15 ms 25180 KB Output is correct
14 Correct 14 ms 25180 KB Output is correct
15 Correct 13 ms 25140 KB Output is correct
16 Correct 18 ms 25180 KB Output is correct
17 Correct 13 ms 25184 KB Output is correct
18 Correct 14 ms 25180 KB Output is correct
19 Correct 12 ms 25180 KB Output is correct
20 Correct 13 ms 25180 KB Output is correct
21 Correct 12 ms 25180 KB Output is correct
22 Correct 13 ms 25432 KB Output is correct
23 Correct 14 ms 25176 KB Output is correct
24 Correct 13 ms 25176 KB Output is correct
25 Correct 12 ms 25176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 41676 KB Output is correct
2 Correct 53 ms 41556 KB Output is correct
3 Correct 38 ms 35920 KB Output is correct
4 Correct 18 ms 27480 KB Output is correct
5 Correct 17 ms 26200 KB Output is correct
6 Correct 20 ms 28764 KB Output is correct
7 Correct 13 ms 25048 KB Output is correct
8 Correct 36 ms 30544 KB Output is correct
9 Correct 38 ms 33112 KB Output is correct
10 Correct 13 ms 25180 KB Output is correct
11 Correct 50 ms 35556 KB Output is correct
12 Correct 53 ms 38288 KB Output is correct
13 Correct 13 ms 25180 KB Output is correct
14 Correct 12 ms 25180 KB Output is correct
15 Correct 12 ms 25180 KB Output is correct
16 Correct 14 ms 25180 KB Output is correct
17 Correct 17 ms 25188 KB Output is correct
18 Correct 12 ms 25140 KB Output is correct
19 Correct 14 ms 25180 KB Output is correct
20 Correct 11 ms 25124 KB Output is correct
21 Correct 12 ms 25064 KB Output is correct
22 Correct 13 ms 25140 KB Output is correct
23 Correct 13 ms 25180 KB Output is correct
24 Correct 13 ms 25136 KB Output is correct
25 Correct 13 ms 24920 KB Output is correct
26 Correct 15 ms 25180 KB Output is correct
27 Correct 14 ms 25180 KB Output is correct
28 Correct 13 ms 25140 KB Output is correct
29 Correct 18 ms 25180 KB Output is correct
30 Correct 13 ms 25184 KB Output is correct
31 Correct 14 ms 25180 KB Output is correct
32 Correct 12 ms 25180 KB Output is correct
33 Correct 13 ms 25180 KB Output is correct
34 Correct 12 ms 25180 KB Output is correct
35 Correct 13 ms 25432 KB Output is correct
36 Correct 14 ms 25176 KB Output is correct
37 Correct 13 ms 25176 KB Output is correct
38 Correct 12 ms 25176 KB Output is correct
39 Correct 51 ms 41556 KB Output is correct
40 Correct 49 ms 41552 KB Output is correct
41 Correct 37 ms 35924 KB Output is correct
42 Correct 18 ms 27484 KB Output is correct
43 Correct 14 ms 25184 KB Output is correct
44 Correct 13 ms 25180 KB Output is correct
45 Correct 17 ms 25176 KB Output is correct
46 Correct 13 ms 25180 KB Output is correct
47 Correct 11 ms 25152 KB Output is correct
48 Correct 15 ms 25180 KB Output is correct
49 Correct 14 ms 24924 KB Output is correct
50 Correct 13 ms 25176 KB Output is correct
51 Correct 15 ms 25176 KB Output is correct
52 Correct 13 ms 25180 KB Output is correct
53 Correct 13 ms 25432 KB Output is correct
54 Correct 12 ms 25180 KB Output is correct
55 Correct 13 ms 25016 KB Output is correct
56 Correct 14 ms 25176 KB Output is correct
57 Correct 52 ms 33064 KB Output is correct
58 Correct 51 ms 33104 KB Output is correct
59 Correct 53 ms 33036 KB Output is correct
60 Correct 55 ms 33092 KB Output is correct
61 Correct 54 ms 33108 KB Output is correct
62 Correct 53 ms 33104 KB Output is correct
63 Correct 59 ms 32732 KB Output is correct
64 Correct 50 ms 32848 KB Output is correct
65 Correct 53 ms 33108 KB Output is correct
66 Correct 52 ms 33104 KB Output is correct
67 Correct 58 ms 33256 KB Output is correct
68 Correct 54 ms 33088 KB Output is correct
69 Correct 57 ms 33364 KB Output is correct
70 Correct 56 ms 33364 KB Output is correct
71 Correct 13 ms 24920 KB Output is correct
72 Correct 14 ms 25180 KB Output is correct
73 Correct 13 ms 25364 KB Output is correct
74 Correct 13 ms 25176 KB Output is correct
75 Correct 14 ms 25180 KB Output is correct
76 Correct 13 ms 25180 KB Output is correct
77 Correct 14 ms 25180 KB Output is correct
78 Correct 14 ms 25180 KB Output is correct
79 Correct 14 ms 25404 KB Output is correct
80 Correct 57 ms 33156 KB Output is correct
81 Correct 59 ms 32984 KB Output is correct
82 Correct 53 ms 33156 KB Output is correct
83 Correct 56 ms 33112 KB Output is correct
84 Correct 14 ms 25312 KB Output is correct
85 Correct 14 ms 25148 KB Output is correct
86 Correct 14 ms 25180 KB Output is correct
87 Correct 13 ms 25180 KB Output is correct
88 Correct 14 ms 25180 KB Output is correct
89 Correct 13 ms 25180 KB Output is correct
90 Correct 15 ms 25176 KB Output is correct
91 Correct 13 ms 25176 KB Output is correct
92 Correct 14 ms 25176 KB Output is correct
93 Correct 13 ms 25348 KB Output is correct
94 Correct 13 ms 25180 KB Output is correct
95 Correct 12 ms 25176 KB Output is correct
96 Correct 12 ms 25140 KB Output is correct
97 Correct 14 ms 25020 KB Output is correct
98 Correct 12 ms 25180 KB Output is correct
99 Correct 11 ms 25184 KB Output is correct
100 Correct 11 ms 25180 KB Output is correct
101 Correct 11 ms 25184 KB Output is correct
102 Correct 17 ms 25180 KB Output is correct
103 Correct 12 ms 25180 KB Output is correct
104 Correct 16 ms 26204 KB Output is correct
105 Correct 23 ms 28760 KB Output is correct
106 Correct 11 ms 25180 KB Output is correct
107 Correct 30 ms 30504 KB Output is correct
108 Correct 34 ms 33104 KB Output is correct
109 Correct 15 ms 25176 KB Output is correct
110 Correct 44 ms 35480 KB Output is correct
111 Correct 50 ms 38412 KB Output is correct
112 Correct 12 ms 25176 KB Output is correct
113 Correct 61 ms 43440 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 29652 KB Output is correct
2 Correct 25 ms 29788 KB Output is correct
3 Correct 24 ms 29664 KB Output is correct
4 Correct 24 ms 29660 KB Output is correct
5 Correct 25 ms 29660 KB Output is correct
6 Correct 25 ms 30168 KB Output is correct
7 Correct 25 ms 29920 KB Output is correct
8 Correct 26 ms 29632 KB Output is correct
9 Correct 25 ms 29532 KB Output is correct
10 Correct 32 ms 29908 KB Output is correct
11 Correct 12 ms 24924 KB Output is correct
12 Correct 16 ms 27352 KB Output is correct
13 Correct 15 ms 27352 KB Output is correct
14 Correct 16 ms 27092 KB Output is correct
15 Correct 15 ms 27336 KB Output is correct
16 Correct 15 ms 27092 KB Output is correct
17 Correct 15 ms 27136 KB Output is correct
18 Correct 15 ms 27348 KB Output is correct
19 Correct 16 ms 27096 KB Output is correct
20 Correct 11 ms 24924 KB Output is correct
21 Correct 11 ms 24924 KB Output is correct
22 Correct 12 ms 25180 KB Output is correct
23 Correct 14 ms 27228 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 25180 KB Output is correct
2 Correct 12 ms 25180 KB Output is correct
3 Correct 14 ms 25180 KB Output is correct
4 Correct 17 ms 25188 KB Output is correct
5 Correct 12 ms 25140 KB Output is correct
6 Correct 14 ms 25180 KB Output is correct
7 Correct 11 ms 25124 KB Output is correct
8 Correct 12 ms 25064 KB Output is correct
9 Correct 13 ms 25140 KB Output is correct
10 Correct 13 ms 25180 KB Output is correct
11 Correct 13 ms 25136 KB Output is correct
12 Correct 13 ms 24920 KB Output is correct
13 Correct 15 ms 25180 KB Output is correct
14 Correct 14 ms 25180 KB Output is correct
15 Correct 13 ms 25140 KB Output is correct
16 Correct 18 ms 25180 KB Output is correct
17 Correct 13 ms 25184 KB Output is correct
18 Correct 14 ms 25180 KB Output is correct
19 Correct 12 ms 25180 KB Output is correct
20 Correct 13 ms 25180 KB Output is correct
21 Correct 12 ms 25180 KB Output is correct
22 Correct 13 ms 25432 KB Output is correct
23 Correct 14 ms 25176 KB Output is correct
24 Correct 13 ms 25176 KB Output is correct
25 Correct 12 ms 25176 KB Output is correct
26 Correct 12 ms 25180 KB Output is correct
27 Correct 13 ms 25180 KB Output is correct
28 Correct 15 ms 25180 KB Output is correct
29 Correct 12 ms 25212 KB Output is correct
30 Correct 12 ms 25180 KB Output is correct
31 Correct 12 ms 25176 KB Output is correct
32 Correct 11 ms 25248 KB Output is correct
33 Correct 13 ms 25152 KB Output is correct
34 Correct 12 ms 25180 KB Output is correct
35 Correct 14 ms 25180 KB Output is correct
36 Correct 11 ms 25044 KB Output is correct
37 Correct 11 ms 25136 KB Output is correct
38 Correct 12 ms 25180 KB Output is correct
39 Correct 12 ms 24984 KB Output is correct
40 Correct 11 ms 25088 KB Output is correct
41 Correct 12 ms 25180 KB Output is correct
42 Correct 13 ms 25140 KB Output is correct
43 Correct 11 ms 25184 KB Output is correct
44 Correct 12 ms 25180 KB Output is correct
45 Correct 11 ms 25180 KB Output is correct
46 Correct 12 ms 25180 KB Output is correct
47 Correct 12 ms 25180 KB Output is correct
48 Correct 11 ms 25180 KB Output is correct
49 Correct 11 ms 24988 KB Output is correct
50 Correct 11 ms 25180 KB Output is correct
51 Correct 14 ms 25180 KB Output is correct
52 Correct 12 ms 24924 KB Output is correct
53 Correct 12 ms 24924 KB Output is correct
54 Correct 13 ms 25680 KB Output is correct
55 Correct 12 ms 25688 KB Output is correct
56 Correct 12 ms 25180 KB Output is correct
57 Correct 15 ms 25180 KB Output is correct
58 Correct 13 ms 25176 KB Output is correct
59 Correct 13 ms 25180 KB Output is correct
60 Correct 12 ms 25180 KB Output is correct
61 Correct 15 ms 25180 KB Output is correct
62 Correct 12 ms 25180 KB Output is correct
63 Correct 13 ms 25180 KB Output is correct
64 Correct 13 ms 23900 KB Output is correct
65 Correct 10 ms 25176 KB Output is correct
66 Correct 10 ms 25180 KB Output is correct
67 Correct 11 ms 25412 KB Output is correct
68 Correct 10 ms 25180 KB Output is correct
69 Correct 11 ms 25264 KB Output is correct
70 Correct 10 ms 25180 KB Output is correct
71 Correct 11 ms 25104 KB Output is correct
72 Correct 10 ms 25180 KB Output is correct
73 Correct 11 ms 25180 KB Output is correct
74 Correct 10 ms 25180 KB Output is correct
75 Correct 11 ms 25176 KB Output is correct
76 Correct 11 ms 25180 KB Output is correct
77 Correct 11 ms 25424 KB Output is correct
78 Correct 10 ms 25176 KB Output is correct
79 Correct 11 ms 25168 KB Output is correct
80 Correct 11 ms 25180 KB Output is correct
81 Correct 11 ms 25180 KB Output is correct
82 Correct 11 ms 25376 KB Output is correct
83 Correct 10 ms 25176 KB Output is correct
84 Correct 16 ms 25176 KB Output is correct
85 Correct 10 ms 25180 KB Output is correct
86 Correct 11 ms 25312 KB Output is correct
87 Correct 15 ms 25860 KB Output is correct
88 Correct 10 ms 25364 KB Output is correct
89 Correct 10 ms 25192 KB Output is correct
90 Correct 10 ms 25180 KB Output is correct
91 Correct 10 ms 25180 KB Output is correct
92 Correct 10 ms 25180 KB Output is correct
93 Correct 10 ms 25180 KB Output is correct
94 Correct 10 ms 25180 KB Output is correct
95 Correct 10 ms 25260 KB Output is correct
96 Correct 10 ms 25176 KB Output is correct
97 Correct 12 ms 25176 KB Output is correct
98 Correct 10 ms 25152 KB Output is correct
99 Correct 11 ms 25180 KB Output is correct
100 Correct 10 ms 25392 KB Output is correct
101 Correct 11 ms 25180 KB Output is correct
102 Correct 13 ms 25136 KB Output is correct
103 Correct 9 ms 25180 KB Output is correct
104 Correct 13 ms 25180 KB Output is correct
105 Correct 9 ms 25180 KB Output is correct
106 Correct 9 ms 25180 KB Output is correct
107 Correct 10 ms 24924 KB Output is correct
108 Correct 9 ms 25180 KB Output is correct
109 Correct 10 ms 25180 KB Output is correct
110 Correct 9 ms 25176 KB Output is correct
111 Correct 9 ms 25144 KB Output is correct
112 Correct 11 ms 25180 KB Output is correct
113 Correct 10 ms 25180 KB Output is correct
114 Correct 9 ms 25284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 41676 KB Output is correct
2 Correct 53 ms 41556 KB Output is correct
3 Correct 38 ms 35920 KB Output is correct
4 Correct 18 ms 27480 KB Output is correct
5 Correct 17 ms 26200 KB Output is correct
6 Correct 20 ms 28764 KB Output is correct
7 Correct 13 ms 25048 KB Output is correct
8 Correct 36 ms 30544 KB Output is correct
9 Correct 38 ms 33112 KB Output is correct
10 Correct 13 ms 25180 KB Output is correct
11 Correct 50 ms 35556 KB Output is correct
12 Correct 53 ms 38288 KB Output is correct
13 Correct 13 ms 25180 KB Output is correct
14 Correct 12 ms 25180 KB Output is correct
15 Correct 12 ms 25180 KB Output is correct
16 Correct 14 ms 25180 KB Output is correct
17 Correct 17 ms 25188 KB Output is correct
18 Correct 12 ms 25140 KB Output is correct
19 Correct 14 ms 25180 KB Output is correct
20 Correct 11 ms 25124 KB Output is correct
21 Correct 12 ms 25064 KB Output is correct
22 Correct 13 ms 25140 KB Output is correct
23 Correct 13 ms 25180 KB Output is correct
24 Correct 13 ms 25136 KB Output is correct
25 Correct 13 ms 24920 KB Output is correct
26 Correct 15 ms 25180 KB Output is correct
27 Correct 14 ms 25180 KB Output is correct
28 Correct 13 ms 25140 KB Output is correct
29 Correct 18 ms 25180 KB Output is correct
30 Correct 13 ms 25184 KB Output is correct
31 Correct 14 ms 25180 KB Output is correct
32 Correct 12 ms 25180 KB Output is correct
33 Correct 13 ms 25180 KB Output is correct
34 Correct 12 ms 25180 KB Output is correct
35 Correct 13 ms 25432 KB Output is correct
36 Correct 14 ms 25176 KB Output is correct
37 Correct 13 ms 25176 KB Output is correct
38 Correct 12 ms 25176 KB Output is correct
39 Correct 51 ms 41556 KB Output is correct
40 Correct 49 ms 41552 KB Output is correct
41 Correct 37 ms 35924 KB Output is correct
42 Correct 18 ms 27484 KB Output is correct
43 Correct 14 ms 25184 KB Output is correct
44 Correct 13 ms 25180 KB Output is correct
45 Correct 17 ms 25176 KB Output is correct
46 Correct 13 ms 25180 KB Output is correct
47 Correct 11 ms 25152 KB Output is correct
48 Correct 15 ms 25180 KB Output is correct
49 Correct 14 ms 24924 KB Output is correct
50 Correct 13 ms 25176 KB Output is correct
51 Correct 15 ms 25176 KB Output is correct
52 Correct 13 ms 25180 KB Output is correct
53 Correct 13 ms 25432 KB Output is correct
54 Correct 12 ms 25180 KB Output is correct
55 Correct 13 ms 25016 KB Output is correct
56 Correct 14 ms 25176 KB Output is correct
57 Correct 52 ms 33064 KB Output is correct
58 Correct 51 ms 33104 KB Output is correct
59 Correct 53 ms 33036 KB Output is correct
60 Correct 55 ms 33092 KB Output is correct
61 Correct 54 ms 33108 KB Output is correct
62 Correct 53 ms 33104 KB Output is correct
63 Correct 59 ms 32732 KB Output is correct
64 Correct 50 ms 32848 KB Output is correct
65 Correct 53 ms 33108 KB Output is correct
66 Correct 52 ms 33104 KB Output is correct
67 Correct 58 ms 33256 KB Output is correct
68 Correct 54 ms 33088 KB Output is correct
69 Correct 57 ms 33364 KB Output is correct
70 Correct 56 ms 33364 KB Output is correct
71 Correct 13 ms 24920 KB Output is correct
72 Correct 14 ms 25180 KB Output is correct
73 Correct 13 ms 25364 KB Output is correct
74 Correct 13 ms 25176 KB Output is correct
75 Correct 14 ms 25180 KB Output is correct
76 Correct 13 ms 25180 KB Output is correct
77 Correct 14 ms 25180 KB Output is correct
78 Correct 14 ms 25180 KB Output is correct
79 Correct 14 ms 25404 KB Output is correct
80 Correct 57 ms 33156 KB Output is correct
81 Correct 59 ms 32984 KB Output is correct
82 Correct 53 ms 33156 KB Output is correct
83 Correct 56 ms 33112 KB Output is correct
84 Correct 14 ms 25312 KB Output is correct
85 Correct 14 ms 25148 KB Output is correct
86 Correct 14 ms 25180 KB Output is correct
87 Correct 13 ms 25180 KB Output is correct
88 Correct 14 ms 25180 KB Output is correct
89 Correct 13 ms 25180 KB Output is correct
90 Correct 15 ms 25176 KB Output is correct
91 Correct 13 ms 25176 KB Output is correct
92 Correct 14 ms 25176 KB Output is correct
93 Correct 13 ms 25348 KB Output is correct
94 Correct 13 ms 25180 KB Output is correct
95 Correct 12 ms 25176 KB Output is correct
96 Correct 12 ms 25140 KB Output is correct
97 Correct 14 ms 25020 KB Output is correct
98 Correct 12 ms 25180 KB Output is correct
99 Correct 11 ms 25184 KB Output is correct
100 Correct 11 ms 25180 KB Output is correct
101 Correct 11 ms 25184 KB Output is correct
102 Correct 17 ms 25180 KB Output is correct
103 Correct 12 ms 25180 KB Output is correct
104 Correct 16 ms 26204 KB Output is correct
105 Correct 23 ms 28760 KB Output is correct
106 Correct 11 ms 25180 KB Output is correct
107 Correct 30 ms 30504 KB Output is correct
108 Correct 34 ms 33104 KB Output is correct
109 Correct 15 ms 25176 KB Output is correct
110 Correct 44 ms 35480 KB Output is correct
111 Correct 50 ms 38412 KB Output is correct
112 Correct 12 ms 25176 KB Output is correct
113 Correct 61 ms 43440 KB Output is correct
114 Correct 27 ms 29652 KB Output is correct
115 Correct 25 ms 29788 KB Output is correct
116 Correct 24 ms 29664 KB Output is correct
117 Correct 24 ms 29660 KB Output is correct
118 Correct 25 ms 29660 KB Output is correct
119 Correct 25 ms 30168 KB Output is correct
120 Correct 25 ms 29920 KB Output is correct
121 Correct 26 ms 29632 KB Output is correct
122 Correct 25 ms 29532 KB Output is correct
123 Correct 32 ms 29908 KB Output is correct
124 Correct 12 ms 24924 KB Output is correct
125 Correct 16 ms 27352 KB Output is correct
126 Correct 15 ms 27352 KB Output is correct
127 Correct 16 ms 27092 KB Output is correct
128 Correct 15 ms 27336 KB Output is correct
129 Correct 15 ms 27092 KB Output is correct
130 Correct 15 ms 27136 KB Output is correct
131 Correct 15 ms 27348 KB Output is correct
132 Correct 16 ms 27096 KB Output is correct
133 Correct 11 ms 24924 KB Output is correct
134 Correct 11 ms 24924 KB Output is correct
135 Correct 12 ms 25180 KB Output is correct
136 Correct 14 ms 27228 KB Output is correct
137 Correct 12 ms 25180 KB Output is correct
138 Correct 13 ms 25180 KB Output is correct
139 Correct 15 ms 25180 KB Output is correct
140 Correct 12 ms 25212 KB Output is correct
141 Correct 12 ms 25180 KB Output is correct
142 Correct 12 ms 25176 KB Output is correct
143 Correct 11 ms 25248 KB Output is correct
144 Correct 13 ms 25152 KB Output is correct
145 Correct 12 ms 25180 KB Output is correct
146 Correct 14 ms 25180 KB Output is correct
147 Correct 11 ms 25044 KB Output is correct
148 Correct 11 ms 25136 KB Output is correct
149 Correct 12 ms 25180 KB Output is correct
150 Correct 12 ms 24984 KB Output is correct
151 Correct 11 ms 25088 KB Output is correct
152 Correct 12 ms 25180 KB Output is correct
153 Correct 13 ms 25140 KB Output is correct
154 Correct 11 ms 25184 KB Output is correct
155 Correct 12 ms 25180 KB Output is correct
156 Correct 11 ms 25180 KB Output is correct
157 Correct 12 ms 25180 KB Output is correct
158 Correct 12 ms 25180 KB Output is correct
159 Correct 11 ms 25180 KB Output is correct
160 Correct 11 ms 24988 KB Output is correct
161 Correct 11 ms 25180 KB Output is correct
162 Correct 14 ms 25180 KB Output is correct
163 Correct 12 ms 24924 KB Output is correct
164 Correct 12 ms 24924 KB Output is correct
165 Correct 13 ms 25680 KB Output is correct
166 Correct 12 ms 25688 KB Output is correct
167 Correct 12 ms 25180 KB Output is correct
168 Correct 15 ms 25180 KB Output is correct
169 Correct 13 ms 25176 KB Output is correct
170 Correct 13 ms 25180 KB Output is correct
171 Correct 12 ms 25180 KB Output is correct
172 Correct 15 ms 25180 KB Output is correct
173 Correct 12 ms 25180 KB Output is correct
174 Correct 13 ms 25180 KB Output is correct
175 Correct 13 ms 23900 KB Output is correct
176 Correct 10 ms 25176 KB Output is correct
177 Correct 10 ms 25180 KB Output is correct
178 Correct 11 ms 25412 KB Output is correct
179 Correct 10 ms 25180 KB Output is correct
180 Correct 11 ms 25264 KB Output is correct
181 Correct 10 ms 25180 KB Output is correct
182 Correct 11 ms 25104 KB Output is correct
183 Correct 10 ms 25180 KB Output is correct
184 Correct 11 ms 25180 KB Output is correct
185 Correct 10 ms 25180 KB Output is correct
186 Correct 11 ms 25176 KB Output is correct
187 Correct 11 ms 25180 KB Output is correct
188 Correct 11 ms 25424 KB Output is correct
189 Correct 10 ms 25176 KB Output is correct
190 Correct 11 ms 25168 KB Output is correct
191 Correct 11 ms 25180 KB Output is correct
192 Correct 11 ms 25180 KB Output is correct
193 Correct 11 ms 25376 KB Output is correct
194 Correct 10 ms 25176 KB Output is correct
195 Correct 16 ms 25176 KB Output is correct
196 Correct 10 ms 25180 KB Output is correct
197 Correct 11 ms 25312 KB Output is correct
198 Correct 15 ms 25860 KB Output is correct
199 Correct 10 ms 25364 KB Output is correct
200 Correct 10 ms 25192 KB Output is correct
201 Correct 10 ms 25180 KB Output is correct
202 Correct 10 ms 25180 KB Output is correct
203 Correct 10 ms 25180 KB Output is correct
204 Correct 10 ms 25180 KB Output is correct
205 Correct 10 ms 25180 KB Output is correct
206 Correct 10 ms 25260 KB Output is correct
207 Correct 10 ms 25176 KB Output is correct
208 Correct 12 ms 25176 KB Output is correct
209 Correct 10 ms 25152 KB Output is correct
210 Correct 11 ms 25180 KB Output is correct
211 Correct 10 ms 25392 KB Output is correct
212 Correct 11 ms 25180 KB Output is correct
213 Correct 13 ms 25136 KB Output is correct
214 Correct 9 ms 25180 KB Output is correct
215 Correct 13 ms 25180 KB Output is correct
216 Correct 9 ms 25180 KB Output is correct
217 Correct 9 ms 25180 KB Output is correct
218 Correct 10 ms 24924 KB Output is correct
219 Correct 9 ms 25180 KB Output is correct
220 Correct 10 ms 25180 KB Output is correct
221 Correct 9 ms 25176 KB Output is correct
222 Correct 9 ms 25144 KB Output is correct
223 Correct 11 ms 25180 KB Output is correct
224 Correct 10 ms 25180 KB Output is correct
225 Correct 9 ms 25284 KB Output is correct
226 Correct 10 ms 25176 KB Output is correct
227 Correct 10 ms 25180 KB Output is correct
228 Correct 13 ms 25292 KB Output is correct
229 Correct 33 ms 30904 KB Output is correct
230 Correct 38 ms 32340 KB Output is correct
231 Correct 10 ms 25180 KB Output is correct
232 Correct 10 ms 25288 KB Output is correct
233 Correct 11 ms 25180 KB Output is correct
234 Correct 32 ms 30904 KB Output is correct
235 Correct 38 ms 32488 KB Output is correct
236 Correct 10 ms 25180 KB Output is correct
237 Correct 10 ms 25180 KB Output is correct
238 Correct 10 ms 25272 KB Output is correct
239 Correct 33 ms 31156 KB Output is correct
240 Correct 37 ms 32596 KB Output is correct
241 Correct 24 ms 29656 KB Output is correct
242 Correct 24 ms 29776 KB Output is correct
243 Correct 24 ms 29652 KB Output is correct
244 Correct 23 ms 29660 KB Output is correct
245 Correct 24 ms 29684 KB Output is correct
246 Correct 24 ms 30176 KB Output is correct
247 Correct 24 ms 29916 KB Output is correct
248 Correct 23 ms 29664 KB Output is correct
249 Correct 22 ms 29532 KB Output is correct
250 Correct 24 ms 29912 KB Output is correct
251 Correct 10 ms 25116 KB Output is correct
252 Correct 45 ms 41472 KB Output is correct
253 Correct 43 ms 41560 KB Output is correct
254 Correct 37 ms 35932 KB Output is correct
255 Correct 15 ms 27484 KB Output is correct
256 Correct 10 ms 25180 KB Output is correct
257 Correct 9 ms 25180 KB Output is correct
258 Correct 9 ms 25012 KB Output is correct
259 Correct 9 ms 25176 KB Output is correct
260 Correct 10 ms 24924 KB Output is correct
261 Correct 9 ms 25180 KB Output is correct
262 Correct 10 ms 25180 KB Output is correct
263 Correct 10 ms 25068 KB Output is correct
264 Correct 11 ms 25180 KB Output is correct
265 Correct 11 ms 25004 KB Output is correct
266 Correct 10 ms 25024 KB Output is correct
267 Correct 10 ms 25180 KB Output is correct
268 Correct 10 ms 25180 KB Output is correct
269 Correct 12 ms 25180 KB Output is correct
270 Correct 10 ms 25180 KB Output is correct
271 Correct 14 ms 25108 KB Output is correct
272 Correct 46 ms 33144 KB Output is correct
273 Correct 47 ms 33196 KB Output is correct
274 Correct 61 ms 33108 KB Output is correct
275 Correct 49 ms 33108 KB Output is correct
276 Correct 13 ms 27348 KB Output is correct
277 Correct 15 ms 27308 KB Output is correct
278 Correct 47 ms 33104 KB Output is correct
279 Correct 48 ms 33224 KB Output is correct
280 Correct 46 ms 32852 KB Output is correct
281 Correct 46 ms 32852 KB Output is correct
282 Correct 46 ms 33116 KB Output is correct
283 Correct 47 ms 33108 KB Output is correct
284 Correct 50 ms 33104 KB Output is correct
285 Correct 54 ms 33104 KB Output is correct
286 Correct 52 ms 33364 KB Output is correct
287 Correct 55 ms 33360 KB Output is correct
288 Correct 15 ms 27092 KB Output is correct
289 Correct 15 ms 27244 KB Output is correct
290 Correct 13 ms 27096 KB Output is correct
291 Correct 14 ms 27180 KB Output is correct
292 Correct 15 ms 27244 KB Output is correct
293 Correct 13 ms 27096 KB Output is correct
294 Correct 10 ms 24920 KB Output is correct
295 Correct 9 ms 24924 KB Output is correct
296 Correct 13 ms 25692 KB Output is correct
297 Correct 11 ms 25644 KB Output is correct
298 Correct 60 ms 32592 KB Output is correct
299 Correct 47 ms 32596 KB Output is correct
300 Correct 10 ms 25176 KB Output is correct
301 Correct 9 ms 25180 KB Output is correct
302 Correct 11 ms 25432 KB Output is correct
303 Correct 11 ms 25272 KB Output is correct
304 Correct 10 ms 25212 KB Output is correct
305 Correct 10 ms 25176 KB Output is correct
306 Correct 10 ms 25368 KB Output is correct
307 Correct 11 ms 25176 KB Output is correct
308 Correct 9 ms 25180 KB Output is correct
309 Correct 12 ms 25320 KB Output is correct
310 Correct 10 ms 25180 KB Output is correct
311 Correct 11 ms 25412 KB Output is correct
312 Correct 11 ms 25180 KB Output is correct
313 Correct 10 ms 25276 KB Output is correct
314 Correct 10 ms 25176 KB Output is correct
315 Correct 10 ms 25180 KB Output is correct
316 Correct 10 ms 25304 KB Output is correct
317 Correct 11 ms 25188 KB Output is correct
318 Correct 10 ms 25180 KB Output is correct
319 Correct 13 ms 25412 KB Output is correct
320 Correct 11 ms 25176 KB Output is correct
321 Correct 11 ms 25268 KB Output is correct
322 Correct 10 ms 25180 KB Output is correct
323 Correct 11 ms 25176 KB Output is correct
324 Correct 10 ms 25180 KB Output is correct
325 Correct 12 ms 25256 KB Output is correct
326 Correct 11 ms 25176 KB Output is correct
327 Correct 12 ms 25196 KB Output is correct
328 Correct 9 ms 25152 KB Output is correct
329 Correct 9 ms 25176 KB Output is correct
330 Correct 11 ms 25180 KB Output is correct
331 Correct 10 ms 25180 KB Output is correct
332 Correct 10 ms 25124 KB Output is correct
333 Correct 10 ms 25180 KB Output is correct
334 Correct 10 ms 25180 KB Output is correct
335 Correct 10 ms 25220 KB Output is correct
336 Correct 54 ms 41940 KB Output is correct
337 Correct 59 ms 43228 KB Output is correct
338 Correct 49 ms 32588 KB Output is correct
339 Correct 50 ms 32848 KB Output is correct
340 Correct 21 ms 28880 KB Output is correct
341 Correct 25 ms 30032 KB Output is correct
342 Correct 50 ms 33108 KB Output is correct
343 Correct 48 ms 33108 KB Output is correct
344 Correct 32 ms 30804 KB Output is correct
345 Correct 24 ms 29648 KB Output is correct
346 Correct 49 ms 33104 KB Output is correct
347 Correct 50 ms 33336 KB Output is correct
348 Correct 40 ms 32852 KB Output is correct
349 Correct 37 ms 32232 KB Output is correct
350 Correct 47 ms 33104 KB Output is correct
351 Correct 46 ms 33260 KB Output is correct
352 Correct 15 ms 27608 KB Output is correct
353 Correct 40 ms 32340 KB Output is correct
354 Correct 25 ms 29884 KB Output is correct
355 Correct 30 ms 29904 KB Output is correct
356 Correct 39 ms 31836 KB Output is correct
357 Correct 19 ms 28376 KB Output is correct
358 Correct 25 ms 29912 KB Output is correct
359 Correct 25 ms 29912 KB Output is correct
360 Correct 14 ms 27348 KB Output is correct
361 Correct 12 ms 27352 KB Output is correct
362 Correct 42 ms 33108 KB Output is correct
363 Correct 53 ms 33108 KB Output is correct
364 Correct 31 ms 30640 KB Output is correct
365 Correct 28 ms 29492 KB Output is correct
366 Correct 31 ms 30668 KB Output is correct
367 Correct 37 ms 31316 KB Output is correct
368 Correct 38 ms 32080 KB Output is correct
369 Correct 31 ms 31316 KB Output is correct
370 Correct 26 ms 30168 KB Output is correct
371 Correct 40 ms 32092 KB Output is correct
372 Correct 10 ms 25176 KB Output is correct
373 Correct 10 ms 25352 KB Output is correct
374 Correct 9 ms 25180 KB Output is correct
375 Correct 10 ms 25180 KB Output is correct
376 Correct 10 ms 25180 KB Output is correct
377 Correct 10 ms 25180 KB Output is correct
378 Correct 11 ms 25180 KB Output is correct
379 Correct 11 ms 25212 KB Output is correct
380 Correct 11 ms 25180 KB Output is correct
381 Correct 10 ms 25364 KB Output is correct
382 Correct 9 ms 25188 KB Output is correct
383 Correct 9 ms 25176 KB Output is correct
384 Correct 9 ms 25180 KB Output is correct
385 Correct 12 ms 25144 KB Output is correct
386 Correct 10 ms 25180 KB Output is correct
387 Correct 9 ms 25180 KB Output is correct
388 Correct 9 ms 25176 KB Output is correct
389 Correct 9 ms 25180 KB Output is correct
390 Correct 9 ms 25032 KB Output is correct
391 Correct 10 ms 25180 KB Output is correct
392 Correct 14 ms 26204 KB Output is correct
393 Correct 18 ms 28612 KB Output is correct
394 Correct 10 ms 25224 KB Output is correct
395 Correct 28 ms 30636 KB Output is correct
396 Correct 33 ms 33360 KB Output is correct
397 Correct 10 ms 25180 KB Output is correct
398 Correct 41 ms 35492 KB Output is correct
399 Correct 58 ms 38488 KB Output is correct
400 Correct 10 ms 25124 KB Output is correct
401 Correct 60 ms 43344 KB Output is correct