답안 #927981

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
927981 2024-02-15T15:54:06 Z boris_mihov Two Transportations (JOI19_transportations) C++17
62 / 100
456 ms 49056 KB
#include "Azer.h"
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cassert>
#include <random>
#include <vector>
#include <queue>

typedef long long llong;
const int MAXN = 2000 + 10;
const int MAXM = 500000 + 10;
const int INF  = 1e9;

static int n, m;
static int lastDist;
static int dist[MAXN];
static bool vis[MAXN];
static int DIST_BITS = 9;
static int NODE_BITS = 11;
static std::mt19937 rng(123456789);
static std::vector <bool> sequence;

struct PQelement
{
    int node;
    int currDist;

    friend bool operator < (const PQelement &a, const PQelement &b)
    {
        return a.currDist > b.currDist || (a.currDist == b.currDist && a.node > b.node);
    }
};

static std::vector <std::pair <int,int>> g[MAXN];
static std::priority_queue <PQelement> pq;
static std::queue <int> receivedQueue;
static int cntDoneTurns;
static int cntEntries;

int readA(int);
void writeA(int, int);
void manageA();

int getNodeA(int idx)
{
    if (idx == n + 1)
    {
        return n;
    }

    assert(idx != 0);
    // std::cout << "get node: " << idx << '\n' << std::flush;
    for (int i = 0 ; i <= n ; ++i)
    {
        if (!vis[i] && idx == 1)
        {
            return i;
        }

        idx -= !vis[i];
    }

    assert(false);
}

int getIdxA(int node)
{
    int idx = 0;
    for (int i = 0 ; i <= node ; ++i)
    {
        idx += !vis[i];
    }

    // std::cout << "get idx: " << node << ' ' << idx << '\n' << std::flush;
    return idx;
}

std::pair <int,int> readPairA()
{
    if (receivedQueue.front() == 1)
    {
        receivedQueue.pop();
        return {n + 1, 1e9};
    }

    receivedQueue.pop();
    return {readA(NODE_BITS), readA(DIST_BITS)};
}

void sendMyTopA()
{
    cntEntries++;
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    if (pq.size())
    {
        // std::cout << "send from A: " << pq.top().node << ' ' << pq.top().currDist << '\n';
        writeA(getIdxA(pq.top().node), NODE_BITS);
        writeA(pq.top().currDist - lastDist, DIST_BITS);
    } else
    {
        // std::cout << "send from A: " << n << ' ' << -1 << '\n';
        writeA(getIdxA(n), NODE_BITS);
        writeA(0, DIST_BITS);
    }
}

void receiveSendPairA()
{   
    auto [otherNode, otherDist] = readPairA();
    // std::cout << "receive from B: " << otherNode << ' ' << otherDist << ' ' << NODE_BITS << '\n';
    otherNode = getNodeA(otherNode);
    otherDist += lastDist;

    if (otherNode < n) pq.push({otherNode, otherDist});
    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    if (pq.size())
    {
        // std::cout << "hereAAA: " << pq.top().currDist << ' ' << lastDist << '\n';
        // std::cout << "topA: " << pq.top().node << ' ' << pq.top().currDist << ' ' << lastDist << '\n';
        auto [node, currDist] = pq.top();
        pq.pop();

        vis[node] = true;
        dist[node] = currDist;
        lastDist = currDist;
        for (const auto &[u, edge] : g[node])
        {
            if (dist[u] > dist[node] + edge)
            {
                dist[u] = dist[node] + edge;
                pq.push({u, dist[u]});
            }
        }
    }

    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    cntDoneTurns++;
    if (cntDoneTurns < n && sequence[cntDoneTurns] == 1)
    {
        SendA(0);
    }
}

void receiveResendPairA()
{   
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    cntEntries++;
    int otherNode = readA(NODE_BITS);
    int otherDist = readA(DIST_BITS);
    otherNode = getNodeA(otherNode);
    otherDist += lastDist;
    if (otherNode < n) pq.push({otherNode, otherDist});
    // std::cout << "from A: " << otherNode << ' ' << otherDist << '\n';
    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    bool whatShouldSend = false;
    
    PQelement other = {otherNode, otherDist};
    // if (pq.size()) std::cout << "try b: " << pq.top().node << ' ' << pq.top().currDist << '\n';
    if (pq.size() && (otherNode >= n || other < pq.top()))
    {
        // std::cout << "send from B: " << pq.top().node << ' ' << pq.top().currDist << ' ' << lastDist << '\n';
        SendA(0);
        writeA(getIdxA(pq.top().node), NODE_BITS);
        writeA(pq.top().currDist - lastDist, DIST_BITS);
    } else if (pq.size())
    {
        SendA(1);
    }

    if (pq.size())
    {
        auto [node, currDist] = pq.top();
        // std::cout << "topB: " << node << ' ' << currDist << "\n";
        pq.pop();

        vis[node] = true;
        dist[node] = currDist;
        lastDist = currDist;
        for (const auto &[u, edge] : g[node])
        {
            // std::cout << "B edge: " << u << ' ' << node << ' ' << edge << ' ' << dist[u] << ' ' << dist[node] + edge << '\n';
            if (dist[u] > dist[node] + edge)
            {
                dist[u] = dist[node] + edge;
                // assert(!vispu)
                pq.push({u, dist[u]});
            }
        }
    }

    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    cntDoneTurns++;
    if (cntDoneTurns < n && sequence[cntDoneTurns] == 1)
    {
        SendA(0);
    }
}

void ReceiveA(bool x) 
{
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    receivedQueue.push(x);
    if (cntEntries == cntDoneTurns && sequence[cntEntries] == 0)
    {
        receivedQueue.pop();
        manageA();
        return;
    }

    if (sequence[cntDoneTurns] == 0 && (receivedQueue.size() == NODE_BITS + DIST_BITS + 1 || (receivedQueue.size() == 1 && receivedQueue.front() == 1)))
    {
        receiveSendPairA();
    } else if (sequence[cntDoneTurns] == 1 && receivedQueue.size() == NODE_BITS + DIST_BITS)
    {
        receiveResendPairA();
    }
}

int readA(int bits)
{
    int res = 0;
    for (int i = 0 ; i < bits ; ++i)
    {
        res <<= 1;
        // std::cout << "bitA: " << receivedQueue.front() << ' ' << res << '\n';
        res += receivedQueue.front();
        receivedQueue.pop();
    }

    return res;
}

void writeA(int number, int bits)
{
    for (int i = bits - 1 ; i >= 0 ; --i)
    {
        SendA((number & (1 << i)) > 0);
    }
}

void manageA()
{
    sendMyTopA();
}

void InitA(int N, int A, std::vector <int> U, std::vector <int> V,std::vector <int> C)
{
    n = N; m = A;
    for (int i = 0 ; i < A ; ++i)
    {
        g[U[i]].push_back({V[i], C[i]});
        g[V[i]].push_back({U[i], C[i]});
    }

    while (sequence.size() < n)
    {
        sequence.push_back(rng() & 1);
    }

    sequence[0] = 0;
    std::fill(dist, dist + n, INF);
    pq.push({0, 0});
    dist[0] = 0;
}

std::vector <int> Answer() 
{
    std::vector <int> answer(n);
    for (int i = 0 ; i < n ; ++i)
    {
        answer[i] = dist[i];
    }

    return answer;
}
#include "Baijan.h"
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cassert>
#include <cassert>
#include <random>
#include <queue>

typedef long long llong;
const int MAXN = 2000 + 10;
const int MAXM = 500000 + 10;
const int INF  = 1e9;

static int DIST_BITS = 9;
static int NODE_BITS = 11;
static int n, m;
static int lastDist;
static int dist[MAXN];
static bool vis[MAXN];
static std::vector <std::pair <int,int>> g[MAXN];
static std::mt19937 rng(123456789);
static std::vector <bool> sequence;
static int cntDoneTurns;
static int cntEntries;

struct PQelement
{
    int node;
    int currDist;

    friend bool operator < (const PQelement &a, const PQelement &b)
    {
        return a.currDist > b.currDist || (a.currDist == b.currDist && a.node > b.node);
    }
};

static std::priority_queue <PQelement> pq;
static std::queue <int> receivedQueue;

int readB(int);
void writeB(int, int);
void receiveSendPairB();
void receiveResendPairB();
void manageB();

int getNodeB(int idx)
{
    if (idx == n + 1)
    {
        return n;
    }

    // int cpy = idx; 
    // std::cout << "GET NODE: " << idx << '\n' << std::flush;
    for (int i = 0 ; i <= n ; ++i)
    {
        if (!vis[i] && idx == 1)
        {
            return i;
        }

        idx -= !vis[i];
    }
    
    assert(false);
}

int getIdxB(int node)
{
    int idx = 0;
    for (int i = 0 ; i <= node ; ++i)
    {
        idx += !vis[i];
    }

    return idx;
}

std::pair <int,int> readPairB()
{
    if (receivedQueue.front() == 1)
    {
        receivedQueue.pop();
        return {n + 1, 1e9};
    }

    receivedQueue.pop();
    return {readB(NODE_BITS), readB(DIST_BITS)};
}

void ReceiveB(bool x) 
{
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    receivedQueue.push(x);
    if (cntEntries == cntDoneTurns && sequence[cntEntries])
    {
        receivedQueue.pop();
        manageB();
        return;
    }   

    if (sequence[cntDoneTurns] == 1 && (receivedQueue.size() == NODE_BITS + DIST_BITS + 1 || (receivedQueue.size() == 1 && receivedQueue.front() == 1)))
    {
        receiveSendPairB();
    } else if (sequence[cntDoneTurns] == 0 && receivedQueue.size() == NODE_BITS + DIST_BITS)
    {
        receiveResendPairB();
    }
}

void sendMyTopB()
{
    cntEntries++;
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    if (pq.size())
    {
        // std::cout << "send from A: " << pq.top().node << ' ' << pq.top().currDist << '\n';
        writeB(getIdxB(pq.top().node), NODE_BITS);
        writeB(pq.top().currDist - lastDist, DIST_BITS);
    } else 
    {
        // std::cout << "send from A: " << n << ' ' << -1 << '\n';
        writeB(getIdxB(n), NODE_BITS);
        writeB(0, DIST_BITS);
    }
}

void receiveSendPairB()
{   
    auto [otherNode, otherDist] = readPairB();
    otherNode = getNodeB(otherNode);
    // std::cout << "receive from B: " << otherNode << ' ' << otherDist << '\n';
    otherDist += lastDist;

    if (otherNode < n) pq.push({otherNode, otherDist});
    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    if (pq.size())
    {
        // std::cout << "hereAAA: " << pq.top().currDist << ' ' << lastDist << '\n';
        // std::cout << "topA: " << pq.top().node << ' ' << pq.top().currDist << ' ' << lastDist << '\n';
        auto [node, currDist] = pq.top();
        pq.pop();

        vis[node] = true;
        dist[node] = currDist;
        lastDist = currDist;
        for (const auto &[u, edge] : g[node])
        {
            if (dist[u] > dist[node] + edge)
            {
                dist[u] = dist[node] + edge;
                pq.push({u, dist[u]});
            }
        }
    }

    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    cntDoneTurns++;
    if (cntDoneTurns < n && sequence[cntDoneTurns] == 0)
    {
        SendB(0);
    }
}

void receiveResendPairB()
{   
    while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
    {
        NODE_BITS--;
    }

    cntEntries++;
    int otherNode = readB(NODE_BITS);
    int otherDist = readB(DIST_BITS);
    otherNode = getNodeB(otherNode);
    otherDist += lastDist;
    if (otherNode < n) pq.push({otherNode, otherDist});
    // std::cout << "from A: " << otherNode << ' ' << otherDist << ' ' << lastDist << '\n';
    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    bool whatShouldSend = false;
    
    PQelement other = {otherNode, otherDist};
    // if (pq.size()) std::cout << "try b: " << pq.top().node << ' ' << pq.top().currDist << '\n';
    if (pq.size() && (otherNode >= n || other < pq.top()))
    {
        // std::cout << "send from B: " << pq.top().node << ' ' << pq.top().currDist << ' ' << lastDist << ' ' << vis[pq.top().node] << ' ' << getIdxB(pq.top().node) << ' ' << n - cntDoneTurns << '\n';
        SendB(0);
        writeB(getIdxB(pq.top().node), NODE_BITS);
        writeB(pq.top().currDist - lastDist, DIST_BITS);
    } else if (pq.size())
    {
        SendB(1);
    }

    if (pq.size())
    {
        auto [node, currDist] = pq.top();
        // std::cout << "topB: " << node << ' ' << currDist << "\n";
        pq.pop();

        vis[node] = true;
        dist[node] = currDist;
        lastDist = currDist;
        for (const auto &[u, edge] : g[node])
        {
            // std::cout << "B edge: " << u << ' ' << node << ' ' << edge << ' ' << dist[u] << ' ' << dist[node] + edge << '\n';
            if (dist[u] > dist[node] + edge)
            {
                dist[u] = dist[node] + edge;
                // assert(!vispu)
                pq.push({u, dist[u]});
            }
        }
    }

    while (pq.size() && vis[pq.top().node])
    {
        pq.pop();
    }

    cntDoneTurns++;
    if (cntDoneTurns < n && sequence[cntDoneTurns] == 0)
    {
        SendB(0);
    }
}

void manageB()
{
    sendMyTopB();
}

int readB(int bits)
{
    int res = 0;
    for (int i = 0 ; i < bits ; ++i)
    {
        res <<= 1;
        res += receivedQueue.front();
        receivedQueue.pop();
    }

    return res;
}

void writeB(int number, int bits)
{
    for (int i = bits - 1 ; i >= 0 ; --i)
    {
        // std::cout << "bitB: " << number << ' ' << (number & (1 << i)) << ' ' << ((number & (1 << i)) > 0) << '\n';
        SendB((number & (1 << i)) > 0);
    }
}

void InitB(int N, int B, std::vector <int> U, std::vector <int> V, std::vector <int> C)
{
    n = N; m = B;
    for (int i = 0 ; i < B ; ++i)
    {
        g[U[i]].push_back({V[i], C[i]});
        g[V[i]].push_back({U[i], C[i]});
    }

    while (sequence.size() < n)
    {
        sequence.push_back(rng() & 1);
    }

    sequence[0] = 0;
    std::fill(dist, dist + n, INF);
    pq.push({0, 0});
    dist[0] = 0;
    SendB(0);
}

Compilation message

Azer.cpp: In function 'void sendMyTopA()':
Azer.cpp:94:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   94 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Azer.cpp: In function 'void receiveResendPairA()':
Azer.cpp:159:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  159 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Azer.cpp:176:10: warning: unused variable 'whatShouldSend' [-Wunused-variable]
  176 |     bool whatShouldSend = false;
      |          ^~~~~~~~~~~~~~
Azer.cpp: In function 'void ReceiveA(bool)':
Azer.cpp:226:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  226 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Azer.cpp:239:62: warning: comparison of integer expressions of different signedness: 'std::queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  239 |     if (sequence[cntDoneTurns] == 0 && (receivedQueue.size() == NODE_BITS + DIST_BITS + 1 || (receivedQueue.size() == 1 && receivedQueue.front() == 1)))
      |                                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Azer.cpp:242:68: warning: comparison of integer expressions of different signedness: 'std::queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  242 |     } else if (sequence[cntDoneTurns] == 1 && receivedQueue.size() == NODE_BITS + DIST_BITS)
      |                                               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Azer.cpp: In function 'void InitA(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Azer.cpp:284:28: warning: comparison of integer expressions of different signedness: 'std::vector<bool>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  284 |     while (sequence.size() < n)
      |            ~~~~~~~~~~~~~~~~^~~

Baijan.cpp: In function 'void ReceiveB(bool)':
Baijan.cpp:94:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   94 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Baijan.cpp:107:62: warning: comparison of integer expressions of different signedness: 'std::queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  107 |     if (sequence[cntDoneTurns] == 1 && (receivedQueue.size() == NODE_BITS + DIST_BITS + 1 || (receivedQueue.size() == 1 && receivedQueue.front() == 1)))
      |                                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Baijan.cpp:110:68: warning: comparison of integer expressions of different signedness: 'std::queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  110 |     } else if (sequence[cntDoneTurns] == 0 && receivedQueue.size() == NODE_BITS + DIST_BITS)
      |                                               ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Baijan.cpp: In function 'void sendMyTopB()':
Baijan.cpp:119:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  119 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Baijan.cpp: In function 'void receiveResendPairB()':
Baijan.cpp:184:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  184 |     while (NODE_BITS > 1 && (1 << NODE_BITS - 1) > n - cntDoneTurns + 1)
      |                                   ~~~~~~~~~~^~~
Baijan.cpp:201:10: warning: unused variable 'whatShouldSend' [-Wunused-variable]
  201 |     bool whatShouldSend = false;
      |          ^~~~~~~~~~~~~~
Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:285:28: warning: comparison of integer expressions of different signedness: 'std::vector<bool>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  285 |     while (sequence.size() < n)
      |            ~~~~~~~~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 184 ms 468 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 664 KB Output is correct
2 Runtime error 149 ms 556 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 275 ms 872 KB Output is correct
2 Correct 0 ms 664 KB Output is correct
3 Runtime error 188 ms 464 KB Execution killed with signal 13
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 123 ms 832 KB Output is correct
2 Correct 97 ms 816 KB Output is correct
3 Correct 155 ms 13532 KB Output is correct
4 Correct 130 ms 664 KB Output is correct
5 Correct 153 ms 10076 KB Output is correct
6 Correct 115 ms 1100 KB Output is correct
7 Correct 115 ms 664 KB Output is correct
8 Correct 113 ms 864 KB Output is correct
9 Correct 224 ms 18488 KB Output is correct
10 Correct 201 ms 18612 KB Output is correct
11 Correct 283 ms 35888 KB Output is correct
12 Correct 238 ms 31040 KB Output is correct
13 Correct 128 ms 664 KB Output is correct
14 Correct 0 ms 664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 123 ms 832 KB Output is correct
2 Correct 97 ms 816 KB Output is correct
3 Correct 155 ms 13532 KB Output is correct
4 Correct 130 ms 664 KB Output is correct
5 Correct 153 ms 10076 KB Output is correct
6 Correct 115 ms 1100 KB Output is correct
7 Correct 115 ms 664 KB Output is correct
8 Correct 113 ms 864 KB Output is correct
9 Correct 224 ms 18488 KB Output is correct
10 Correct 201 ms 18612 KB Output is correct
11 Correct 283 ms 35888 KB Output is correct
12 Correct 238 ms 31040 KB Output is correct
13 Correct 128 ms 664 KB Output is correct
14 Correct 0 ms 664 KB Output is correct
15 Correct 146 ms 840 KB Output is correct
16 Correct 150 ms 920 KB Output is correct
17 Correct 173 ms 664 KB Output is correct
18 Correct 175 ms 10464 KB Output is correct
19 Correct 145 ms 664 KB Output is correct
20 Correct 176 ms 10572 KB Output is correct
21 Correct 147 ms 664 KB Output is correct
22 Correct 136 ms 748 KB Output is correct
23 Correct 267 ms 22424 KB Output is correct
24 Correct 263 ms 22556 KB Output is correct
25 Correct 357 ms 43828 KB Output is correct
26 Correct 276 ms 37036 KB Output is correct
27 Correct 148 ms 900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 123 ms 832 KB Output is correct
2 Correct 97 ms 816 KB Output is correct
3 Correct 155 ms 13532 KB Output is correct
4 Correct 130 ms 664 KB Output is correct
5 Correct 153 ms 10076 KB Output is correct
6 Correct 115 ms 1100 KB Output is correct
7 Correct 115 ms 664 KB Output is correct
8 Correct 113 ms 864 KB Output is correct
9 Correct 224 ms 18488 KB Output is correct
10 Correct 201 ms 18612 KB Output is correct
11 Correct 283 ms 35888 KB Output is correct
12 Correct 238 ms 31040 KB Output is correct
13 Correct 128 ms 664 KB Output is correct
14 Correct 0 ms 664 KB Output is correct
15 Correct 146 ms 840 KB Output is correct
16 Correct 150 ms 920 KB Output is correct
17 Correct 173 ms 664 KB Output is correct
18 Correct 175 ms 10464 KB Output is correct
19 Correct 145 ms 664 KB Output is correct
20 Correct 176 ms 10572 KB Output is correct
21 Correct 147 ms 664 KB Output is correct
22 Correct 136 ms 748 KB Output is correct
23 Correct 267 ms 22424 KB Output is correct
24 Correct 263 ms 22556 KB Output is correct
25 Correct 357 ms 43828 KB Output is correct
26 Correct 276 ms 37036 KB Output is correct
27 Correct 148 ms 900 KB Output is correct
28 Correct 165 ms 1116 KB Output is correct
29 Correct 196 ms 804 KB Output is correct
30 Correct 251 ms 24276 KB Output is correct
31 Correct 196 ms 940 KB Output is correct
32 Correct 233 ms 21272 KB Output is correct
33 Correct 205 ms 876 KB Output is correct
34 Correct 181 ms 1160 KB Output is correct
35 Correct 219 ms 1176 KB Output is correct
36 Correct 341 ms 24988 KB Output is correct
37 Correct 325 ms 25304 KB Output is correct
38 Correct 456 ms 49056 KB Output is correct
39 Correct 372 ms 44076 KB Output is correct
40 Correct 166 ms 1176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 184 ms 468 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -