#include <bits/stdc++.h>
#include "encoder.h"
#include "grader.h"
#define maxn 1000
#define pb push_back
using namespace std;
int dist[maxn];
vector<int> adj[maxn];
void encode(int n, int h, int m, int *v1, int *v2) {
for( int i = 0 ; i < m ; i++ ) {
int u = v1[i] , v = v2[i];
adj[u].pb(v);
adj[v].pb(u);
}
for( int src = 0 ; src < n ; src++ ) {
queue<int> Q;
memset(dist,-1,sizeof(dist));
Q.push(src);
dist[src] = 0;
while(!Q.empty()) {
int u = Q.front();
Q.pop();
int deg = adj[u].size();
for( int i = 0 ; i < deg ; i++ ) {
int v = adj[u][i];
if(dist[v] == -1) {
Q.push(v);
dist[v] = dist[u]+1;
}
}
}
for( int i = 0 ; i < n ; i++ )
for( int j = 0 ; j < 10 ; j++ )
if(dist[i]&(1<<j))
encode_bit(1);
else
encode_bit(0);
}
}
#include <bits/stdc++.h>
#include "decoder.h"
#include "grader.h"
using namespace std;
void decode(int n, int h) {
for( int i = 0 ; i < h ; i++ )
for( int j = 0 ; j < n ; j++ ) {
int val = 0;
for( int k = 0 ; k < 10 ; k++ )
val |= (1<<decode_bit());
hops(i,j,val);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2818 ms |
88228 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4752 KB |
Output isn't correct |
3 |
Incorrect |
1685 ms |
68516 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
4744 KB |
Output isn't correct |
5 |
Incorrect |
1793 ms |
68584 KB |
Output isn't correct |
6 |
Incorrect |
2124 ms |
83772 KB |
Output isn't correct |
7 |
Incorrect |
2147 ms |
83856 KB |
Output isn't correct |
8 |
Incorrect |
1947 ms |
77448 KB |
Output isn't correct |
9 |
Incorrect |
2231 ms |
83508 KB |
Output isn't correct |
10 |
Incorrect |
2187 ms |
83372 KB |
Output isn't correct |
11 |
Incorrect |
2187 ms |
83672 KB |
Output isn't correct |
12 |
Incorrect |
2190 ms |
83296 KB |
Output isn't correct |
13 |
Incorrect |
2339 ms |
84092 KB |
Output isn't correct |
14 |
Incorrect |
2223 ms |
83556 KB |
Output isn't correct |
15 |
Incorrect |
2219 ms |
83436 KB |
Output isn't correct |
16 |
Incorrect |
2255 ms |
83948 KB |
Output isn't correct |
17 |
Incorrect |
2219 ms |
83944 KB |
Output isn't correct |
18 |
Incorrect |
2210 ms |
84272 KB |
Output isn't correct |
19 |
Incorrect |
2187 ms |
83700 KB |
Output isn't correct |
20 |
Incorrect |
2261 ms |
84432 KB |
Output isn't correct |
21 |
Incorrect |
2319 ms |
84596 KB |
Output isn't correct |
22 |
Incorrect |
2283 ms |
84220 KB |
Output isn't correct |
23 |
Incorrect |
2346 ms |
84796 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2818 ms |
88228 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4752 KB |
Output isn't correct |
3 |
Incorrect |
1685 ms |
68516 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
4744 KB |
Output isn't correct |
5 |
Incorrect |
1793 ms |
68584 KB |
Output isn't correct |
6 |
Incorrect |
2124 ms |
83772 KB |
Output isn't correct |
7 |
Incorrect |
2147 ms |
83856 KB |
Output isn't correct |
8 |
Incorrect |
1947 ms |
77448 KB |
Output isn't correct |
9 |
Incorrect |
2231 ms |
83508 KB |
Output isn't correct |
10 |
Incorrect |
2187 ms |
83372 KB |
Output isn't correct |
11 |
Incorrect |
2187 ms |
83672 KB |
Output isn't correct |
12 |
Incorrect |
2190 ms |
83296 KB |
Output isn't correct |
13 |
Incorrect |
2339 ms |
84092 KB |
Output isn't correct |
14 |
Incorrect |
2223 ms |
83556 KB |
Output isn't correct |
15 |
Incorrect |
2219 ms |
83436 KB |
Output isn't correct |
16 |
Incorrect |
2255 ms |
83948 KB |
Output isn't correct |
17 |
Incorrect |
2219 ms |
83944 KB |
Output isn't correct |
18 |
Incorrect |
2210 ms |
84272 KB |
Output isn't correct |
19 |
Incorrect |
2187 ms |
83700 KB |
Output isn't correct |
20 |
Incorrect |
2261 ms |
84432 KB |
Output isn't correct |
21 |
Incorrect |
2319 ms |
84596 KB |
Output isn't correct |
22 |
Incorrect |
2283 ms |
84220 KB |
Output isn't correct |
23 |
Incorrect |
2346 ms |
84796 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2818 ms |
88228 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4752 KB |
Output isn't correct |
3 |
Incorrect |
1685 ms |
68516 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
4744 KB |
Output isn't correct |
5 |
Incorrect |
1793 ms |
68584 KB |
Output isn't correct |
6 |
Incorrect |
2124 ms |
83772 KB |
Output isn't correct |
7 |
Incorrect |
2147 ms |
83856 KB |
Output isn't correct |
8 |
Incorrect |
1947 ms |
77448 KB |
Output isn't correct |
9 |
Incorrect |
2231 ms |
83508 KB |
Output isn't correct |
10 |
Incorrect |
2187 ms |
83372 KB |
Output isn't correct |
11 |
Incorrect |
2187 ms |
83672 KB |
Output isn't correct |
12 |
Incorrect |
2190 ms |
83296 KB |
Output isn't correct |
13 |
Incorrect |
2339 ms |
84092 KB |
Output isn't correct |
14 |
Incorrect |
2223 ms |
83556 KB |
Output isn't correct |
15 |
Incorrect |
2219 ms |
83436 KB |
Output isn't correct |
16 |
Incorrect |
2255 ms |
83948 KB |
Output isn't correct |
17 |
Incorrect |
2219 ms |
83944 KB |
Output isn't correct |
18 |
Incorrect |
2210 ms |
84272 KB |
Output isn't correct |
19 |
Incorrect |
2187 ms |
83700 KB |
Output isn't correct |
20 |
Incorrect |
2261 ms |
84432 KB |
Output isn't correct |
21 |
Incorrect |
2319 ms |
84596 KB |
Output isn't correct |
22 |
Incorrect |
2283 ms |
84220 KB |
Output isn't correct |
23 |
Incorrect |
2346 ms |
84796 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2818 ms |
88228 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4752 KB |
Output isn't correct |
3 |
Incorrect |
1685 ms |
68516 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
4744 KB |
Output isn't correct |
5 |
Incorrect |
1793 ms |
68584 KB |
Output isn't correct |
6 |
Incorrect |
2124 ms |
83772 KB |
Output isn't correct |
7 |
Incorrect |
2147 ms |
83856 KB |
Output isn't correct |
8 |
Incorrect |
1947 ms |
77448 KB |
Output isn't correct |
9 |
Incorrect |
2231 ms |
83508 KB |
Output isn't correct |
10 |
Incorrect |
2187 ms |
83372 KB |
Output isn't correct |
11 |
Incorrect |
2187 ms |
83672 KB |
Output isn't correct |
12 |
Incorrect |
2190 ms |
83296 KB |
Output isn't correct |
13 |
Incorrect |
2339 ms |
84092 KB |
Output isn't correct |
14 |
Incorrect |
2223 ms |
83556 KB |
Output isn't correct |
15 |
Incorrect |
2219 ms |
83436 KB |
Output isn't correct |
16 |
Incorrect |
2255 ms |
83948 KB |
Output isn't correct |
17 |
Incorrect |
2219 ms |
83944 KB |
Output isn't correct |
18 |
Incorrect |
2210 ms |
84272 KB |
Output isn't correct |
19 |
Incorrect |
2187 ms |
83700 KB |
Output isn't correct |
20 |
Incorrect |
2261 ms |
84432 KB |
Output isn't correct |
21 |
Incorrect |
2319 ms |
84596 KB |
Output isn't correct |
22 |
Incorrect |
2283 ms |
84220 KB |
Output isn't correct |
23 |
Incorrect |
2346 ms |
84796 KB |
Output isn't correct |