# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565034 | almothana05 | Saveit (IOI10_saveit) | C++14 | 1026 ms | 13360 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 "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
int gr[1001][1001];
string bi(int x){
string cmp;
while(x){
if(x % 2 ==0){
cmp += '0';
}
else{
cmp += '1';
}
x /= 2;
}
while(cmp.size() < 10){
cmp += '0';
}
return cmp;
}
void encode(int nv, int nh, int ne, int *v1, int *v2){
string s;
for(int i = 0 ; i < 1001 ; i++){
for(int j = 0 ; j< 1001 ; j++){
gr[i][j] = 3000;
}
}
for(int i = 0 ; i < ne ; i++){
gr[v1[i]][v2[i]] = 1;
gr[v2[i]][v1[i]] = 1;
}
for(int k = 0 ; k < 1001 ; k++){
for(int i = 0 ; i < 1001 ; i++ ){
for(int j = 0 ; j < 1001 ; j++){
if(i == j){
gr[i][j] = 0;
continue;
}
if(gr[i][j] > gr[i][k] + gr[k][j]){
gr[i][j] = gr[i][k] + gr[k][j];
}
}
}
}
for(int i = 0 ; i < nh ; i++){
for(int j = 0 ; j < nv ; j++){
s = bi(gr[i][j]);
for(int k = 0 ; k < s.size() ; k++){
encode_bit(s[k] - '0');
}
}
}
// encode_bit(1);
// encode_bit(0);
return;
}
#include "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
void decode(int nv, int nh) {
int rechner = 0;
for(int i = 0 ; i < nh ; i++){
for(int j = 0 ; j < nv ; j++){
rechner = 0;
for(int k = 1; k < 1024 ; k *= 2){
rechner += k *decode_bit();
}
hops(i , j , rechner);
}
}
// hops(0,0,0);
// hops(1,2,3);
}
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... |