# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73993 | zubec | Saveit (IOI10_saveit) | C++14 | 371 ms | 14056 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "grader.h"
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
vector <int> g[1100];
int d[1100][1100];
void encode(int nv, int nh, int ne, int *v1, int *v2){
for (int i = 0; i < nv; i++)
g[i].clear();
for (int i = 0; i < ne; i++){
int a = v1[i], b = v2[i];
g[a].push_back(b);
g[b].push_back(a);
}
for (int i = 0; i < nh; i++){
for (int j = 0; j < nv; j++)
d[i][j] = 1e9;
d[i][i] = 0;
queue<int> q;
q.push(i);
while(!q.empty()){
int v = q.front();
q.pop();
for (int j = 0; j < g[v].size(); j++){
int to = g[v][j];
if (d[i][v] + 1 < d[i][to]){
d[i][to] = d[i][v] + 1;
q.push(to);
}
}
}
}
for (int i = 0; i < nh; i++){
for (int j = 0; j < nv; j++){
for (int k = 0; k < 10; k++){
if (d[i][j]&(1<<k))
encode_bit(1); else
encode_bit(0);
}
}
}
return;
}
#include "decoder.h"
#include "grader.h"
void decode(int nv, int nh) {
for (int i = 0; i < nh; i++){
for (int j = 0; j < nv; j++){
int sum = 0;
for (int k = 0; k < 10; k++){
sum += decode_bit()*(1<<k);
}
hops(i, j, sum);
}
}
}
Compilation message (stderr)
# | 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... |