#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
#include "decoder.h"
#define ll long long
using namespace std;
void encode(int n, int h, int p, int *a, int *b){
map<pair<int,int>,bool>mp;
for(int i=0;i<p;i++)
mp[{a[i],b[i]}]=1;
for(int i=0;i<h;i++)
{
for(int j=0;j<n;j++)
{
if(mp[{i,j}]||mp[{j,i}])encode_bit(1);
else encode_bit(0);
}
}
return;
}
#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
#include "decoder.h"
#define ll long long
using namespace std;
void decode(int n, int h) {
vector<ll>v[n];
for(int i=0;i<h;i++)
{
for(int j=0;j<n;j++)
{
int a = decode_bit();
if(a==1)
{
v[i].push_back(j);
v[j].push_back(i);
}
}
}
for(int i=0;i<h;i++)
{
deque<ll>q;
ll vis[n]={};
vis[i]=1;
q.push_back(i);
while(!q.empty())
{
ll x=q.front();
q.pop_front();
for(auto u:v[x])
{
if(vis[u]==0)
{
vis[u]=vis[x]+1;
q.push_back(u);
}
}
}
for(int j=0;j<n;j++)
{
hops(i,j,vis[j]-1);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
249 ms |
25256 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4604 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
25 ms |
9068 KB |
wrong parameter |
4 |
Correct |
3 ms |
4600 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
36 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
33 ms |
9984 KB |
wrong parameter |
7 |
Incorrect |
54 ms |
11232 KB |
wrong parameter |
8 |
Incorrect |
27 ms |
9372 KB |
wrong parameter |
9 |
Incorrect |
29 ms |
9484 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9608 KB |
wrong parameter |
11 |
Incorrect |
43 ms |
9888 KB |
wrong parameter |
12 |
Incorrect |
32 ms |
9460 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11904 KB |
wrong parameter |
14 |
Incorrect |
29 ms |
9644 KB |
wrong parameter |
15 |
Incorrect |
29 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
66 ms |
11684 KB |
wrong parameter |
17 |
Incorrect |
54 ms |
11236 KB |
wrong parameter |
18 |
Incorrect |
69 ms |
11992 KB |
wrong parameter |
19 |
Incorrect |
39 ms |
10740 KB |
wrong parameter |
20 |
Incorrect |
72 ms |
12636 KB |
wrong parameter |
21 |
Incorrect |
86 ms |
13428 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
92 ms |
13592 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
249 ms |
25256 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4604 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
25 ms |
9068 KB |
wrong parameter |
4 |
Correct |
3 ms |
4600 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
36 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
33 ms |
9984 KB |
wrong parameter |
7 |
Incorrect |
54 ms |
11232 KB |
wrong parameter |
8 |
Incorrect |
27 ms |
9372 KB |
wrong parameter |
9 |
Incorrect |
29 ms |
9484 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9608 KB |
wrong parameter |
11 |
Incorrect |
43 ms |
9888 KB |
wrong parameter |
12 |
Incorrect |
32 ms |
9460 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11904 KB |
wrong parameter |
14 |
Incorrect |
29 ms |
9644 KB |
wrong parameter |
15 |
Incorrect |
29 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
66 ms |
11684 KB |
wrong parameter |
17 |
Incorrect |
54 ms |
11236 KB |
wrong parameter |
18 |
Incorrect |
69 ms |
11992 KB |
wrong parameter |
19 |
Incorrect |
39 ms |
10740 KB |
wrong parameter |
20 |
Incorrect |
72 ms |
12636 KB |
wrong parameter |
21 |
Incorrect |
86 ms |
13428 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
92 ms |
13592 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
249 ms |
25256 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4604 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
25 ms |
9068 KB |
wrong parameter |
4 |
Correct |
3 ms |
4600 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
36 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
33 ms |
9984 KB |
wrong parameter |
7 |
Incorrect |
54 ms |
11232 KB |
wrong parameter |
8 |
Incorrect |
27 ms |
9372 KB |
wrong parameter |
9 |
Incorrect |
29 ms |
9484 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9608 KB |
wrong parameter |
11 |
Incorrect |
43 ms |
9888 KB |
wrong parameter |
12 |
Incorrect |
32 ms |
9460 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11904 KB |
wrong parameter |
14 |
Incorrect |
29 ms |
9644 KB |
wrong parameter |
15 |
Incorrect |
29 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
66 ms |
11684 KB |
wrong parameter |
17 |
Incorrect |
54 ms |
11236 KB |
wrong parameter |
18 |
Incorrect |
69 ms |
11992 KB |
wrong parameter |
19 |
Incorrect |
39 ms |
10740 KB |
wrong parameter |
20 |
Incorrect |
72 ms |
12636 KB |
wrong parameter |
21 |
Incorrect |
86 ms |
13428 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
92 ms |
13592 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
249 ms |
25256 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4604 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
25 ms |
9068 KB |
wrong parameter |
4 |
Correct |
3 ms |
4600 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
36 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
33 ms |
9984 KB |
wrong parameter |
7 |
Incorrect |
54 ms |
11232 KB |
wrong parameter |
8 |
Incorrect |
27 ms |
9372 KB |
wrong parameter |
9 |
Incorrect |
29 ms |
9484 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9608 KB |
wrong parameter |
11 |
Incorrect |
43 ms |
9888 KB |
wrong parameter |
12 |
Incorrect |
32 ms |
9460 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11904 KB |
wrong parameter |
14 |
Incorrect |
29 ms |
9644 KB |
wrong parameter |
15 |
Incorrect |
29 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
66 ms |
11684 KB |
wrong parameter |
17 |
Incorrect |
54 ms |
11236 KB |
wrong parameter |
18 |
Incorrect |
69 ms |
11992 KB |
wrong parameter |
19 |
Incorrect |
39 ms |
10740 KB |
wrong parameter |
20 |
Incorrect |
72 ms |
12636 KB |
wrong parameter |
21 |
Incorrect |
86 ms |
13428 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
92 ms |
13592 KB |
wrong parameter |