Submission #894908

# Submission time Handle Problem Language Result Execution time Memory
894908 2023-12-29T07:57:14 Z sleepntsheep Saveit (IOI10_saveit) C++17
0 / 100
204 ms 20484 KB
#include "grader.h"
#include "encoder.h"
#include <vector>
#include <queue>


void send_int(int x, int nb)
{
    for (int j = 0; j < nb; ++j) encode_bit((x >> j) & 1);
}

#define N 1001

using namespace std;

vector<int> g[N];
int n, h;

vector<int> bfs(int u)
{
    vector<int> d(n, 1e9);
    queue<pair<int, int>> q;
    q.emplace(d[u] = 0, u);
    while (q.size())
    {
        auto [c, u] = q.front(); q.pop();
        for (auto v : g[u])
        {
            if (c + 1 < d[v])
                q.emplace(d[v] = c + 1, v);
        }
    }
    return d;
}

void encode(int n0, int h0, int ne, int *v1, int *v2){
    for (int i = 0; i < ne; ++i) g[v1[i]].push_back(v2[i]), g[v2[i]].push_back(v1[i]);
    ::n = n0; ::h = h0;

    for (int i = 0; i < h; ++i)
    {
        auto d = bfs(i);
        for (int j = 0; j < n; ++j)
        {
            if (d[j] <= 64) send_int(1, 1);
            else send_int(0, 1);
            send_int(d[j], 10);
        }
    }

    return;
}

#include "grader.h"
#include "decoder.h"

unsigned read_int(int nb)
{
    unsigned u = 0;
    for (int j = 0; j < nb; ++j) u |= decode_bit() << j;
    return u;
}

int n, h;

void decode(int v0, int h0) {
    ::n = v0; ::h = h0;
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < n; ++j)
        {
            int small = read_int(1);
            if (small)
                hops(i, j, read_int(6));
            else hops(i, j, read_int(5));
        }
    }
}

# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 20484 KB Output isn't correct
2 Incorrect 2 ms 12036 KB wrong parameter
3 Incorrect 59 ms 14444 KB Output isn't correct
4 Incorrect 2 ms 12288 KB wrong parameter
5 Incorrect 62 ms 14860 KB Output isn't correct
6 Incorrect 67 ms 14740 KB Output isn't correct
7 Incorrect 75 ms 15156 KB Output isn't correct
8 Incorrect 63 ms 14280 KB Output isn't correct
9 Incorrect 57 ms 14368 KB Output isn't correct
10 Incorrect 60 ms 14316 KB Output isn't correct
11 Incorrect 63 ms 14468 KB Output isn't correct
12 Incorrect 56 ms 14316 KB Output isn't correct
13 Incorrect 76 ms 14828 KB Output isn't correct
14 Incorrect 59 ms 14556 KB Output isn't correct
15 Incorrect 62 ms 14328 KB Output isn't correct
16 Incorrect 86 ms 14672 KB Output isn't correct
17 Incorrect 81 ms 14792 KB Output isn't correct
18 Incorrect 76 ms 14916 KB Output isn't correct
19 Incorrect 78 ms 14764 KB Output isn't correct
20 Incorrect 78 ms 15360 KB Output isn't correct
21 Incorrect 100 ms 15388 KB Output isn't correct
22 Incorrect 69 ms 14984 KB Output isn't correct
23 Incorrect 120 ms 15600 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 20484 KB Output isn't correct
2 Incorrect 2 ms 12036 KB wrong parameter
3 Incorrect 59 ms 14444 KB Output isn't correct
4 Incorrect 2 ms 12288 KB wrong parameter
5 Incorrect 62 ms 14860 KB Output isn't correct
6 Incorrect 67 ms 14740 KB Output isn't correct
7 Incorrect 75 ms 15156 KB Output isn't correct
8 Incorrect 63 ms 14280 KB Output isn't correct
9 Incorrect 57 ms 14368 KB Output isn't correct
10 Incorrect 60 ms 14316 KB Output isn't correct
11 Incorrect 63 ms 14468 KB Output isn't correct
12 Incorrect 56 ms 14316 KB Output isn't correct
13 Incorrect 76 ms 14828 KB Output isn't correct
14 Incorrect 59 ms 14556 KB Output isn't correct
15 Incorrect 62 ms 14328 KB Output isn't correct
16 Incorrect 86 ms 14672 KB Output isn't correct
17 Incorrect 81 ms 14792 KB Output isn't correct
18 Incorrect 76 ms 14916 KB Output isn't correct
19 Incorrect 78 ms 14764 KB Output isn't correct
20 Incorrect 78 ms 15360 KB Output isn't correct
21 Incorrect 100 ms 15388 KB Output isn't correct
22 Incorrect 69 ms 14984 KB Output isn't correct
23 Incorrect 120 ms 15600 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 20484 KB Output isn't correct
2 Incorrect 2 ms 12036 KB wrong parameter
3 Incorrect 59 ms 14444 KB Output isn't correct
4 Incorrect 2 ms 12288 KB wrong parameter
5 Incorrect 62 ms 14860 KB Output isn't correct
6 Incorrect 67 ms 14740 KB Output isn't correct
7 Incorrect 75 ms 15156 KB Output isn't correct
8 Incorrect 63 ms 14280 KB Output isn't correct
9 Incorrect 57 ms 14368 KB Output isn't correct
10 Incorrect 60 ms 14316 KB Output isn't correct
11 Incorrect 63 ms 14468 KB Output isn't correct
12 Incorrect 56 ms 14316 KB Output isn't correct
13 Incorrect 76 ms 14828 KB Output isn't correct
14 Incorrect 59 ms 14556 KB Output isn't correct
15 Incorrect 62 ms 14328 KB Output isn't correct
16 Incorrect 86 ms 14672 KB Output isn't correct
17 Incorrect 81 ms 14792 KB Output isn't correct
18 Incorrect 76 ms 14916 KB Output isn't correct
19 Incorrect 78 ms 14764 KB Output isn't correct
20 Incorrect 78 ms 15360 KB Output isn't correct
21 Incorrect 100 ms 15388 KB Output isn't correct
22 Incorrect 69 ms 14984 KB Output isn't correct
23 Incorrect 120 ms 15600 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 20484 KB Output isn't correct
2 Incorrect 2 ms 12036 KB wrong parameter
3 Incorrect 59 ms 14444 KB Output isn't correct
4 Incorrect 2 ms 12288 KB wrong parameter
5 Incorrect 62 ms 14860 KB Output isn't correct
6 Incorrect 67 ms 14740 KB Output isn't correct
7 Incorrect 75 ms 15156 KB Output isn't correct
8 Incorrect 63 ms 14280 KB Output isn't correct
9 Incorrect 57 ms 14368 KB Output isn't correct
10 Incorrect 60 ms 14316 KB Output isn't correct
11 Incorrect 63 ms 14468 KB Output isn't correct
12 Incorrect 56 ms 14316 KB Output isn't correct
13 Incorrect 76 ms 14828 KB Output isn't correct
14 Incorrect 59 ms 14556 KB Output isn't correct
15 Incorrect 62 ms 14328 KB Output isn't correct
16 Incorrect 86 ms 14672 KB Output isn't correct
17 Incorrect 81 ms 14792 KB Output isn't correct
18 Incorrect 76 ms 14916 KB Output isn't correct
19 Incorrect 78 ms 14764 KB Output isn't correct
20 Incorrect 78 ms 15360 KB Output isn't correct
21 Incorrect 100 ms 15388 KB Output isn't correct
22 Incorrect 69 ms 14984 KB Output isn't correct
23 Incorrect 120 ms 15600 KB Output isn't correct