#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
#define ll int
#define pb push_back
#define f first
#define s second
using namespace std;
vector <ll> gr[1005];
vector <pair <ll, ll>> bfs(ll xx)
{
ll cnt = 0;
vector <pair <ll, ll>> ret;
queue <ll> q;
unordered_map <ll, bool> vis;
q.push(xx);
ret.pb({xx, 0});
vis[xx] = true;
while (q.size())
{
ll x = q.front();
q.pop();
vis[x] = true;
cnt++;
for (auto v : gr[x])
{
if (!vis[v])
{
q.push(v);
ret.pb({v, cnt});
}
}
}
return ret;
}
/*ll encode_bit(ll b)
{
return b;
}*/
void encode(ll n, ll h, ll p, ll a[], ll b[])
{
for (ll i = 0; i < p; i++)
{
gr[a[i]].pb(b[i]);
gr[b[i]].pb(a[i]);
}
for (ll i = 0; i < h; i++)
{
vector <pair <ll, ll>> vec = bfs(i);
sort(vec.begin(), vec.end());
for (auto v : vec)
{
for (ll b = 0; b < 10; b++)
{
ll bit = (1 << b) & v.s;
encode_bit(bit);
}
}
}
}
#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
#define ll int
#define pb push_back
#define f first
#define s second
using namespace std;
/*ll decode_bit()
{
return
}*/
/*ll hops(ll h, ll c, ll d)
{
return d;
}*/
void decode(ll n, ll h)
{
for (ll i = 0; i < h; i++)
{
for (ll j = 0; j < n; j++)
{
ll d = 0;
ll b = decode_bit();
d += (1 << b);
hops(i, j, d);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1373 ms |
10508 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
0 ms |
636 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
5 ms |
892 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
636 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
13 ms |
1428 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
12 ms |
1400 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
45 ms |
2264 KB |
encode_bit(b) wrong parameter |
8 |
Runtime error |
568 ms |
262144 KB |
Execution killed with signal 9 |
9 |
Incorrect |
11 ms |
1288 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
12 ms |
1688 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
32 ms |
2128 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
4 ms |
772 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
74 ms |
2728 KB |
encode_bit(b) wrong parameter |
14 |
Runtime error |
673 ms |
262144 KB |
Execution killed with signal 9 |
15 |
Incorrect |
22 ms |
2088 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
245 ms |
18896 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
99 ms |
3472 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
158 ms |
3760 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
54 ms |
2184 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
151 ms |
4268 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
175 ms |
4520 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
61 ms |
2752 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
174 ms |
3520 KB |
encode_bit(b) wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1373 ms |
10508 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
0 ms |
636 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
5 ms |
892 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
636 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
13 ms |
1428 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
12 ms |
1400 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
45 ms |
2264 KB |
encode_bit(b) wrong parameter |
8 |
Runtime error |
568 ms |
262144 KB |
Execution killed with signal 9 |
9 |
Incorrect |
11 ms |
1288 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
12 ms |
1688 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
32 ms |
2128 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
4 ms |
772 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
74 ms |
2728 KB |
encode_bit(b) wrong parameter |
14 |
Runtime error |
673 ms |
262144 KB |
Execution killed with signal 9 |
15 |
Incorrect |
22 ms |
2088 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
245 ms |
18896 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
99 ms |
3472 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
158 ms |
3760 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
54 ms |
2184 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
151 ms |
4268 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
175 ms |
4520 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
61 ms |
2752 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
174 ms |
3520 KB |
encode_bit(b) wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1373 ms |
10508 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
0 ms |
636 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
5 ms |
892 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
636 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
13 ms |
1428 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
12 ms |
1400 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
45 ms |
2264 KB |
encode_bit(b) wrong parameter |
8 |
Runtime error |
568 ms |
262144 KB |
Execution killed with signal 9 |
9 |
Incorrect |
11 ms |
1288 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
12 ms |
1688 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
32 ms |
2128 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
4 ms |
772 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
74 ms |
2728 KB |
encode_bit(b) wrong parameter |
14 |
Runtime error |
673 ms |
262144 KB |
Execution killed with signal 9 |
15 |
Incorrect |
22 ms |
2088 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
245 ms |
18896 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
99 ms |
3472 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
158 ms |
3760 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
54 ms |
2184 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
151 ms |
4268 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
175 ms |
4520 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
61 ms |
2752 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
174 ms |
3520 KB |
encode_bit(b) wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1373 ms |
10508 KB |
encode_bit(b) wrong parameter |
2 |
Incorrect |
0 ms |
636 KB |
encode_bit(b) wrong parameter |
3 |
Incorrect |
5 ms |
892 KB |
encode_bit(b) wrong parameter |
4 |
Incorrect |
1 ms |
636 KB |
encode_bit(b) wrong parameter |
5 |
Incorrect |
13 ms |
1428 KB |
encode_bit(b) wrong parameter |
6 |
Incorrect |
12 ms |
1400 KB |
encode_bit(b) wrong parameter |
7 |
Incorrect |
45 ms |
2264 KB |
encode_bit(b) wrong parameter |
8 |
Runtime error |
568 ms |
262144 KB |
Execution killed with signal 9 |
9 |
Incorrect |
11 ms |
1288 KB |
encode_bit(b) wrong parameter |
10 |
Incorrect |
12 ms |
1688 KB |
encode_bit(b) wrong parameter |
11 |
Incorrect |
32 ms |
2128 KB |
encode_bit(b) wrong parameter |
12 |
Incorrect |
4 ms |
772 KB |
encode_bit(b) wrong parameter |
13 |
Incorrect |
74 ms |
2728 KB |
encode_bit(b) wrong parameter |
14 |
Runtime error |
673 ms |
262144 KB |
Execution killed with signal 9 |
15 |
Incorrect |
22 ms |
2088 KB |
encode_bit(b) wrong parameter |
16 |
Incorrect |
245 ms |
18896 KB |
encode_bit(b) wrong parameter |
17 |
Incorrect |
99 ms |
3472 KB |
encode_bit(b) wrong parameter |
18 |
Incorrect |
158 ms |
3760 KB |
encode_bit(b) wrong parameter |
19 |
Incorrect |
54 ms |
2184 KB |
encode_bit(b) wrong parameter |
20 |
Incorrect |
151 ms |
4268 KB |
encode_bit(b) wrong parameter |
21 |
Incorrect |
175 ms |
4520 KB |
encode_bit(b) wrong parameter |
22 |
Incorrect |
61 ms |
2752 KB |
encode_bit(b) wrong parameter |
23 |
Incorrect |
174 ms |
3520 KB |
encode_bit(b) wrong parameter |