이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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]);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |