#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 |
248 ms |
25356 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 |
24 ms |
9072 KB |
wrong parameter |
4 |
Correct |
2 ms |
4604 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
32 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
38 ms |
9864 KB |
wrong parameter |
7 |
Incorrect |
55 ms |
11260 KB |
wrong parameter |
8 |
Incorrect |
28 ms |
9268 KB |
wrong parameter |
9 |
Incorrect |
27 ms |
9592 KB |
wrong parameter |
10 |
Incorrect |
28 ms |
9596 KB |
wrong parameter |
11 |
Incorrect |
39 ms |
10012 KB |
wrong parameter |
12 |
Incorrect |
30 ms |
9412 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11824 KB |
wrong parameter |
14 |
Incorrect |
31 ms |
9660 KB |
wrong parameter |
15 |
Incorrect |
30 ms |
9716 KB |
wrong parameter |
16 |
Incorrect |
57 ms |
11652 KB |
wrong parameter |
17 |
Incorrect |
51 ms |
11128 KB |
wrong parameter |
18 |
Incorrect |
59 ms |
12060 KB |
wrong parameter |
19 |
Incorrect |
45 ms |
10652 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
12668 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
13708 KB |
wrong parameter |
22 |
Incorrect |
57 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
94 ms |
13676 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
248 ms |
25356 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 |
24 ms |
9072 KB |
wrong parameter |
4 |
Correct |
2 ms |
4604 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
32 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
38 ms |
9864 KB |
wrong parameter |
7 |
Incorrect |
55 ms |
11260 KB |
wrong parameter |
8 |
Incorrect |
28 ms |
9268 KB |
wrong parameter |
9 |
Incorrect |
27 ms |
9592 KB |
wrong parameter |
10 |
Incorrect |
28 ms |
9596 KB |
wrong parameter |
11 |
Incorrect |
39 ms |
10012 KB |
wrong parameter |
12 |
Incorrect |
30 ms |
9412 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11824 KB |
wrong parameter |
14 |
Incorrect |
31 ms |
9660 KB |
wrong parameter |
15 |
Incorrect |
30 ms |
9716 KB |
wrong parameter |
16 |
Incorrect |
57 ms |
11652 KB |
wrong parameter |
17 |
Incorrect |
51 ms |
11128 KB |
wrong parameter |
18 |
Incorrect |
59 ms |
12060 KB |
wrong parameter |
19 |
Incorrect |
45 ms |
10652 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
12668 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
13708 KB |
wrong parameter |
22 |
Incorrect |
57 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
94 ms |
13676 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
248 ms |
25356 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 |
24 ms |
9072 KB |
wrong parameter |
4 |
Correct |
2 ms |
4604 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
32 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
38 ms |
9864 KB |
wrong parameter |
7 |
Incorrect |
55 ms |
11260 KB |
wrong parameter |
8 |
Incorrect |
28 ms |
9268 KB |
wrong parameter |
9 |
Incorrect |
27 ms |
9592 KB |
wrong parameter |
10 |
Incorrect |
28 ms |
9596 KB |
wrong parameter |
11 |
Incorrect |
39 ms |
10012 KB |
wrong parameter |
12 |
Incorrect |
30 ms |
9412 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11824 KB |
wrong parameter |
14 |
Incorrect |
31 ms |
9660 KB |
wrong parameter |
15 |
Incorrect |
30 ms |
9716 KB |
wrong parameter |
16 |
Incorrect |
57 ms |
11652 KB |
wrong parameter |
17 |
Incorrect |
51 ms |
11128 KB |
wrong parameter |
18 |
Incorrect |
59 ms |
12060 KB |
wrong parameter |
19 |
Incorrect |
45 ms |
10652 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
12668 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
13708 KB |
wrong parameter |
22 |
Incorrect |
57 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
94 ms |
13676 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
248 ms |
25356 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 |
24 ms |
9072 KB |
wrong parameter |
4 |
Correct |
2 ms |
4604 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
32 ms |
9452 KB |
wrong parameter |
6 |
Incorrect |
38 ms |
9864 KB |
wrong parameter |
7 |
Incorrect |
55 ms |
11260 KB |
wrong parameter |
8 |
Incorrect |
28 ms |
9268 KB |
wrong parameter |
9 |
Incorrect |
27 ms |
9592 KB |
wrong parameter |
10 |
Incorrect |
28 ms |
9596 KB |
wrong parameter |
11 |
Incorrect |
39 ms |
10012 KB |
wrong parameter |
12 |
Incorrect |
30 ms |
9412 KB |
wrong parameter |
13 |
Incorrect |
59 ms |
11824 KB |
wrong parameter |
14 |
Incorrect |
31 ms |
9660 KB |
wrong parameter |
15 |
Incorrect |
30 ms |
9716 KB |
wrong parameter |
16 |
Incorrect |
57 ms |
11652 KB |
wrong parameter |
17 |
Incorrect |
51 ms |
11128 KB |
wrong parameter |
18 |
Incorrect |
59 ms |
12060 KB |
wrong parameter |
19 |
Incorrect |
45 ms |
10652 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
12668 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
13708 KB |
wrong parameter |
22 |
Incorrect |
57 ms |
11540 KB |
wrong parameter |
23 |
Incorrect |
94 ms |
13676 KB |
wrong parameter |