#include "grader.h"
#include "encoder.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[1001];
void code(int num)
{
for (int i = 0; i < 10; i++)
{
bool bit = num & (1 << i);
encode_bit(bit);
}
}
void encode(int nv, int nh, int ne, int *v1, int *v2){
for (int i = 0; i < ne; i++)
{
adj[v1[i]].push_back(v2[i]);
adj[v2[i]].push_back(v1[i]);
}
for (int i = 0; i < nh; i++)
{
queue<array<int, 2>> que;
que.push({i, 0});
vector<int> vis(nv);
vector<int> val(nv);
vis[i] = true;
while (!que.empty())
{
auto cur = que.front();
que.pop();
val[cur[0]] = cur[1];
for (int next : adj[cur[0]])
{
if (vis[next]) continue;
vis[next] = true;
que.push({next, cur[1] + 1});
}
}
for (int i = 0; i < nv; i++) code(val[i]);
}
return;
}
#include "grader.h"
#include "decoder.h"
#include <bits/stdc++.h>
using namespace std;
int code()
{
int num = 0;
for (int i = 0, fact = 1; i < 10; fact *= 2, i++)
{
num += decode_bit() * fact;
}
return num;
}
void decode(int nv, int nh) {
for (int i = 0; i < nh; i++)
{
for (int j = 0; j < nv; j++)
{
hops(i, j, code());
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
341 ms |
12688 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4764 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
76 ms |
7520 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
4 ms |
4748 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
92 ms |
7648 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
91 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
113 ms |
8260 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
82 ms |
7836 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
91 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
92 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
97 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
87 ms |
7944 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
112 ms |
8588 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
91 ms |
8128 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
88 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
124 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
110 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
132 ms |
8628 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
98 ms |
8160 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
137 ms |
8844 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
149 ms |
8928 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
122 ms |
8428 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
172 ms |
9184 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
341 ms |
12688 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4764 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
76 ms |
7520 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
4 ms |
4748 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
92 ms |
7648 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
91 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
113 ms |
8260 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
82 ms |
7836 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
91 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
92 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
97 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
87 ms |
7944 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
112 ms |
8588 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
91 ms |
8128 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
88 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
124 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
110 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
132 ms |
8628 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
98 ms |
8160 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
137 ms |
8844 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
149 ms |
8928 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
122 ms |
8428 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
172 ms |
9184 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
341 ms |
12688 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4764 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
76 ms |
7520 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
4 ms |
4748 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
92 ms |
7648 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
91 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
113 ms |
8260 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
82 ms |
7836 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
91 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
92 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
97 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
87 ms |
7944 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
112 ms |
8588 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
91 ms |
8128 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
88 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
124 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
110 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
132 ms |
8628 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
98 ms |
8160 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
137 ms |
8844 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
149 ms |
8928 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
122 ms |
8428 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
172 ms |
9184 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
341 ms |
12688 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4764 KB |
Output is correct - 150 call(s) of encode_bit() |
3 |
Correct |
76 ms |
7520 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
4 |
Correct |
4 ms |
4748 KB |
Output is correct - 250 call(s) of encode_bit() |
5 |
Correct |
92 ms |
7648 KB |
Output is partially correct - 324000 call(s) of encode_bit() |
6 |
Correct |
91 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
7 |
Correct |
113 ms |
8260 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
8 |
Correct |
82 ms |
7836 KB |
Output is partially correct - 345960 call(s) of encode_bit() |
9 |
Correct |
91 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
10 |
Correct |
92 ms |
7904 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
11 |
Correct |
97 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
12 |
Correct |
87 ms |
7944 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
13 |
Correct |
112 ms |
8588 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
14 |
Correct |
91 ms |
8128 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
15 |
Correct |
88 ms |
7776 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
16 |
Correct |
124 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
17 |
Correct |
110 ms |
8288 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
18 |
Correct |
132 ms |
8628 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
19 |
Correct |
98 ms |
8160 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
20 |
Correct |
137 ms |
8844 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
21 |
Correct |
149 ms |
8928 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
22 |
Correct |
122 ms |
8428 KB |
Output is partially correct - 360000 call(s) of encode_bit() |
23 |
Correct |
172 ms |
9184 KB |
Output is partially correct - 360000 call(s) of encode_bit() |