답안 #476893

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
476893 2021-09-29T00:21:25 Z wiktoria_bazan 저장 (Saveit) (IOI10_saveit) C++14
0 / 100
330 ms 13324 KB
#include "grader.h"
#include "encoder.h"

#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;

int const INF = 1e6 + 9;
int const N = 1e3 + 9;
int const H = 40;
int d[H][N];
bool odw[H][N];
int G[N][N];
int R[N];
string p = "";
int index = 0;
queue<int>Q;

void bfs(int v, int in) {
    Q.push(v);
    odw[in][v] = 1;
    d[in][v] = 0;
    while (!Q.empty()) {
        v = Q.front();
        Q.pop();
        for (int i = 0; i < R[v]; i++) {
            int sas = G[v][i];
            if (!odw[in][sas]) {
                odw[in][sas] = 1;
                d[in][sas] = d[in][v] + 1;
                Q.push(sas);
            }
        }
    }
}

void int_to_bits(int a) { //9 bitów
    int t = 0;
    while (a > 0) {
        encode_bit(a % 2);
        a /= 2;
        t++;
    }
    while (t < 9) {
        encode_bit(0);
        t++;
    }
}


void encode(int nv, int nh, int ne, int* v1, int* v2) {
    for (int i = 0; i < ne; i++) {
        G[v1[i]][R[v1[i]]] = v2[i];
        R[v1[i]]++;
        G[v2[i]][R[v2[i]]] = v1[i];
        R[v2[i]]++;
    }
    for (int h = 0; h < nh; h++) {
        bfs(h, h);
        for (int v = 0; v < nv; v++) {
            int_to_bits(d[h][v]);
        }
    }
    return;
}
#include "grader.h"
#include "decoder.h"

void decode(int nv, int nh) {
    for (int h = 0; h < nh; h++) {
        for (int v = 0; v < nv; v++) {
            int mn = 1;
            int a = 0;
            for (int i = 0; i < 9; i++) {
                int bit = decode_bit();
                a += bit * mn;
                mn <<= 1;
            }
            hops(h, v, a);
        //    cout << a << " ";
        }
        //cout << "\n";
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 330 ms 13324 KB Output is partially correct - 324000 call(s) of encode_bit()
2 Correct 2 ms 4588 KB Output is correct - 135 call(s) of encode_bit()
3 Correct 70 ms 10760 KB Output is partially correct - 291600 call(s) of encode_bit()
4 Correct 2 ms 4588 KB Output is correct - 225 call(s) of encode_bit()
5 Correct 64 ms 10744 KB Output is partially correct - 291600 call(s) of encode_bit()
6 Correct 71 ms 11292 KB Output is partially correct - 324000 call(s) of encode_bit()
7 Correct 87 ms 11520 KB Output is partially correct - 324000 call(s) of encode_bit()
8 Correct 66 ms 11120 KB Output is partially correct - 311364 call(s) of encode_bit()
9 Correct 71 ms 11524 KB Output is partially correct - 324000 call(s) of encode_bit()
10 Correct 79 ms 11360 KB Output is partially correct - 324000 call(s) of encode_bit()
11 Correct 74 ms 11440 KB Output is partially correct - 324000 call(s) of encode_bit()
12 Incorrect 79 ms 11320 KB Output isn't correct
13 Correct 96 ms 11552 KB Output is partially correct - 324000 call(s) of encode_bit()
14 Incorrect 78 ms 11244 KB Output isn't correct
15 Incorrect 81 ms 11400 KB Output isn't correct
16 Correct 111 ms 11508 KB Output is partially correct - 324000 call(s) of encode_bit()
17 Correct 111 ms 11540 KB Output is partially correct - 324000 call(s) of encode_bit()
18 Correct 118 ms 11660 KB Output is partially correct - 324000 call(s) of encode_bit()
19 Correct 91 ms 11436 KB Output is partially correct - 324000 call(s) of encode_bit()
20 Correct 112 ms 11728 KB Output is partially correct - 324000 call(s) of encode_bit()
21 Correct 137 ms 11788 KB Output is partially correct - 324000 call(s) of encode_bit()
22 Correct 101 ms 11628 KB Output is partially correct - 324000 call(s) of encode_bit()
23 Correct 125 ms 11776 KB Output is partially correct - 324000 call(s) of encode_bit()
# 결과 실행 시간 메모리 Grader output
1 Correct 330 ms 13324 KB Output is partially correct - 324000 call(s) of encode_bit()
2 Correct 2 ms 4588 KB Output is correct - 135 call(s) of encode_bit()
3 Correct 70 ms 10760 KB Output is partially correct - 291600 call(s) of encode_bit()
4 Correct 2 ms 4588 KB Output is correct - 225 call(s) of encode_bit()
5 Correct 64 ms 10744 KB Output is partially correct - 291600 call(s) of encode_bit()
6 Correct 71 ms 11292 KB Output is partially correct - 324000 call(s) of encode_bit()
7 Correct 87 ms 11520 KB Output is partially correct - 324000 call(s) of encode_bit()
8 Correct 66 ms 11120 KB Output is partially correct - 311364 call(s) of encode_bit()
9 Correct 71 ms 11524 KB Output is partially correct - 324000 call(s) of encode_bit()
10 Correct 79 ms 11360 KB Output is partially correct - 324000 call(s) of encode_bit()
11 Correct 74 ms 11440 KB Output is partially correct - 324000 call(s) of encode_bit()
12 Incorrect 79 ms 11320 KB Output isn't correct
13 Correct 96 ms 11552 KB Output is partially correct - 324000 call(s) of encode_bit()
14 Incorrect 78 ms 11244 KB Output isn't correct
15 Incorrect 81 ms 11400 KB Output isn't correct
16 Correct 111 ms 11508 KB Output is partially correct - 324000 call(s) of encode_bit()
17 Correct 111 ms 11540 KB Output is partially correct - 324000 call(s) of encode_bit()
18 Correct 118 ms 11660 KB Output is partially correct - 324000 call(s) of encode_bit()
19 Correct 91 ms 11436 KB Output is partially correct - 324000 call(s) of encode_bit()
20 Correct 112 ms 11728 KB Output is partially correct - 324000 call(s) of encode_bit()
21 Correct 137 ms 11788 KB Output is partially correct - 324000 call(s) of encode_bit()
22 Correct 101 ms 11628 KB Output is partially correct - 324000 call(s) of encode_bit()
23 Correct 125 ms 11776 KB Output is partially correct - 324000 call(s) of encode_bit()
# 결과 실행 시간 메모리 Grader output
1 Correct 330 ms 13324 KB Output is partially correct - 324000 call(s) of encode_bit()
2 Correct 2 ms 4588 KB Output is correct - 135 call(s) of encode_bit()
3 Correct 70 ms 10760 KB Output is partially correct - 291600 call(s) of encode_bit()
4 Correct 2 ms 4588 KB Output is correct - 225 call(s) of encode_bit()
5 Correct 64 ms 10744 KB Output is partially correct - 291600 call(s) of encode_bit()
6 Correct 71 ms 11292 KB Output is partially correct - 324000 call(s) of encode_bit()
7 Correct 87 ms 11520 KB Output is partially correct - 324000 call(s) of encode_bit()
8 Correct 66 ms 11120 KB Output is partially correct - 311364 call(s) of encode_bit()
9 Correct 71 ms 11524 KB Output is partially correct - 324000 call(s) of encode_bit()
10 Correct 79 ms 11360 KB Output is partially correct - 324000 call(s) of encode_bit()
11 Correct 74 ms 11440 KB Output is partially correct - 324000 call(s) of encode_bit()
12 Incorrect 79 ms 11320 KB Output isn't correct
13 Correct 96 ms 11552 KB Output is partially correct - 324000 call(s) of encode_bit()
14 Incorrect 78 ms 11244 KB Output isn't correct
15 Incorrect 81 ms 11400 KB Output isn't correct
16 Correct 111 ms 11508 KB Output is partially correct - 324000 call(s) of encode_bit()
17 Correct 111 ms 11540 KB Output is partially correct - 324000 call(s) of encode_bit()
18 Correct 118 ms 11660 KB Output is partially correct - 324000 call(s) of encode_bit()
19 Correct 91 ms 11436 KB Output is partially correct - 324000 call(s) of encode_bit()
20 Correct 112 ms 11728 KB Output is partially correct - 324000 call(s) of encode_bit()
21 Correct 137 ms 11788 KB Output is partially correct - 324000 call(s) of encode_bit()
22 Correct 101 ms 11628 KB Output is partially correct - 324000 call(s) of encode_bit()
23 Correct 125 ms 11776 KB Output is partially correct - 324000 call(s) of encode_bit()
# 결과 실행 시간 메모리 Grader output
1 Correct 330 ms 13324 KB Output is partially correct - 324000 call(s) of encode_bit()
2 Correct 2 ms 4588 KB Output is correct - 135 call(s) of encode_bit()
3 Correct 70 ms 10760 KB Output is partially correct - 291600 call(s) of encode_bit()
4 Correct 2 ms 4588 KB Output is correct - 225 call(s) of encode_bit()
5 Correct 64 ms 10744 KB Output is partially correct - 291600 call(s) of encode_bit()
6 Correct 71 ms 11292 KB Output is partially correct - 324000 call(s) of encode_bit()
7 Correct 87 ms 11520 KB Output is partially correct - 324000 call(s) of encode_bit()
8 Correct 66 ms 11120 KB Output is partially correct - 311364 call(s) of encode_bit()
9 Correct 71 ms 11524 KB Output is partially correct - 324000 call(s) of encode_bit()
10 Correct 79 ms 11360 KB Output is partially correct - 324000 call(s) of encode_bit()
11 Correct 74 ms 11440 KB Output is partially correct - 324000 call(s) of encode_bit()
12 Incorrect 79 ms 11320 KB Output isn't correct
13 Correct 96 ms 11552 KB Output is partially correct - 324000 call(s) of encode_bit()
14 Incorrect 78 ms 11244 KB Output isn't correct
15 Incorrect 81 ms 11400 KB Output isn't correct
16 Correct 111 ms 11508 KB Output is partially correct - 324000 call(s) of encode_bit()
17 Correct 111 ms 11540 KB Output is partially correct - 324000 call(s) of encode_bit()
18 Correct 118 ms 11660 KB Output is partially correct - 324000 call(s) of encode_bit()
19 Correct 91 ms 11436 KB Output is partially correct - 324000 call(s) of encode_bit()
20 Correct 112 ms 11728 KB Output is partially correct - 324000 call(s) of encode_bit()
21 Correct 137 ms 11788 KB Output is partially correct - 324000 call(s) of encode_bit()
22 Correct 101 ms 11628 KB Output is partially correct - 324000 call(s) of encode_bit()
23 Correct 125 ms 11776 KB Output is partially correct - 324000 call(s) of encode_bit()