# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
564985 | MrDeboo | 저장 (Saveit) (IOI10_saveit) | C++17 | 261 ms | 12452 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;
void encode(int n, int h, int p, int v1[], int v2[]){
vector<int>vct[n];
for(int i=0;i<p;i++){
vct[v1[i]].push_back(v2[i]);
vct[v2[i]].push_back(v1[i]);
}
int arr[h][n];
for(int i=0;i<h;i++){
deque<pair<int,int>>dq={{0,i}};
vector<bool>vis(n);
vis[i]=1;
while(dq.size()){
pair<int,int>p=dq.front();
dq.pop_front();
arr[i][p.second]=p.first;
for(auto &w:vct[p.second]){if(!vis[w]){dq.push_back({p.first+1,w});vis[w]=1;}}
}
}
for(int i=0;i<h;i++){
for(int w=0;w<n;w++){
for(int j=0;j<10;j++){
if(arr[i][w]&(1<<j))encode_bit(1);
else encode_bit(0);
}
}
# | 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... |