#include "grader.h"
#include "encoder.h"
#include<cstdio>
int xz[1001][1001];
void encode(int nv, int nh, int ne, int *v1, int *v2){
for(int i = 0; i < ne; i++) {
xz[v1[i]][v2[i]] = 1;
xz[v2[i]][v1[i]] = 1;
}
for(int i = 0; i < nv; i++) {
for(int j = 0; j < nv; j++) {
encode_bit(xz[i][j]);
}
}
return;
}
#include "grader.h"
#include "decoder.h"
#include<queue>
using namespace std;
int x[1001][1001];
int dist[1001];
bool v[1001];
int _nv;
void bfs(int s) {
queue<int> q;
q.push(s);
dist[s] = 0;
v[s] = true;
while (!q.empty()) {
int p = q.front();
q.pop();
v[p] = true;
for(int j = 0; j < _nv; j++) {
if(x[p][j] && !v[j]) {
v[j] = true;
dist[j] = dist[p]+1;
q.push(j);
}
}
}
}
void decode(int nv, int nh) {
_nv = nv;
for(int i = 0; i < nv; i++) {
for(int j = 0; j < nv; j++) {
x[i][j] = decode_bit();
}
}
for(int i = 0; i < nh; i++) {
for(int j = 0; j < nv; j++) {
dist[j] = 100000;
v[j] = false;
}
bfs(i);
for(int j = 0; j < nv; j++) {
hops(i,j,dist[j]);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
468 ms |
22180 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
3 |
Correct |
192 ms |
18064 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Correct |
206 ms |
18128 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
6 |
Correct |
235 ms |
20404 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
7 |
Correct |
262 ms |
20728 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
8 |
Correct |
207 ms |
19312 KB |
Output is partially correct - 923521 call(s) of encode_bit() |
9 |
Correct |
257 ms |
20208 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
10 |
Correct |
226 ms |
20136 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
11 |
Correct |
233 ms |
20300 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
12 |
Correct |
234 ms |
20132 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
13 |
Correct |
268 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
14 |
Correct |
229 ms |
20352 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
15 |
Correct |
225 ms |
20316 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
16 |
Correct |
303 ms |
20548 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
17 |
Correct |
278 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
18 |
Correct |
286 ms |
20636 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
19 |
Correct |
253 ms |
20376 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
20 |
Correct |
294 ms |
20712 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
21 |
Correct |
324 ms |
20732 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
22 |
Correct |
255 ms |
20544 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
23 |
Correct |
302 ms |
20820 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
468 ms |
22180 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
3 |
Correct |
192 ms |
18064 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Correct |
206 ms |
18128 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
6 |
Correct |
235 ms |
20404 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
7 |
Correct |
262 ms |
20728 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
8 |
Correct |
207 ms |
19312 KB |
Output is partially correct - 923521 call(s) of encode_bit() |
9 |
Correct |
257 ms |
20208 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
10 |
Correct |
226 ms |
20136 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
11 |
Correct |
233 ms |
20300 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
12 |
Correct |
234 ms |
20132 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
13 |
Correct |
268 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
14 |
Correct |
229 ms |
20352 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
15 |
Correct |
225 ms |
20316 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
16 |
Correct |
303 ms |
20548 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
17 |
Correct |
278 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
18 |
Correct |
286 ms |
20636 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
19 |
Correct |
253 ms |
20376 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
20 |
Correct |
294 ms |
20712 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
21 |
Correct |
324 ms |
20732 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
22 |
Correct |
255 ms |
20544 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
23 |
Correct |
302 ms |
20820 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
468 ms |
22180 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
3 |
Correct |
192 ms |
18064 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Correct |
206 ms |
18128 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
6 |
Correct |
235 ms |
20404 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
7 |
Correct |
262 ms |
20728 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
8 |
Correct |
207 ms |
19312 KB |
Output is partially correct - 923521 call(s) of encode_bit() |
9 |
Correct |
257 ms |
20208 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
10 |
Correct |
226 ms |
20136 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
11 |
Correct |
233 ms |
20300 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
12 |
Correct |
234 ms |
20132 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
13 |
Correct |
268 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
14 |
Correct |
229 ms |
20352 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
15 |
Correct |
225 ms |
20316 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
16 |
Correct |
303 ms |
20548 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
17 |
Correct |
278 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
18 |
Correct |
286 ms |
20636 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
19 |
Correct |
253 ms |
20376 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
20 |
Correct |
294 ms |
20712 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
21 |
Correct |
324 ms |
20732 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
22 |
Correct |
255 ms |
20544 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
23 |
Correct |
302 ms |
20820 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
468 ms |
22180 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
2 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
3 |
Correct |
192 ms |
18064 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
4 |
Correct |
2 ms |
4608 KB |
Output is correct - 25 call(s) of encode_bit() |
5 |
Correct |
206 ms |
18128 KB |
Output is partially correct - 810000 call(s) of encode_bit() |
6 |
Correct |
235 ms |
20404 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
7 |
Correct |
262 ms |
20728 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
8 |
Correct |
207 ms |
19312 KB |
Output is partially correct - 923521 call(s) of encode_bit() |
9 |
Correct |
257 ms |
20208 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
10 |
Correct |
226 ms |
20136 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
11 |
Correct |
233 ms |
20300 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
12 |
Correct |
234 ms |
20132 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
13 |
Correct |
268 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
14 |
Correct |
229 ms |
20352 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
15 |
Correct |
225 ms |
20316 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
16 |
Correct |
303 ms |
20548 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
17 |
Correct |
278 ms |
20528 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
18 |
Correct |
286 ms |
20636 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
19 |
Correct |
253 ms |
20376 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
20 |
Correct |
294 ms |
20712 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
21 |
Correct |
324 ms |
20732 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
22 |
Correct |
255 ms |
20544 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |
23 |
Correct |
302 ms |
20820 KB |
Output is partially correct - 1000000 call(s) of encode_bit() |