#include <bits/stdc++.h>
#include "grader.h"
#include "encoder.h"
#include "decoder.h"
#define ll long long
using namespace std;
void encode(int nv, int nh, int ne, int *v1, int *v2)
{
map<pair<int,int>,bool>mp;
for(int i=0;i<ne;i++)
mp[{v1[i],v2[i]}]=1;
for(int i=0;i<nh;i++)
{
for(int j=0;j<nv;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 nv, int nh) {
vector<ll>v[nv];
for(int i=0;i<nh;i++)
{
for(int j=0;j<nv;j++)
{
int a = decode_bit();
if(a==1)
{
v[i].push_back(j);
v[j].push_back(i);
}
}
}
for(int i=0;i<nh;i++)
{
deque<ll>q;
ll vis[nv]={};
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<nv;j++)
{
hops(i,j,vis[j]-1);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
254 ms |
25332 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4732 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
29 ms |
9172 KB |
wrong parameter |
4 |
Correct |
3 ms |
4612 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
31 ms |
9532 KB |
wrong parameter |
6 |
Incorrect |
31 ms |
9972 KB |
wrong parameter |
7 |
Incorrect |
52 ms |
11240 KB |
wrong parameter |
8 |
Incorrect |
29 ms |
9344 KB |
wrong parameter |
9 |
Incorrect |
30 ms |
9588 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9572 KB |
wrong parameter |
11 |
Incorrect |
32 ms |
10104 KB |
wrong parameter |
12 |
Incorrect |
26 ms |
9404 KB |
wrong parameter |
13 |
Incorrect |
61 ms |
11844 KB |
wrong parameter |
14 |
Incorrect |
30 ms |
9640 KB |
wrong parameter |
15 |
Incorrect |
27 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
55 ms |
11556 KB |
wrong parameter |
17 |
Incorrect |
47 ms |
11204 KB |
wrong parameter |
18 |
Incorrect |
77 ms |
11888 KB |
wrong parameter |
19 |
Incorrect |
40 ms |
10768 KB |
wrong parameter |
20 |
Incorrect |
70 ms |
12628 KB |
wrong parameter |
21 |
Incorrect |
102 ms |
13452 KB |
wrong parameter |
22 |
Incorrect |
60 ms |
11568 KB |
wrong parameter |
23 |
Incorrect |
89 ms |
13596 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
254 ms |
25332 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4732 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
29 ms |
9172 KB |
wrong parameter |
4 |
Correct |
3 ms |
4612 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
31 ms |
9532 KB |
wrong parameter |
6 |
Incorrect |
31 ms |
9972 KB |
wrong parameter |
7 |
Incorrect |
52 ms |
11240 KB |
wrong parameter |
8 |
Incorrect |
29 ms |
9344 KB |
wrong parameter |
9 |
Incorrect |
30 ms |
9588 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9572 KB |
wrong parameter |
11 |
Incorrect |
32 ms |
10104 KB |
wrong parameter |
12 |
Incorrect |
26 ms |
9404 KB |
wrong parameter |
13 |
Incorrect |
61 ms |
11844 KB |
wrong parameter |
14 |
Incorrect |
30 ms |
9640 KB |
wrong parameter |
15 |
Incorrect |
27 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
55 ms |
11556 KB |
wrong parameter |
17 |
Incorrect |
47 ms |
11204 KB |
wrong parameter |
18 |
Incorrect |
77 ms |
11888 KB |
wrong parameter |
19 |
Incorrect |
40 ms |
10768 KB |
wrong parameter |
20 |
Incorrect |
70 ms |
12628 KB |
wrong parameter |
21 |
Incorrect |
102 ms |
13452 KB |
wrong parameter |
22 |
Incorrect |
60 ms |
11568 KB |
wrong parameter |
23 |
Incorrect |
89 ms |
13596 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
254 ms |
25332 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4732 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
29 ms |
9172 KB |
wrong parameter |
4 |
Correct |
3 ms |
4612 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
31 ms |
9532 KB |
wrong parameter |
6 |
Incorrect |
31 ms |
9972 KB |
wrong parameter |
7 |
Incorrect |
52 ms |
11240 KB |
wrong parameter |
8 |
Incorrect |
29 ms |
9344 KB |
wrong parameter |
9 |
Incorrect |
30 ms |
9588 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9572 KB |
wrong parameter |
11 |
Incorrect |
32 ms |
10104 KB |
wrong parameter |
12 |
Incorrect |
26 ms |
9404 KB |
wrong parameter |
13 |
Incorrect |
61 ms |
11844 KB |
wrong parameter |
14 |
Incorrect |
30 ms |
9640 KB |
wrong parameter |
15 |
Incorrect |
27 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
55 ms |
11556 KB |
wrong parameter |
17 |
Incorrect |
47 ms |
11204 KB |
wrong parameter |
18 |
Incorrect |
77 ms |
11888 KB |
wrong parameter |
19 |
Incorrect |
40 ms |
10768 KB |
wrong parameter |
20 |
Incorrect |
70 ms |
12628 KB |
wrong parameter |
21 |
Incorrect |
102 ms |
13452 KB |
wrong parameter |
22 |
Incorrect |
60 ms |
11568 KB |
wrong parameter |
23 |
Incorrect |
89 ms |
13596 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
254 ms |
25332 KB |
Output is correct - 36000 call(s) of encode_bit() |
2 |
Correct |
3 ms |
4732 KB |
Output is correct - 15 call(s) of encode_bit() |
3 |
Incorrect |
29 ms |
9172 KB |
wrong parameter |
4 |
Correct |
3 ms |
4612 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Incorrect |
31 ms |
9532 KB |
wrong parameter |
6 |
Incorrect |
31 ms |
9972 KB |
wrong parameter |
7 |
Incorrect |
52 ms |
11240 KB |
wrong parameter |
8 |
Incorrect |
29 ms |
9344 KB |
wrong parameter |
9 |
Incorrect |
30 ms |
9588 KB |
wrong parameter |
10 |
Incorrect |
31 ms |
9572 KB |
wrong parameter |
11 |
Incorrect |
32 ms |
10104 KB |
wrong parameter |
12 |
Incorrect |
26 ms |
9404 KB |
wrong parameter |
13 |
Incorrect |
61 ms |
11844 KB |
wrong parameter |
14 |
Incorrect |
30 ms |
9640 KB |
wrong parameter |
15 |
Incorrect |
27 ms |
9712 KB |
wrong parameter |
16 |
Incorrect |
55 ms |
11556 KB |
wrong parameter |
17 |
Incorrect |
47 ms |
11204 KB |
wrong parameter |
18 |
Incorrect |
77 ms |
11888 KB |
wrong parameter |
19 |
Incorrect |
40 ms |
10768 KB |
wrong parameter |
20 |
Incorrect |
70 ms |
12628 KB |
wrong parameter |
21 |
Incorrect |
102 ms |
13452 KB |
wrong parameter |
22 |
Incorrect |
60 ms |
11568 KB |
wrong parameter |
23 |
Incorrect |
89 ms |
13596 KB |
wrong parameter |