Submission #1016120

# Submission time Handle Problem Language Result Execution time Memory
1016120 2024-07-07T12:12:55 Z 79brue Saveit (IOI10_saveit) C++17
0 / 100
147 ms 14000 KB
#include "grader.h"
#include "encoder.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int n, h, m;
    vector<int> link[1002];
    int dist[1002][1002];
    bool visited[1002][1002];
}

void encode(int nv, int nh, int ne, int *v1, int *v2){
    n = nv, h = nh, m = ne;
    for(int i=0; i<m; i++){
        link[v1[i]].push_back(v2[i]);
        link[v2[i]].push_back(v1[i]);
    }
    for(int s=0; s<h; s++){
        queue<pair<int, int> > que;
        que.push(make_pair(s, 0));
        visited[s][s] = 1;
        while(!que.empty()){
            auto &[x, d] = que.front(); que.pop();
            for(int y: link[x]){
                if(visited[s][y]) continue;
                visited[s][y] = 1, dist[s][y] = d+1;
                que.push(make_pair(y, d+1));
            }
        }
    }
    for(int i=0; i<h; i++) for(int j=0; j<n; j++) for(int d=0; d<10; d++){
        encode_bit((dist[i][j] >> d) & 1);
    }
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>

using namespace std;

int n, h;

void decode(int nv, int nh){
    n = nv, h = nh;
    for(int i=0; i<h; i++) for(int j=0; j<n; j++){
        int s = 0;
        for(int d=0; d<10; d++) s += decode_bit() << d;
        hops(i, j, s);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 147 ms 14000 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 1 ms 4628 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 33 ms 7752 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 1 ms 4628 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 38 ms 8932 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 36 ms 8128 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 46 ms 9728 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 36 ms 7960 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 48 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 40 ms 7680 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 49 ms 8112 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 39 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 51 ms 8624 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 60 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 46 ms 7636 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Incorrect 77 ms 8528 KB Output isn't correct
18 Correct 75 ms 8508 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 56 ms 8456 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Incorrect 84 ms 8860 KB Output isn't correct
21 Correct 67 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 66 ms 9924 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 71 ms 9372 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 147 ms 14000 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 1 ms 4628 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 33 ms 7752 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 1 ms 4628 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 38 ms 8932 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 36 ms 8128 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 46 ms 9728 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 36 ms 7960 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 48 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 40 ms 7680 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 49 ms 8112 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 39 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 51 ms 8624 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 60 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 46 ms 7636 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Incorrect 77 ms 8528 KB Output isn't correct
18 Correct 75 ms 8508 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 56 ms 8456 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Incorrect 84 ms 8860 KB Output isn't correct
21 Correct 67 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 66 ms 9924 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 71 ms 9372 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 147 ms 14000 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 1 ms 4628 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 33 ms 7752 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 1 ms 4628 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 38 ms 8932 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 36 ms 8128 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 46 ms 9728 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 36 ms 7960 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 48 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 40 ms 7680 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 49 ms 8112 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 39 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 51 ms 8624 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 60 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 46 ms 7636 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Incorrect 77 ms 8528 KB Output isn't correct
18 Correct 75 ms 8508 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 56 ms 8456 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Incorrect 84 ms 8860 KB Output isn't correct
21 Correct 67 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 66 ms 9924 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 71 ms 9372 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 147 ms 14000 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 1 ms 4628 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 33 ms 7752 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 1 ms 4628 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 38 ms 8932 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 36 ms 8128 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 46 ms 9728 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 36 ms 7960 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 48 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 40 ms 7680 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 49 ms 8112 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 39 ms 7936 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 51 ms 8624 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 60 ms 7852 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 46 ms 7636 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 8364 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Incorrect 77 ms 8528 KB Output isn't correct
18 Correct 75 ms 8508 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 56 ms 8456 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Incorrect 84 ms 8860 KB Output isn't correct
21 Correct 67 ms 9128 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 66 ms 9924 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 71 ms 9372 KB Output is partially correct - 360000 call(s) of encode_bit()