#include "grader.h"
#include "encoder.h"
#include <vector>
#include <queue>
void send_int(int x, int nb)
{
for (int j = 0; j < nb; ++j) encode_bit((x >> j) & 1);
}
#define N 1001
using namespace std;
vector<int> g[N];
int n, h;
vector<int> bfs(int u)
{
vector<int> d(n, 1e9);
queue<pair<int, int>> q;
q.emplace(d[u] = 0, u);
while (q.size())
{
auto [c, u] = q.front(); q.pop();
for (auto v : g[u])
{
if (c + 1 < d[v])
q.emplace(d[v] = c + 1, v);
}
}
return d;
}
void encode(int n0, int h0, int ne, int *v1, int *v2){
for (int i = 0; i < ne; ++i) g[v1[i]].push_back(v2[i]), g[v2[i]].push_back(v1[i]);
::n = n0; ::h = h0;
for (int i = 0; i < h; ++i)
{
auto d = bfs(i);
for (int j = 0; j < n; ++j)
send_int(d[j], 10);
}
return;
}
#include "grader.h"
#include "decoder.h"
unsigned read_int(int nb)
{
unsigned u = 0;
for (int j = 0; j < nb; ++j) u |= 1 << decode_bit();
return u;
}
int n, h;
void decode(int v0, int h0) {
::n = v0; ::h = h0;
for (int i = 0; i < h; ++i)
{
for (int j = 0; j < n; ++j)
{
hops(i, j, read_int(10));
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
20832 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
3 |
Incorrect |
50 ms |
12504 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
5 |
Incorrect |
49 ms |
12668 KB |
Output isn't correct |
6 |
Incorrect |
55 ms |
14532 KB |
Output isn't correct |
7 |
Incorrect |
62 ms |
14760 KB |
Output isn't correct |
8 |
Incorrect |
49 ms |
14272 KB |
Output isn't correct |
9 |
Incorrect |
53 ms |
14340 KB |
Output isn't correct |
10 |
Incorrect |
55 ms |
14528 KB |
Output isn't correct |
11 |
Incorrect |
55 ms |
14708 KB |
Output isn't correct |
12 |
Incorrect |
61 ms |
14244 KB |
Output isn't correct |
13 |
Incorrect |
69 ms |
14988 KB |
Output isn't correct |
14 |
Incorrect |
57 ms |
14280 KB |
Output isn't correct |
15 |
Incorrect |
55 ms |
14356 KB |
Output isn't correct |
16 |
Incorrect |
67 ms |
14896 KB |
Output isn't correct |
17 |
Incorrect |
81 ms |
14684 KB |
Output isn't correct |
18 |
Incorrect |
71 ms |
15128 KB |
Output isn't correct |
19 |
Incorrect |
62 ms |
14612 KB |
Output isn't correct |
20 |
Incorrect |
79 ms |
15328 KB |
Output isn't correct |
21 |
Incorrect |
84 ms |
15600 KB |
Output isn't correct |
22 |
Incorrect |
68 ms |
14584 KB |
Output isn't correct |
23 |
Incorrect |
86 ms |
15456 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
20832 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
3 |
Incorrect |
50 ms |
12504 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
5 |
Incorrect |
49 ms |
12668 KB |
Output isn't correct |
6 |
Incorrect |
55 ms |
14532 KB |
Output isn't correct |
7 |
Incorrect |
62 ms |
14760 KB |
Output isn't correct |
8 |
Incorrect |
49 ms |
14272 KB |
Output isn't correct |
9 |
Incorrect |
53 ms |
14340 KB |
Output isn't correct |
10 |
Incorrect |
55 ms |
14528 KB |
Output isn't correct |
11 |
Incorrect |
55 ms |
14708 KB |
Output isn't correct |
12 |
Incorrect |
61 ms |
14244 KB |
Output isn't correct |
13 |
Incorrect |
69 ms |
14988 KB |
Output isn't correct |
14 |
Incorrect |
57 ms |
14280 KB |
Output isn't correct |
15 |
Incorrect |
55 ms |
14356 KB |
Output isn't correct |
16 |
Incorrect |
67 ms |
14896 KB |
Output isn't correct |
17 |
Incorrect |
81 ms |
14684 KB |
Output isn't correct |
18 |
Incorrect |
71 ms |
15128 KB |
Output isn't correct |
19 |
Incorrect |
62 ms |
14612 KB |
Output isn't correct |
20 |
Incorrect |
79 ms |
15328 KB |
Output isn't correct |
21 |
Incorrect |
84 ms |
15600 KB |
Output isn't correct |
22 |
Incorrect |
68 ms |
14584 KB |
Output isn't correct |
23 |
Incorrect |
86 ms |
15456 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
20832 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
3 |
Incorrect |
50 ms |
12504 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
5 |
Incorrect |
49 ms |
12668 KB |
Output isn't correct |
6 |
Incorrect |
55 ms |
14532 KB |
Output isn't correct |
7 |
Incorrect |
62 ms |
14760 KB |
Output isn't correct |
8 |
Incorrect |
49 ms |
14272 KB |
Output isn't correct |
9 |
Incorrect |
53 ms |
14340 KB |
Output isn't correct |
10 |
Incorrect |
55 ms |
14528 KB |
Output isn't correct |
11 |
Incorrect |
55 ms |
14708 KB |
Output isn't correct |
12 |
Incorrect |
61 ms |
14244 KB |
Output isn't correct |
13 |
Incorrect |
69 ms |
14988 KB |
Output isn't correct |
14 |
Incorrect |
57 ms |
14280 KB |
Output isn't correct |
15 |
Incorrect |
55 ms |
14356 KB |
Output isn't correct |
16 |
Incorrect |
67 ms |
14896 KB |
Output isn't correct |
17 |
Incorrect |
81 ms |
14684 KB |
Output isn't correct |
18 |
Incorrect |
71 ms |
15128 KB |
Output isn't correct |
19 |
Incorrect |
62 ms |
14612 KB |
Output isn't correct |
20 |
Incorrect |
79 ms |
15328 KB |
Output isn't correct |
21 |
Incorrect |
84 ms |
15600 KB |
Output isn't correct |
22 |
Incorrect |
68 ms |
14584 KB |
Output isn't correct |
23 |
Incorrect |
86 ms |
15456 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
20832 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
3 |
Incorrect |
50 ms |
12504 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
12036 KB |
Output isn't correct |
5 |
Incorrect |
49 ms |
12668 KB |
Output isn't correct |
6 |
Incorrect |
55 ms |
14532 KB |
Output isn't correct |
7 |
Incorrect |
62 ms |
14760 KB |
Output isn't correct |
8 |
Incorrect |
49 ms |
14272 KB |
Output isn't correct |
9 |
Incorrect |
53 ms |
14340 KB |
Output isn't correct |
10 |
Incorrect |
55 ms |
14528 KB |
Output isn't correct |
11 |
Incorrect |
55 ms |
14708 KB |
Output isn't correct |
12 |
Incorrect |
61 ms |
14244 KB |
Output isn't correct |
13 |
Incorrect |
69 ms |
14988 KB |
Output isn't correct |
14 |
Incorrect |
57 ms |
14280 KB |
Output isn't correct |
15 |
Incorrect |
55 ms |
14356 KB |
Output isn't correct |
16 |
Incorrect |
67 ms |
14896 KB |
Output isn't correct |
17 |
Incorrect |
81 ms |
14684 KB |
Output isn't correct |
18 |
Incorrect |
71 ms |
15128 KB |
Output isn't correct |
19 |
Incorrect |
62 ms |
14612 KB |
Output isn't correct |
20 |
Incorrect |
79 ms |
15328 KB |
Output isn't correct |
21 |
Incorrect |
84 ms |
15600 KB |
Output isn't correct |
22 |
Incorrect |
68 ms |
14584 KB |
Output isn't correct |
23 |
Incorrect |
86 ms |
15456 KB |
Output isn't correct |