Submission #565107

#TimeUsernameProblemLanguageResultExecution timeMemory
565107DodoSaveit (IOI10_saveit)C++14
0 / 100
254 ms25332 KiB
#include <bits/stdc++.h> #include "grader.h" #include "encoder.h" #include "decoder.h" #define ll long long using namespace std; void encode(int nv, int nh, int ne, int *v1, int *v2) { map<pair<int,int>,bool>mp; for(int i=0;i<ne;i++) mp[{v1[i],v2[i]}]=1; for(int i=0;i<nh;i++) { for(int j=0;j<nv;j++) { if(mp[{i,j}]||mp[{j,i}])encode_bit(1); else encode_bit(0); } } return; }
#include <bits/stdc++.h> #include "grader.h" #include "encoder.h" #include "decoder.h" #define ll long long using namespace std; void decode(int nv, int nh) { vector<ll>v[nv]; for(int i=0;i<nh;i++) { for(int j=0;j<nv;j++) { int a = decode_bit(); if(a==1) { v[i].push_back(j); v[j].push_back(i); } } } for(int i=0;i<nh;i++) { deque<ll>q; ll vis[nv]={}; vis[i]=1; q.push_back(i); while(!q.empty()) { ll x=q.front(); q.pop_front(); for(auto u:v[x]) { if(vis[u]==0) { vis[u]=vis[x]+1; q.push_back(u); } } } for(int j=0;j<nv;j++) { hops(i,j,vis[j]-1); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...