Submission #899191

#TimeUsernameProblemLanguageResultExecution timeMemory
899191MackerSaveit (IOI10_saveit)C++17
0 / 100
149 ms11956 KiB
#include <bits/stdc++.h> #include "grader.h" #include "encoder.h" using namespace std; void encode(int nv, int nh, int ne, int *v1, int *v2){ vector<vector<int>> adj(nv); for (int i = 0; i < ne; i++) { adj[v1[i]].push_back(v2[i]); adj[v2[i]].push_back(v1[i]); } for (int i = 0; i < nh; i++) { queue<int> q({i}); vector<int> dist(nv, INT_MAX); dist[i] = 0; while(q.size()){ int a = q.front(); q.pop(); for (auto &b : adj[a]) { if(dist[b] > dist[a] + 1){ dist[b] = dist[a] + 1; q.push(b); } } } for (int i = 0; i < nv; i++) { for (int b = 0; b < 9; b++) { encode_bit((int)(dist[i] & (1 << b))); } } } return; }
#include "grader.h" #include "decoder.h" #include <bits/stdc++.h> using namespace std; void decode(int nv, int nh) { for (int i = 0; i < nh; i++){ for (int j = 0; j < nv; j++) { int res = 0; for (int k = 0, x = 1; k < 9; k++, x *= 2) { if(decode_bit()){ res += x; } } hops(i, j, res); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...