Submission #565024

# Submission time Handle Problem Language Result Execution time Memory
565024 2022-05-20T07:52:48 Z 1zaid1 Saveit (IOI10_saveit) C++17
0 / 100
267 ms 14904 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 < 36; 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 < 36; i++) {
        for (int j = 0; 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 < 36; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < 10; k++) {
                pp[i][j] += decode_bit()*(1<<k);
            }
        }
    }

    for (int i = 0; i < 36; i++) {
        for (int j = 0; j < n; j++) {
            hops(i, j, pp[i][j]);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 267 ms 14904 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Runtime error 7 ms 8976 KB Execution killed with signal 11
3 Correct 86 ms 9684 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Runtime error 7 ms 8952 KB Execution killed with signal 11
5 Correct 103 ms 9884 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 103 ms 10384 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 119 ms 10644 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 91 ms 10216 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 106 ms 10300 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 98 ms 10308 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 110 ms 10452 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 95 ms 10240 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 119 ms 10936 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 98 ms 10276 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 91 ms 10360 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 114 ms 10796 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 113 ms 10780 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 118 ms 11004 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 113 ms 10608 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 126 ms 11304 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 137 ms 11400 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 111 ms 10900 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 142 ms 11576 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 267 ms 14904 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Runtime error 7 ms 8976 KB Execution killed with signal 11
3 Correct 86 ms 9684 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Runtime error 7 ms 8952 KB Execution killed with signal 11
5 Correct 103 ms 9884 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 103 ms 10384 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 119 ms 10644 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 91 ms 10216 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 106 ms 10300 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 98 ms 10308 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 110 ms 10452 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 95 ms 10240 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 119 ms 10936 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 98 ms 10276 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 91 ms 10360 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 114 ms 10796 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 113 ms 10780 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 118 ms 11004 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 113 ms 10608 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 126 ms 11304 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 137 ms 11400 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 111 ms 10900 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 142 ms 11576 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 267 ms 14904 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Runtime error 7 ms 8976 KB Execution killed with signal 11
3 Correct 86 ms 9684 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Runtime error 7 ms 8952 KB Execution killed with signal 11
5 Correct 103 ms 9884 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 103 ms 10384 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 119 ms 10644 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 91 ms 10216 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 106 ms 10300 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 98 ms 10308 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 110 ms 10452 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 95 ms 10240 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 119 ms 10936 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 98 ms 10276 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 91 ms 10360 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 114 ms 10796 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 113 ms 10780 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 118 ms 11004 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 113 ms 10608 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 126 ms 11304 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 137 ms 11400 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 111 ms 10900 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 142 ms 11576 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 267 ms 14904 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Runtime error 7 ms 8976 KB Execution killed with signal 11
3 Correct 86 ms 9684 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Runtime error 7 ms 8952 KB Execution killed with signal 11
5 Correct 103 ms 9884 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 103 ms 10384 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 119 ms 10644 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 91 ms 10216 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 106 ms 10300 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 98 ms 10308 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 110 ms 10452 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 95 ms 10240 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 119 ms 10936 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 98 ms 10276 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 91 ms 10360 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 114 ms 10796 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 113 ms 10780 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 118 ms 11004 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 113 ms 10608 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 126 ms 11304 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 137 ms 11400 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 111 ms 10900 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 142 ms 11576 KB Output is partially correct - 360000 call(s) of encode_bit()