답안 #842148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
842148 2023-09-02T12:48:52 Z danikoynov 봉쇄 시간 (IOI23_closing) C++17
75 / 100
1000 ms 1021176 KB
#include "closing.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int maxn = 2e5 + 10;

vector < pair < int, ll > > adj[maxn];
ll dist[2][maxn];
int n;

void bfs(int s, ll arr[])
{
    queue < int > q;
    for (int i = 0; i < n; i ++)
        arr[i] = -1;

    arr[s] = 0;
    q.push(s);
    while(!q.empty())
    {
        int v = q.front();
        q.pop();
        for (pair < int, ll > nb : adj[v])
        {
            if (arr[nb.first] == -1)
            {
                arr[nb.first] = arr[v] + nb.second;
                q.push(nb.first);
            }
        }
    }
}
const ll inf = 1e18;




ll value[maxn];
ll dp[2][2][3010][3010 * 2], sub[maxn], temp[2][2][maxn * 2];
int used[maxn];
/**

*/
vector < int > st[maxn];
void dfs(int v, int t)
{
    ///cout << "dfs " << v << endl;
    sub[v] = 1;
    used[v] = 1;
    if (t != v)
        st[t].push_back(v);

    for (int j = 0; j <= 2; j ++)
        for (int d = 0; d < 2; d ++)
            for (int z = 0; z < 2; z ++)
                dp[d][z][v][j] = inf;
    dp[0][0][v][0] = 0;
    dp[1][0][v][1] = dist[0][v];
    dp[0][1][v][1] = dist[1][v];
    dp[1][1][v][2] = max(dist[0][v], dist[1][v]);

    for (pair < int, ll > nb : adj[v])
    {
        if (used[nb.first])
            continue;

        dfs(nb.first, t);
        int u = nb.first;
        for (int i = 0; i <= (sub[u] + sub[v]) * 2; i ++)
            for (int x = 0; x < 2; x ++)
                for (int y = 0; y < 2; y ++)
                    temp[x][y][i]= inf;

        for (int i = 0; i <= sub[v] * 2; i ++)
            for (int j = 0; j <= sub[u] * 2; j ++)
                for (int d = 0; d < 2; d ++)
                    for (int z = 0; z < 2; z ++)
                        for (int x = 0; x <= d; x ++)
                            for (int y = 0; y <= z; y ++)
                            {

                                temp[d][z][i + j] = min(temp[d][z][i + j], dp[d][z][v][i] + dp[x][y][u][j]);
                            }

        for (int i = 0; i <= (sub[v] + sub[u]) * 2; i ++)
            for (int x = 0; x < 2; x ++)
                for (int y = 0; y < 2; y ++)
                    dp[x][y][v][i] = temp[x][y][i];
        sub[v] += sub[u];
    }
}

ll fp[3][3010][3010 * 2], tp[3010 * 2];
void unite(ll arr1[], int sz1, ll arr2[], int sz2, ll res[])
{
    for (int i = 0; i <= (sz1 + sz2) * 2; i ++)
    {
        tp[i] = inf;
    }

    for (int i = 0; i <= sz1 * 2; i ++)
        for (int j = 0; j <= sz2 * 2; j ++)
            tp[i + j] = min(tp[i + j], arr1[i] + arr2[j]);

    for (int i = 0; i <= (sz1 + sz2) * 2; i ++)
        res[i] = tp[i];
}

vector < int > path;
bool get_path(int v, int p, int target)
{
    if (v == target)
    {
        path.push_back(v);
        return true;
    }

    for (pair < int, ll > nb : adj[v])
    {
        if (nb.first == p)
            continue;
        if (get_path(nb.first, v, target))
        {
            path.push_back(v);
            return true;
        }
    }
    return false;
}

int ans, loc[maxn];

ll td[3][3][maxn];
int max_score(int N, int X, int Y, long long K,
              vector<int> U, vector<int> V, vector<int> W)
{

    for (int i = 0; i < N; i ++)
    {
        dist[0][i] = dist[1][i] = 0;
        adj[i].clear();
        used[i] = 0;
        value[i] = 0;
    }
    ans = 0;
    n = N;
    for (int i = 0; i < N - 1; i ++)
    {
        adj[U[i]].push_back({V[i], W[i]});
        adj[V[i]].push_back({U[i], W[i]});
    }

    bfs(X, dist[0]);
    bfs(Y, dist[1]);

    path.clear();
    get_path(Y, -1, X);
    for (int cur : path)
        used[cur] = 1;
    for (int cur : path)
        dfs(cur, cur);

    vector < ll > vec;
    for (int i = 0; i < N; i ++)
    {
        vec.push_back(dist[0][i]);
        vec.push_back(dist[1][i]);
    }

    sort(vec.begin(), vec.end());
    ll sum = 0;
    for (int i = 0; i < vec.size(); i ++)
    {
        sum += vec[i];
        if (sum > K)
            break;
        ans = max(ans, i + 1);
    }


    for (int id = (int)(path.size()) - 1; id >= 0; id --)
    {
        int ver = path[id];
        loc[ver] = sub[ver];
        for (int j = 0; j <= 2 * sub[ver]; j ++)
        {
            fp[2][ver][j] = dp[0][1][ver][j];
            fp[1][ver][j] = dp[1][1][ver][j];
            fp[0][ver][j] = dp[1][0][ver][j];
        }


        if (id + 1 == path.size())
            continue;

        for (int j = 0; j < 3; j ++)
        {
            for (int p = j; p < 3; p ++)
            {
                unite(fp[j][ver], loc[ver], fp[p][path[id + 1]], loc[path[id + 1]], td[j][p]);
                /**for (int i = 0; i <= N * 2; i ++)
                    cout << td[j][p][i] << " ";
                cout << endl;*/
            }
        }
        ///cout << "step " << ver << endl; for (int i = 0; i <= 2* (loc[ver] + loc[path[id + 1]]); i ++)
        ///cout << td[0][1][i] << endl;
        for (int j = 0; j < 3; j ++)
        {
            for (int i = 0; i <= 2 * (loc[ver] + loc[path[id + 1]]); i ++)
                fp[j][ver][i] = inf;
            for (int p = j; p < 3; p ++)
            {



                for (int i = 0; i <= 2 * (loc[ver] + loc[path[id + 1]]); i ++)
                {

                    fp[j][ver][i] = min(fp[j][ver][i], td[j][p][i]);
                }
            }
        }


        loc[ver] += loc[path[id + 1]];
    }


    for (int i = 0; i <= N * 2; i ++)
    {
        ///cout << fp[0][path[0]][i] <<  " : " << i << endl;
        if (fp[0][path[0]][i] <= K)
            ans = max(ans, i);
    }

    for (int i = 0; i <= N * 2; i ++)
    {
        ///cout << fp[1][path[0]][i] <<  " : " << i << endl;
        if (fp[1][path[0]][i] <= K)
            ans = max(ans, i);
    }
    return ans;

}

Compilation message

closing.cpp: In function 'int max_score(int, int, int, long long int, std::vector<int>, std::vector<int>, std::vector<int>)':
closing.cpp:174:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  174 |     for (int i = 0; i < vec.size(); i ++)
      |                     ~~^~~~~~~~~~~~
closing.cpp:195:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  195 |         if (id + 1 == path.size())
      |             ~~~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 116 ms 55756 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52060 KB Output is correct
3 Correct 7 ms 52060 KB Output is correct
4 Correct 6 ms 43864 KB Output is correct
5 Correct 7 ms 51892 KB Output is correct
6 Correct 9 ms 62300 KB Output is correct
7 Correct 7 ms 60252 KB Output is correct
8 Correct 8 ms 64348 KB Output is correct
9 Correct 8 ms 66392 KB Output is correct
10 Correct 7 ms 58204 KB Output is correct
11 Correct 7 ms 58040 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52060 KB Output is correct
3 Correct 7 ms 52060 KB Output is correct
4 Correct 6 ms 43864 KB Output is correct
5 Correct 7 ms 51892 KB Output is correct
6 Correct 9 ms 62300 KB Output is correct
7 Correct 7 ms 60252 KB Output is correct
8 Correct 8 ms 64348 KB Output is correct
9 Correct 8 ms 66392 KB Output is correct
10 Correct 7 ms 58204 KB Output is correct
11 Correct 7 ms 58040 KB Output is correct
12 Correct 8 ms 70488 KB Output is correct
13 Correct 8 ms 68444 KB Output is correct
14 Correct 9 ms 76676 KB Output is correct
15 Correct 9 ms 70492 KB Output is correct
16 Correct 10 ms 72540 KB Output is correct
17 Correct 9 ms 72536 KB Output is correct
18 Correct 8 ms 52060 KB Output is correct
19 Correct 21 ms 144476 KB Output is correct
20 Correct 22 ms 134224 KB Output is correct
21 Correct 24 ms 187484 KB Output is correct
22 Correct 29 ms 173112 KB Output is correct
23 Correct 27 ms 201820 KB Output is correct
24 Correct 28 ms 201916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52060 KB Output is correct
3 Correct 7 ms 52060 KB Output is correct
4 Correct 6 ms 43864 KB Output is correct
5 Correct 7 ms 51892 KB Output is correct
6 Correct 9 ms 62300 KB Output is correct
7 Correct 7 ms 60252 KB Output is correct
8 Correct 8 ms 64348 KB Output is correct
9 Correct 8 ms 66392 KB Output is correct
10 Correct 7 ms 58204 KB Output is correct
11 Correct 7 ms 58040 KB Output is correct
12 Correct 8 ms 70488 KB Output is correct
13 Correct 8 ms 68444 KB Output is correct
14 Correct 9 ms 76676 KB Output is correct
15 Correct 9 ms 70492 KB Output is correct
16 Correct 10 ms 72540 KB Output is correct
17 Correct 9 ms 72536 KB Output is correct
18 Correct 8 ms 52060 KB Output is correct
19 Correct 21 ms 144476 KB Output is correct
20 Correct 22 ms 134224 KB Output is correct
21 Correct 24 ms 187484 KB Output is correct
22 Correct 29 ms 173112 KB Output is correct
23 Correct 27 ms 201820 KB Output is correct
24 Correct 28 ms 201916 KB Output is correct
25 Correct 13 ms 66396 KB Output is correct
26 Correct 701 ms 614912 KB Output is correct
27 Correct 267 ms 580100 KB Output is correct
28 Correct 709 ms 972016 KB Output is correct
29 Correct 250 ms 864944 KB Output is correct
30 Correct 245 ms 645528 KB Output is correct
31 Correct 381 ms 1021176 KB Output is correct
32 Correct 313 ms 1021012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52056 KB Output is correct
3 Correct 6 ms 52060 KB Output is correct
4 Correct 7 ms 52060 KB Output is correct
5 Correct 6 ms 43864 KB Output is correct
6 Correct 7 ms 51892 KB Output is correct
7 Correct 7 ms 52060 KB Output is correct
8 Correct 6 ms 52060 KB Output is correct
9 Correct 7 ms 52060 KB Output is correct
10 Correct 6 ms 52056 KB Output is correct
11 Correct 7 ms 52060 KB Output is correct
12 Correct 6 ms 52060 KB Output is correct
13 Correct 6 ms 52060 KB Output is correct
14 Correct 6 ms 52060 KB Output is correct
15 Correct 7 ms 52056 KB Output is correct
16 Correct 7 ms 52056 KB Output is correct
17 Correct 6 ms 52312 KB Output is correct
18 Correct 7 ms 52044 KB Output is correct
19 Correct 7 ms 52060 KB Output is correct
20 Correct 7 ms 52060 KB Output is correct
21 Correct 6 ms 52060 KB Output is correct
22 Correct 7 ms 52060 KB Output is correct
23 Correct 6 ms 52060 KB Output is correct
24 Correct 6 ms 52056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52056 KB Output is correct
3 Correct 6 ms 52060 KB Output is correct
4 Correct 7 ms 52060 KB Output is correct
5 Correct 6 ms 43864 KB Output is correct
6 Correct 7 ms 51892 KB Output is correct
7 Correct 9 ms 62300 KB Output is correct
8 Correct 7 ms 60252 KB Output is correct
9 Correct 8 ms 64348 KB Output is correct
10 Correct 8 ms 66392 KB Output is correct
11 Correct 7 ms 58204 KB Output is correct
12 Correct 7 ms 58040 KB Output is correct
13 Correct 8 ms 70488 KB Output is correct
14 Correct 8 ms 68444 KB Output is correct
15 Correct 9 ms 76676 KB Output is correct
16 Correct 9 ms 70492 KB Output is correct
17 Correct 10 ms 72540 KB Output is correct
18 Correct 9 ms 72536 KB Output is correct
19 Correct 7 ms 52060 KB Output is correct
20 Correct 6 ms 52060 KB Output is correct
21 Correct 7 ms 52060 KB Output is correct
22 Correct 6 ms 52056 KB Output is correct
23 Correct 7 ms 52060 KB Output is correct
24 Correct 6 ms 52060 KB Output is correct
25 Correct 6 ms 52060 KB Output is correct
26 Correct 6 ms 52060 KB Output is correct
27 Correct 7 ms 52056 KB Output is correct
28 Correct 7 ms 52056 KB Output is correct
29 Correct 6 ms 52312 KB Output is correct
30 Correct 7 ms 52044 KB Output is correct
31 Correct 7 ms 52060 KB Output is correct
32 Correct 7 ms 52060 KB Output is correct
33 Correct 6 ms 52060 KB Output is correct
34 Correct 7 ms 52060 KB Output is correct
35 Correct 6 ms 52060 KB Output is correct
36 Correct 6 ms 52056 KB Output is correct
37 Correct 6 ms 52060 KB Output is correct
38 Correct 8 ms 66396 KB Output is correct
39 Correct 8 ms 70492 KB Output is correct
40 Correct 10 ms 80732 KB Output is correct
41 Correct 9 ms 74588 KB Output is correct
42 Correct 10 ms 80732 KB Output is correct
43 Correct 10 ms 80816 KB Output is correct
44 Correct 8 ms 68444 KB Output is correct
45 Correct 10 ms 80688 KB Output is correct
46 Correct 10 ms 80732 KB Output is correct
47 Correct 9 ms 76708 KB Output is correct
48 Correct 9 ms 78684 KB Output is correct
49 Correct 8 ms 66444 KB Output is correct
50 Correct 7 ms 54064 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52056 KB Output is correct
3 Correct 6 ms 52060 KB Output is correct
4 Correct 7 ms 52060 KB Output is correct
5 Correct 6 ms 43864 KB Output is correct
6 Correct 7 ms 51892 KB Output is correct
7 Correct 9 ms 62300 KB Output is correct
8 Correct 7 ms 60252 KB Output is correct
9 Correct 8 ms 64348 KB Output is correct
10 Correct 8 ms 66392 KB Output is correct
11 Correct 7 ms 58204 KB Output is correct
12 Correct 7 ms 58040 KB Output is correct
13 Correct 8 ms 70488 KB Output is correct
14 Correct 8 ms 68444 KB Output is correct
15 Correct 9 ms 76676 KB Output is correct
16 Correct 9 ms 70492 KB Output is correct
17 Correct 10 ms 72540 KB Output is correct
18 Correct 9 ms 72536 KB Output is correct
19 Correct 8 ms 52060 KB Output is correct
20 Correct 21 ms 144476 KB Output is correct
21 Correct 22 ms 134224 KB Output is correct
22 Correct 24 ms 187484 KB Output is correct
23 Correct 29 ms 173112 KB Output is correct
24 Correct 27 ms 201820 KB Output is correct
25 Correct 28 ms 201916 KB Output is correct
26 Correct 7 ms 52060 KB Output is correct
27 Correct 6 ms 52060 KB Output is correct
28 Correct 7 ms 52060 KB Output is correct
29 Correct 6 ms 52056 KB Output is correct
30 Correct 7 ms 52060 KB Output is correct
31 Correct 6 ms 52060 KB Output is correct
32 Correct 6 ms 52060 KB Output is correct
33 Correct 6 ms 52060 KB Output is correct
34 Correct 7 ms 52056 KB Output is correct
35 Correct 7 ms 52056 KB Output is correct
36 Correct 6 ms 52312 KB Output is correct
37 Correct 7 ms 52044 KB Output is correct
38 Correct 7 ms 52060 KB Output is correct
39 Correct 7 ms 52060 KB Output is correct
40 Correct 6 ms 52060 KB Output is correct
41 Correct 7 ms 52060 KB Output is correct
42 Correct 6 ms 52060 KB Output is correct
43 Correct 6 ms 52056 KB Output is correct
44 Correct 6 ms 52060 KB Output is correct
45 Correct 8 ms 66396 KB Output is correct
46 Correct 8 ms 70492 KB Output is correct
47 Correct 10 ms 80732 KB Output is correct
48 Correct 9 ms 74588 KB Output is correct
49 Correct 10 ms 80732 KB Output is correct
50 Correct 10 ms 80816 KB Output is correct
51 Correct 8 ms 68444 KB Output is correct
52 Correct 10 ms 80688 KB Output is correct
53 Correct 10 ms 80732 KB Output is correct
54 Correct 9 ms 76708 KB Output is correct
55 Correct 9 ms 78684 KB Output is correct
56 Correct 8 ms 66444 KB Output is correct
57 Correct 7 ms 54064 KB Output is correct
58 Correct 7 ms 58204 KB Output is correct
59 Correct 10 ms 80732 KB Output is correct
60 Correct 11 ms 80732 KB Output is correct
61 Correct 12 ms 95044 KB Output is correct
62 Correct 12 ms 95188 KB Output is correct
63 Correct 22 ms 150564 KB Output is correct
64 Correct 22 ms 177112 KB Output is correct
65 Correct 23 ms 193680 KB Output is correct
66 Correct 20 ms 142428 KB Output is correct
67 Correct 23 ms 175664 KB Output is correct
68 Correct 24 ms 189532 KB Output is correct
69 Correct 25 ms 197768 KB Output is correct
70 Correct 25 ms 210012 KB Output is correct
71 Correct 26 ms 208052 KB Output is correct
72 Correct 23 ms 197716 KB Output is correct
73 Correct 19 ms 144216 KB Output is correct
74 Correct 18 ms 144476 KB Output is correct
75 Correct 10 ms 76636 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52056 KB Output is correct
3 Correct 6 ms 52060 KB Output is correct
4 Correct 7 ms 52060 KB Output is correct
5 Correct 6 ms 43864 KB Output is correct
6 Correct 7 ms 51892 KB Output is correct
7 Correct 9 ms 62300 KB Output is correct
8 Correct 7 ms 60252 KB Output is correct
9 Correct 8 ms 64348 KB Output is correct
10 Correct 8 ms 66392 KB Output is correct
11 Correct 7 ms 58204 KB Output is correct
12 Correct 7 ms 58040 KB Output is correct
13 Correct 8 ms 70488 KB Output is correct
14 Correct 8 ms 68444 KB Output is correct
15 Correct 9 ms 76676 KB Output is correct
16 Correct 9 ms 70492 KB Output is correct
17 Correct 10 ms 72540 KB Output is correct
18 Correct 9 ms 72536 KB Output is correct
19 Correct 8 ms 52060 KB Output is correct
20 Correct 21 ms 144476 KB Output is correct
21 Correct 22 ms 134224 KB Output is correct
22 Correct 24 ms 187484 KB Output is correct
23 Correct 29 ms 173112 KB Output is correct
24 Correct 27 ms 201820 KB Output is correct
25 Correct 28 ms 201916 KB Output is correct
26 Correct 13 ms 66396 KB Output is correct
27 Correct 701 ms 614912 KB Output is correct
28 Correct 267 ms 580100 KB Output is correct
29 Correct 709 ms 972016 KB Output is correct
30 Correct 250 ms 864944 KB Output is correct
31 Correct 245 ms 645528 KB Output is correct
32 Correct 381 ms 1021176 KB Output is correct
33 Correct 313 ms 1021012 KB Output is correct
34 Correct 7 ms 52060 KB Output is correct
35 Correct 6 ms 52060 KB Output is correct
36 Correct 7 ms 52060 KB Output is correct
37 Correct 6 ms 52056 KB Output is correct
38 Correct 7 ms 52060 KB Output is correct
39 Correct 6 ms 52060 KB Output is correct
40 Correct 6 ms 52060 KB Output is correct
41 Correct 6 ms 52060 KB Output is correct
42 Correct 7 ms 52056 KB Output is correct
43 Correct 7 ms 52056 KB Output is correct
44 Correct 6 ms 52312 KB Output is correct
45 Correct 7 ms 52044 KB Output is correct
46 Correct 7 ms 52060 KB Output is correct
47 Correct 7 ms 52060 KB Output is correct
48 Correct 6 ms 52060 KB Output is correct
49 Correct 7 ms 52060 KB Output is correct
50 Correct 6 ms 52060 KB Output is correct
51 Correct 6 ms 52056 KB Output is correct
52 Correct 6 ms 52060 KB Output is correct
53 Correct 8 ms 66396 KB Output is correct
54 Correct 8 ms 70492 KB Output is correct
55 Correct 10 ms 80732 KB Output is correct
56 Correct 9 ms 74588 KB Output is correct
57 Correct 10 ms 80732 KB Output is correct
58 Correct 10 ms 80816 KB Output is correct
59 Correct 8 ms 68444 KB Output is correct
60 Correct 10 ms 80688 KB Output is correct
61 Correct 10 ms 80732 KB Output is correct
62 Correct 9 ms 76708 KB Output is correct
63 Correct 9 ms 78684 KB Output is correct
64 Correct 8 ms 66444 KB Output is correct
65 Correct 7 ms 54064 KB Output is correct
66 Correct 7 ms 58204 KB Output is correct
67 Correct 10 ms 80732 KB Output is correct
68 Correct 11 ms 80732 KB Output is correct
69 Correct 12 ms 95044 KB Output is correct
70 Correct 12 ms 95188 KB Output is correct
71 Correct 22 ms 150564 KB Output is correct
72 Correct 22 ms 177112 KB Output is correct
73 Correct 23 ms 193680 KB Output is correct
74 Correct 20 ms 142428 KB Output is correct
75 Correct 23 ms 175664 KB Output is correct
76 Correct 24 ms 189532 KB Output is correct
77 Correct 25 ms 197768 KB Output is correct
78 Correct 25 ms 210012 KB Output is correct
79 Correct 26 ms 208052 KB Output is correct
80 Correct 23 ms 197716 KB Output is correct
81 Correct 19 ms 144216 KB Output is correct
82 Correct 18 ms 144476 KB Output is correct
83 Correct 10 ms 76636 KB Output is correct
84 Correct 12 ms 66508 KB Output is correct
85 Correct 29 ms 138276 KB Output is correct
86 Correct 18 ms 80732 KB Output is correct
87 Correct 18 ms 95232 KB Output is correct
88 Correct 21 ms 95068 KB Output is correct
89 Correct 268 ms 629120 KB Output is correct
90 Correct 213 ms 632916 KB Output is correct
91 Correct 208 ms 1004368 KB Output is correct
92 Correct 239 ms 594084 KB Output is correct
93 Correct 183 ms 873188 KB Output is correct
94 Correct 252 ms 893848 KB Output is correct
95 Correct 275 ms 934760 KB Output is correct
96 Correct 216 ms 953348 KB Output is correct
97 Correct 218 ms 1014784 KB Output is correct
98 Correct 182 ms 698692 KB Output is correct
99 Correct 266 ms 624956 KB Output is correct
100 Correct 158 ms 493392 KB Output is correct
101 Correct 47 ms 191692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 52056 KB Output is correct
2 Correct 6 ms 52056 KB Output is correct
3 Correct 6 ms 52060 KB Output is correct
4 Correct 7 ms 52060 KB Output is correct
5 Correct 6 ms 43864 KB Output is correct
6 Correct 7 ms 51892 KB Output is correct
7 Correct 9 ms 62300 KB Output is correct
8 Correct 7 ms 60252 KB Output is correct
9 Correct 8 ms 64348 KB Output is correct
10 Correct 8 ms 66392 KB Output is correct
11 Correct 7 ms 58204 KB Output is correct
12 Correct 7 ms 58040 KB Output is correct
13 Correct 8 ms 70488 KB Output is correct
14 Correct 8 ms 68444 KB Output is correct
15 Correct 9 ms 76676 KB Output is correct
16 Correct 9 ms 70492 KB Output is correct
17 Correct 10 ms 72540 KB Output is correct
18 Correct 9 ms 72536 KB Output is correct
19 Correct 8 ms 52060 KB Output is correct
20 Correct 21 ms 144476 KB Output is correct
21 Correct 22 ms 134224 KB Output is correct
22 Correct 24 ms 187484 KB Output is correct
23 Correct 29 ms 173112 KB Output is correct
24 Correct 27 ms 201820 KB Output is correct
25 Correct 28 ms 201916 KB Output is correct
26 Correct 13 ms 66396 KB Output is correct
27 Correct 701 ms 614912 KB Output is correct
28 Correct 267 ms 580100 KB Output is correct
29 Correct 709 ms 972016 KB Output is correct
30 Correct 250 ms 864944 KB Output is correct
31 Correct 245 ms 645528 KB Output is correct
32 Correct 381 ms 1021176 KB Output is correct
33 Correct 313 ms 1021012 KB Output is correct
34 Correct 7 ms 52060 KB Output is correct
35 Correct 6 ms 52060 KB Output is correct
36 Correct 7 ms 52060 KB Output is correct
37 Correct 6 ms 52056 KB Output is correct
38 Correct 7 ms 52060 KB Output is correct
39 Correct 6 ms 52060 KB Output is correct
40 Correct 6 ms 52060 KB Output is correct
41 Correct 6 ms 52060 KB Output is correct
42 Correct 7 ms 52056 KB Output is correct
43 Correct 7 ms 52056 KB Output is correct
44 Correct 6 ms 52312 KB Output is correct
45 Correct 7 ms 52044 KB Output is correct
46 Correct 7 ms 52060 KB Output is correct
47 Correct 7 ms 52060 KB Output is correct
48 Correct 6 ms 52060 KB Output is correct
49 Correct 7 ms 52060 KB Output is correct
50 Correct 6 ms 52060 KB Output is correct
51 Correct 6 ms 52056 KB Output is correct
52 Correct 6 ms 52060 KB Output is correct
53 Correct 8 ms 66396 KB Output is correct
54 Correct 8 ms 70492 KB Output is correct
55 Correct 10 ms 80732 KB Output is correct
56 Correct 9 ms 74588 KB Output is correct
57 Correct 10 ms 80732 KB Output is correct
58 Correct 10 ms 80816 KB Output is correct
59 Correct 8 ms 68444 KB Output is correct
60 Correct 10 ms 80688 KB Output is correct
61 Correct 10 ms 80732 KB Output is correct
62 Correct 9 ms 76708 KB Output is correct
63 Correct 9 ms 78684 KB Output is correct
64 Correct 8 ms 66444 KB Output is correct
65 Correct 7 ms 54064 KB Output is correct
66 Correct 7 ms 58204 KB Output is correct
67 Correct 10 ms 80732 KB Output is correct
68 Correct 11 ms 80732 KB Output is correct
69 Correct 12 ms 95044 KB Output is correct
70 Correct 12 ms 95188 KB Output is correct
71 Correct 22 ms 150564 KB Output is correct
72 Correct 22 ms 177112 KB Output is correct
73 Correct 23 ms 193680 KB Output is correct
74 Correct 20 ms 142428 KB Output is correct
75 Correct 23 ms 175664 KB Output is correct
76 Correct 24 ms 189532 KB Output is correct
77 Correct 25 ms 197768 KB Output is correct
78 Correct 25 ms 210012 KB Output is correct
79 Correct 26 ms 208052 KB Output is correct
80 Correct 23 ms 197716 KB Output is correct
81 Correct 19 ms 144216 KB Output is correct
82 Correct 18 ms 144476 KB Output is correct
83 Correct 10 ms 76636 KB Output is correct
84 Correct 12 ms 66508 KB Output is correct
85 Correct 29 ms 138276 KB Output is correct
86 Correct 18 ms 80732 KB Output is correct
87 Correct 18 ms 95232 KB Output is correct
88 Correct 21 ms 95068 KB Output is correct
89 Correct 268 ms 629120 KB Output is correct
90 Correct 213 ms 632916 KB Output is correct
91 Correct 208 ms 1004368 KB Output is correct
92 Correct 239 ms 594084 KB Output is correct
93 Correct 183 ms 873188 KB Output is correct
94 Correct 252 ms 893848 KB Output is correct
95 Correct 275 ms 934760 KB Output is correct
96 Correct 216 ms 953348 KB Output is correct
97 Correct 218 ms 1014784 KB Output is correct
98 Correct 182 ms 698692 KB Output is correct
99 Correct 266 ms 624956 KB Output is correct
100 Correct 158 ms 493392 KB Output is correct
101 Correct 47 ms 191692 KB Output is correct
102 Correct 420 ms 84928 KB Output is correct
103 Execution timed out 1012 ms 184820 KB Time limit exceeded
104 Halted 0 ms 0 KB -