Submission #889840

# Submission time Handle Problem Language Result Execution time Memory
889840 2023-12-20T08:06:20 Z 12345678 Saveit (IOI10_saveit) C++17
50 / 100
178 ms 20240 KB
#include "grader.h"
#include "encoder.h"
#include <bits/stdc++.h>

using namespace std;

void send(int x)
{
    for (int i=0; i<10; i++) encode_bit((x&(1<<i)?1:0));
}

void encode(int nv, int nh, int ne, int *v1, int *v2){
    vector<int> d[nv];
    for (int i=0; i<ne; i++) d[v1[i]].push_back(v2[i]), d[v2[i]].push_back(v1[i]);
    for (int i=0; i<nh; i++)
    {
        vector<int> vs(nv), res(nv);
        queue<int> q;
        vs[i]=1;
        q.push(i);
        while (!q.empty())
        {
            int u=q.front();
            q.pop();
            for (auto v:d[u]) if (!vs[v]) res[v]=res[u]+1, vs[v]=1, q.push(v);
        }
        for (int j=0; j<nv; j++) send(res[j]);
    }
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>

using namespace std;

void decode(int nv, int nh) {
    for (int i=0; i<nh; i++)
    {
        for (int j=0; j<nv; j++)
        {
            int res=0;
            for (int k=0; k<10; k++) if (decode_bit()) res|=(1<<k);
            hops(i, j, res);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 178 ms 20240 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 11268 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 52 ms 15372 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 11264 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 56 ms 16248 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 56 ms 15752 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 66 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 53 ms 15472 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 55 ms 15516 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 60 ms 15556 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 64 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 54 ms 15552 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 78 ms 15876 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 59 ms 15360 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 55 ms 15532 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 15872 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 65 ms 15868 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 71 ms 15936 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 60 ms 15824 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 75 ms 18376 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 83 ms 18384 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 67 ms 16084 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 84 ms 18412 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 178 ms 20240 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 11268 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 52 ms 15372 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 11264 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 56 ms 16248 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 56 ms 15752 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 66 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 53 ms 15472 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 55 ms 15516 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 60 ms 15556 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 64 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 54 ms 15552 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 78 ms 15876 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 59 ms 15360 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 55 ms 15532 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 15872 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 65 ms 15868 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 71 ms 15936 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 60 ms 15824 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 75 ms 18376 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 83 ms 18384 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 67 ms 16084 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 84 ms 18412 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 178 ms 20240 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 11268 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 52 ms 15372 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 11264 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 56 ms 16248 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 56 ms 15752 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 66 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 53 ms 15472 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 55 ms 15516 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 60 ms 15556 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 64 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 54 ms 15552 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 78 ms 15876 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 59 ms 15360 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 55 ms 15532 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 15872 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 65 ms 15868 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 71 ms 15936 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 60 ms 15824 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 75 ms 18376 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 83 ms 18384 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 67 ms 16084 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 84 ms 18412 KB Output is partially correct - 360000 call(s) of encode_bit()
# Verdict Execution time Memory Grader output
1 Correct 178 ms 20240 KB Output is partially correct - 360000 call(s) of encode_bit()
2 Correct 2 ms 11268 KB Output is correct - 150 call(s) of encode_bit()
3 Correct 52 ms 15372 KB Output is partially correct - 324000 call(s) of encode_bit()
4 Correct 2 ms 11264 KB Output is correct - 250 call(s) of encode_bit()
5 Correct 56 ms 16248 KB Output is partially correct - 324000 call(s) of encode_bit()
6 Correct 56 ms 15752 KB Output is partially correct - 360000 call(s) of encode_bit()
7 Correct 66 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
8 Correct 53 ms 15472 KB Output is partially correct - 345960 call(s) of encode_bit()
9 Correct 55 ms 15516 KB Output is partially correct - 360000 call(s) of encode_bit()
10 Correct 60 ms 15556 KB Output is partially correct - 360000 call(s) of encode_bit()
11 Correct 64 ms 15764 KB Output is partially correct - 360000 call(s) of encode_bit()
12 Correct 54 ms 15552 KB Output is partially correct - 360000 call(s) of encode_bit()
13 Correct 78 ms 15876 KB Output is partially correct - 360000 call(s) of encode_bit()
14 Correct 59 ms 15360 KB Output is partially correct - 360000 call(s) of encode_bit()
15 Correct 55 ms 15532 KB Output is partially correct - 360000 call(s) of encode_bit()
16 Correct 68 ms 15872 KB Output is partially correct - 360000 call(s) of encode_bit()
17 Correct 65 ms 15868 KB Output is partially correct - 360000 call(s) of encode_bit()
18 Correct 71 ms 15936 KB Output is partially correct - 360000 call(s) of encode_bit()
19 Correct 60 ms 15824 KB Output is partially correct - 360000 call(s) of encode_bit()
20 Correct 75 ms 18376 KB Output is partially correct - 360000 call(s) of encode_bit()
21 Correct 83 ms 18384 KB Output is partially correct - 360000 call(s) of encode_bit()
22 Correct 67 ms 16084 KB Output is partially correct - 360000 call(s) of encode_bit()
23 Correct 84 ms 18412 KB Output is partially correct - 360000 call(s) of encode_bit()