///~~~LOTA~~~///
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
#define N 1000
void encode(int n,int m,int p,int a[],int b[]){
int o;
int d[m][n];
bool vis[n];
vector<int> e[n];
for(int i=0;i<m;i++){
e[a[i]].push_back(b[i]);
e[b[i]].push_back(a[i]);
}
for(int i=0;i<m;i++){
for(int j=o=0;j<n;j++)
vis[j]=1;
vector<int> u,v{i};
while(!v.empty()){
for(auto& j:v){
d[i][j]=o;
for(auto& k:e[j]){
if(vis[k])
u.push_back(k);
vis[k]=0;
}
}
o++;
v=u;
u.clear();
}
}
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
for(int k=512;k>0;k/=2){
if(d[i][j]>=k){
encode_bit(1);
d[i][j]-=k;
}
else encode_bit(0);
}
}
}
}
///~~~LOTA~~~///
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
#define N 1000
void decode(int n,int m){
int o;
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
o=0;
for(int k=512;k>0;k/=2){
if(decode_bit()) o+=k;
}
hops(i,j,o);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
150 ms |
17728 KB |
wrong parameter |
2 |
Incorrect |
2 ms |
11264 KB |
wrong parameter |
3 |
Incorrect |
47 ms |
15420 KB |
wrong parameter |
4 |
Incorrect |
2 ms |
11268 KB |
Output isn't correct |
5 |
Incorrect |
50 ms |
15712 KB |
wrong parameter |
6 |
Incorrect |
57 ms |
15712 KB |
wrong parameter |
7 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
8 |
Incorrect |
49 ms |
15444 KB |
wrong parameter |
9 |
Incorrect |
53 ms |
15580 KB |
wrong parameter |
10 |
Incorrect |
52 ms |
15432 KB |
wrong parameter |
11 |
Incorrect |
57 ms |
15504 KB |
wrong parameter |
12 |
Incorrect |
54 ms |
15440 KB |
wrong parameter |
13 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
14 |
Incorrect |
54 ms |
15232 KB |
wrong parameter |
15 |
Incorrect |
53 ms |
15432 KB |
wrong parameter |
16 |
Incorrect |
68 ms |
15716 KB |
wrong parameter |
17 |
Incorrect |
60 ms |
15964 KB |
wrong parameter |
18 |
Incorrect |
68 ms |
15580 KB |
wrong parameter |
19 |
Incorrect |
62 ms |
15708 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
17876 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
17952 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
16020 KB |
wrong parameter |
23 |
Incorrect |
84 ms |
17580 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
150 ms |
17728 KB |
wrong parameter |
2 |
Incorrect |
2 ms |
11264 KB |
wrong parameter |
3 |
Incorrect |
47 ms |
15420 KB |
wrong parameter |
4 |
Incorrect |
2 ms |
11268 KB |
Output isn't correct |
5 |
Incorrect |
50 ms |
15712 KB |
wrong parameter |
6 |
Incorrect |
57 ms |
15712 KB |
wrong parameter |
7 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
8 |
Incorrect |
49 ms |
15444 KB |
wrong parameter |
9 |
Incorrect |
53 ms |
15580 KB |
wrong parameter |
10 |
Incorrect |
52 ms |
15432 KB |
wrong parameter |
11 |
Incorrect |
57 ms |
15504 KB |
wrong parameter |
12 |
Incorrect |
54 ms |
15440 KB |
wrong parameter |
13 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
14 |
Incorrect |
54 ms |
15232 KB |
wrong parameter |
15 |
Incorrect |
53 ms |
15432 KB |
wrong parameter |
16 |
Incorrect |
68 ms |
15716 KB |
wrong parameter |
17 |
Incorrect |
60 ms |
15964 KB |
wrong parameter |
18 |
Incorrect |
68 ms |
15580 KB |
wrong parameter |
19 |
Incorrect |
62 ms |
15708 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
17876 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
17952 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
16020 KB |
wrong parameter |
23 |
Incorrect |
84 ms |
17580 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
150 ms |
17728 KB |
wrong parameter |
2 |
Incorrect |
2 ms |
11264 KB |
wrong parameter |
3 |
Incorrect |
47 ms |
15420 KB |
wrong parameter |
4 |
Incorrect |
2 ms |
11268 KB |
Output isn't correct |
5 |
Incorrect |
50 ms |
15712 KB |
wrong parameter |
6 |
Incorrect |
57 ms |
15712 KB |
wrong parameter |
7 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
8 |
Incorrect |
49 ms |
15444 KB |
wrong parameter |
9 |
Incorrect |
53 ms |
15580 KB |
wrong parameter |
10 |
Incorrect |
52 ms |
15432 KB |
wrong parameter |
11 |
Incorrect |
57 ms |
15504 KB |
wrong parameter |
12 |
Incorrect |
54 ms |
15440 KB |
wrong parameter |
13 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
14 |
Incorrect |
54 ms |
15232 KB |
wrong parameter |
15 |
Incorrect |
53 ms |
15432 KB |
wrong parameter |
16 |
Incorrect |
68 ms |
15716 KB |
wrong parameter |
17 |
Incorrect |
60 ms |
15964 KB |
wrong parameter |
18 |
Incorrect |
68 ms |
15580 KB |
wrong parameter |
19 |
Incorrect |
62 ms |
15708 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
17876 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
17952 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
16020 KB |
wrong parameter |
23 |
Incorrect |
84 ms |
17580 KB |
wrong parameter |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
150 ms |
17728 KB |
wrong parameter |
2 |
Incorrect |
2 ms |
11264 KB |
wrong parameter |
3 |
Incorrect |
47 ms |
15420 KB |
wrong parameter |
4 |
Incorrect |
2 ms |
11268 KB |
Output isn't correct |
5 |
Incorrect |
50 ms |
15712 KB |
wrong parameter |
6 |
Incorrect |
57 ms |
15712 KB |
wrong parameter |
7 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
8 |
Incorrect |
49 ms |
15444 KB |
wrong parameter |
9 |
Incorrect |
53 ms |
15580 KB |
wrong parameter |
10 |
Incorrect |
52 ms |
15432 KB |
wrong parameter |
11 |
Incorrect |
57 ms |
15504 KB |
wrong parameter |
12 |
Incorrect |
54 ms |
15440 KB |
wrong parameter |
13 |
Incorrect |
68 ms |
15688 KB |
wrong parameter |
14 |
Incorrect |
54 ms |
15232 KB |
wrong parameter |
15 |
Incorrect |
53 ms |
15432 KB |
wrong parameter |
16 |
Incorrect |
68 ms |
15716 KB |
wrong parameter |
17 |
Incorrect |
60 ms |
15964 KB |
wrong parameter |
18 |
Incorrect |
68 ms |
15580 KB |
wrong parameter |
19 |
Incorrect |
62 ms |
15708 KB |
wrong parameter |
20 |
Incorrect |
76 ms |
17876 KB |
wrong parameter |
21 |
Incorrect |
85 ms |
17952 KB |
wrong parameter |
22 |
Incorrect |
63 ms |
16020 KB |
wrong parameter |
23 |
Incorrect |
84 ms |
17580 KB |
wrong parameter |