Submission #565029

# Submission time Handle Problem Language Result Execution time Memory
565029 2022-05-20T07:57:24 Z 1zaid1 Saveit (IOI10_saveit) C++14
0 / 100
270 ms 14688 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 = i+1; 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++) {
        for (int j = i+1; j < n; j++) {
            hops(i, j, pp[i][j]);
            hops(j, i, pp[i][j]);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 270 ms 14688 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 98 ms 9676 KB wrong parameter
4 Incorrect 3 ms 4872 KB function hops(h,c,d) must be called exactly N×H times
5 Incorrect 91 ms 9812 KB wrong parameter
6 Incorrect 113 ms 10340 KB wrong parameter
7 Incorrect 122 ms 10552 KB wrong parameter
8 Incorrect 90 ms 9892 KB wrong parameter
9 Incorrect 107 ms 10200 KB wrong parameter
10 Incorrect 106 ms 10276 KB wrong parameter
11 Incorrect 102 ms 10268 KB wrong parameter
12 Incorrect 105 ms 10124 KB wrong parameter
13 Incorrect 125 ms 11000 KB wrong parameter
14 Incorrect 103 ms 10224 KB wrong parameter
15 Incorrect 89 ms 10188 KB wrong parameter
16 Incorrect 135 ms 10728 KB wrong parameter
17 Incorrect 125 ms 10728 KB wrong parameter
18 Incorrect 117 ms 10864 KB wrong parameter
19 Incorrect 110 ms 10460 KB wrong parameter
20 Incorrect 142 ms 11200 KB wrong parameter
21 Incorrect 136 ms 11280 KB wrong parameter
22 Incorrect 114 ms 10772 KB wrong parameter
23 Incorrect 145 ms 11512 KB wrong parameter
# Verdict Execution time Memory Grader output
1 Incorrect 270 ms 14688 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 98 ms 9676 KB wrong parameter
4 Incorrect 3 ms 4872 KB function hops(h,c,d) must be called exactly N×H times
5 Incorrect 91 ms 9812 KB wrong parameter
6 Incorrect 113 ms 10340 KB wrong parameter
7 Incorrect 122 ms 10552 KB wrong parameter
8 Incorrect 90 ms 9892 KB wrong parameter
9 Incorrect 107 ms 10200 KB wrong parameter
10 Incorrect 106 ms 10276 KB wrong parameter
11 Incorrect 102 ms 10268 KB wrong parameter
12 Incorrect 105 ms 10124 KB wrong parameter
13 Incorrect 125 ms 11000 KB wrong parameter
14 Incorrect 103 ms 10224 KB wrong parameter
15 Incorrect 89 ms 10188 KB wrong parameter
16 Incorrect 135 ms 10728 KB wrong parameter
17 Incorrect 125 ms 10728 KB wrong parameter
18 Incorrect 117 ms 10864 KB wrong parameter
19 Incorrect 110 ms 10460 KB wrong parameter
20 Incorrect 142 ms 11200 KB wrong parameter
21 Incorrect 136 ms 11280 KB wrong parameter
22 Incorrect 114 ms 10772 KB wrong parameter
23 Incorrect 145 ms 11512 KB wrong parameter
# Verdict Execution time Memory Grader output
1 Incorrect 270 ms 14688 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 98 ms 9676 KB wrong parameter
4 Incorrect 3 ms 4872 KB function hops(h,c,d) must be called exactly N×H times
5 Incorrect 91 ms 9812 KB wrong parameter
6 Incorrect 113 ms 10340 KB wrong parameter
7 Incorrect 122 ms 10552 KB wrong parameter
8 Incorrect 90 ms 9892 KB wrong parameter
9 Incorrect 107 ms 10200 KB wrong parameter
10 Incorrect 106 ms 10276 KB wrong parameter
11 Incorrect 102 ms 10268 KB wrong parameter
12 Incorrect 105 ms 10124 KB wrong parameter
13 Incorrect 125 ms 11000 KB wrong parameter
14 Incorrect 103 ms 10224 KB wrong parameter
15 Incorrect 89 ms 10188 KB wrong parameter
16 Incorrect 135 ms 10728 KB wrong parameter
17 Incorrect 125 ms 10728 KB wrong parameter
18 Incorrect 117 ms 10864 KB wrong parameter
19 Incorrect 110 ms 10460 KB wrong parameter
20 Incorrect 142 ms 11200 KB wrong parameter
21 Incorrect 136 ms 11280 KB wrong parameter
22 Incorrect 114 ms 10772 KB wrong parameter
23 Incorrect 145 ms 11512 KB wrong parameter
# Verdict Execution time Memory Grader output
1 Incorrect 270 ms 14688 KB wrong parameter
2 Incorrect 3 ms 4872 KB wrong parameter
3 Incorrect 98 ms 9676 KB wrong parameter
4 Incorrect 3 ms 4872 KB function hops(h,c,d) must be called exactly N×H times
5 Incorrect 91 ms 9812 KB wrong parameter
6 Incorrect 113 ms 10340 KB wrong parameter
7 Incorrect 122 ms 10552 KB wrong parameter
8 Incorrect 90 ms 9892 KB wrong parameter
9 Incorrect 107 ms 10200 KB wrong parameter
10 Incorrect 106 ms 10276 KB wrong parameter
11 Incorrect 102 ms 10268 KB wrong parameter
12 Incorrect 105 ms 10124 KB wrong parameter
13 Incorrect 125 ms 11000 KB wrong parameter
14 Incorrect 103 ms 10224 KB wrong parameter
15 Incorrect 89 ms 10188 KB wrong parameter
16 Incorrect 135 ms 10728 KB wrong parameter
17 Incorrect 125 ms 10728 KB wrong parameter
18 Incorrect 117 ms 10864 KB wrong parameter
19 Incorrect 110 ms 10460 KB wrong parameter
20 Incorrect 142 ms 11200 KB wrong parameter
21 Incorrect 136 ms 11280 KB wrong parameter
22 Incorrect 114 ms 10772 KB wrong parameter
23 Incorrect 145 ms 11512 KB wrong parameter