답안 #565033

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
565033 2022-05-20T07:59:44 Z 1zaid1 저장 (Saveit) (IOI10_saveit) C++14
0 / 100
270 ms 14764 KB
#include "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
const int M = 1e4+5;
vector<vector<int>> node(M, vector<int>({}));
vector<int> vis(M, 0), dist(M, 0);

void bfs(int s) {
    queue<int> q;
    q.push(s);

    vis[s] = true;
    while (!q.empty()) {
        int f = q.front(); q.pop();
        for (int i:node[f]) {
            if (!vis[i]) {
                vis[i] = true;
                dist[i] = dist[f]+1;

                q.push(i);
            }
        }
    }
}

void encode(int n, int h, int p, int *a, int *b){
    for (int i = 0; i < p; i++) {
        node[a[i]].push_back(b[i]);
        node[b[i]].push_back(a[i]);
    }

    map<pair<int, int>, int> ans;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < n; j++) dist[j] = vis[j] = 0;
        bfs(i);
        for (int j = 0; j < n; j++) ans[{i, j}] = dist[j];
    }

    for (int i = 0; i < h; i++) {
        for (int j = i+1; j < n; j++) {
            for (int k = 0; k < 10; k++) {
                encode_bit((ans[{i, j}]&(1<<k))!=0);
            }
        }
    }

    return;
}
#include "grader.h"
#include "decoder.h"
#include<bits/stdc++.h>
using namespace std;

void decode(int n, int h) {
    vector<vector<int>> pp(h, vector<int>(n, 0));
    for (int i = 0; i < h; i++) {
        for (int j = i+1; j < n; j++) {
            for (int k = 0; k < 10; k++) {
                pp[i][j] += decode_bit()*(1<<k);
            }
        }
    }

    for (int i = 0; i < h; i++) {
        hops(i, i, 0);
        for (int j = i+1; j < n; j++) {
            hops(i, j, pp[i][j]);
            hops(j, i, pp[i][j]);
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 270 ms 14764 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 101 ms 9628 KB wrong parameter
4 Correct 3 ms 4880 KB Output is correct - 100 call(s) of encode_bit()
5 Incorrect 87 ms 9860 KB wrong parameter
6 Incorrect 106 ms 10436 KB wrong parameter
7 Incorrect 108 ms 10648 KB wrong parameter
8 Incorrect 112 ms 9860 KB wrong parameter
9 Incorrect 96 ms 10088 KB wrong parameter
10 Incorrect 98 ms 10312 KB wrong parameter
11 Incorrect 117 ms 10220 KB wrong parameter
12 Incorrect 107 ms 10144 KB wrong parameter
13 Incorrect 125 ms 11008 KB wrong parameter
14 Incorrect 102 ms 10092 KB wrong parameter
15 Incorrect 102 ms 10256 KB wrong parameter
16 Incorrect 154 ms 10592 KB wrong parameter
17 Incorrect 135 ms 10604 KB wrong parameter
18 Incorrect 142 ms 10868 KB wrong parameter
19 Incorrect 109 ms 10540 KB wrong parameter
20 Incorrect 145 ms 11196 KB wrong parameter
21 Incorrect 169 ms 11340 KB wrong parameter
22 Incorrect 117 ms 10856 KB wrong parameter
23 Incorrect 174 ms 11580 KB wrong parameter
# 결과 실행 시간 메모리 Grader output
1 Incorrect 270 ms 14764 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 101 ms 9628 KB wrong parameter
4 Correct 3 ms 4880 KB Output is correct - 100 call(s) of encode_bit()
5 Incorrect 87 ms 9860 KB wrong parameter
6 Incorrect 106 ms 10436 KB wrong parameter
7 Incorrect 108 ms 10648 KB wrong parameter
8 Incorrect 112 ms 9860 KB wrong parameter
9 Incorrect 96 ms 10088 KB wrong parameter
10 Incorrect 98 ms 10312 KB wrong parameter
11 Incorrect 117 ms 10220 KB wrong parameter
12 Incorrect 107 ms 10144 KB wrong parameter
13 Incorrect 125 ms 11008 KB wrong parameter
14 Incorrect 102 ms 10092 KB wrong parameter
15 Incorrect 102 ms 10256 KB wrong parameter
16 Incorrect 154 ms 10592 KB wrong parameter
17 Incorrect 135 ms 10604 KB wrong parameter
18 Incorrect 142 ms 10868 KB wrong parameter
19 Incorrect 109 ms 10540 KB wrong parameter
20 Incorrect 145 ms 11196 KB wrong parameter
21 Incorrect 169 ms 11340 KB wrong parameter
22 Incorrect 117 ms 10856 KB wrong parameter
23 Incorrect 174 ms 11580 KB wrong parameter
# 결과 실행 시간 메모리 Grader output
1 Incorrect 270 ms 14764 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 101 ms 9628 KB wrong parameter
4 Correct 3 ms 4880 KB Output is correct - 100 call(s) of encode_bit()
5 Incorrect 87 ms 9860 KB wrong parameter
6 Incorrect 106 ms 10436 KB wrong parameter
7 Incorrect 108 ms 10648 KB wrong parameter
8 Incorrect 112 ms 9860 KB wrong parameter
9 Incorrect 96 ms 10088 KB wrong parameter
10 Incorrect 98 ms 10312 KB wrong parameter
11 Incorrect 117 ms 10220 KB wrong parameter
12 Incorrect 107 ms 10144 KB wrong parameter
13 Incorrect 125 ms 11008 KB wrong parameter
14 Incorrect 102 ms 10092 KB wrong parameter
15 Incorrect 102 ms 10256 KB wrong parameter
16 Incorrect 154 ms 10592 KB wrong parameter
17 Incorrect 135 ms 10604 KB wrong parameter
18 Incorrect 142 ms 10868 KB wrong parameter
19 Incorrect 109 ms 10540 KB wrong parameter
20 Incorrect 145 ms 11196 KB wrong parameter
21 Incorrect 169 ms 11340 KB wrong parameter
22 Incorrect 117 ms 10856 KB wrong parameter
23 Incorrect 174 ms 11580 KB wrong parameter
# 결과 실행 시간 메모리 Grader output
1 Incorrect 270 ms 14764 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 101 ms 9628 KB wrong parameter
4 Correct 3 ms 4880 KB Output is correct - 100 call(s) of encode_bit()
5 Incorrect 87 ms 9860 KB wrong parameter
6 Incorrect 106 ms 10436 KB wrong parameter
7 Incorrect 108 ms 10648 KB wrong parameter
8 Incorrect 112 ms 9860 KB wrong parameter
9 Incorrect 96 ms 10088 KB wrong parameter
10 Incorrect 98 ms 10312 KB wrong parameter
11 Incorrect 117 ms 10220 KB wrong parameter
12 Incorrect 107 ms 10144 KB wrong parameter
13 Incorrect 125 ms 11008 KB wrong parameter
14 Incorrect 102 ms 10092 KB wrong parameter
15 Incorrect 102 ms 10256 KB wrong parameter
16 Incorrect 154 ms 10592 KB wrong parameter
17 Incorrect 135 ms 10604 KB wrong parameter
18 Incorrect 142 ms 10868 KB wrong parameter
19 Incorrect 109 ms 10540 KB wrong parameter
20 Incorrect 145 ms 11196 KB wrong parameter
21 Incorrect 169 ms 11340 KB wrong parameter
22 Incorrect 117 ms 10856 KB wrong parameter
23 Incorrect 174 ms 11580 KB wrong parameter