Submission #224525

#TimeUsernameProblemLanguageResultExecution timeMemory
224525jhnah917Saveit (IOI10_saveit)C++14
50 / 100
363 ms14016 KiB
#include "grader.h" #include "encoder.h" #include <bits/stdc++.h> using namespace std; int dst[44][1010]; vector<int> g[1010]; void bfs(int st){ dst[st][st] = 0; queue<int> q; q.push(st); while(q.size()){ int now = q.front(); q.pop(); for(auto nxt : g[now]) if(dst[st][nxt] == -1){ dst[st][nxt] = dst[st][now] + 1; q.push(nxt); } } } void encode(int N, int H, int M, int *v1, int *v2){ // encode_bit(1); // encode_bit(0); // return; int n = N, m = M, h = H; for(int i=0; i<m; i++){ int s = v1[i] + 1, e = v2[i] + 1; g[s].push_back(e); g[e].push_back(s); } memset(dst, -1, sizeof dst); for(int i=1; i<=h; i++) bfs(i); for(int i=1; i<=h; i++) for(int j=1; j<=n; j++){ for(int k=0; k<10; k++) encode_bit(!!(dst[i][j] & (1 << k))); } } //g++ grader.h grader.cpp encoder.h encoder.cpp decoder.h decoder.cpp -o main -std=c++14
#include "grader.h" #include "decoder.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int H) { // int a = decode_bit(); // int b = decode_bit(); // hops(0,0,0); // hops(1,2,3); int n = N, h = H; for(int i=1; i<=h; i++) for(int j=1; j<=n; j++){ int t = 0; for(int k=0; k<10; k++) t += decode_bit() << k; hops(i-1, j-1, t); } } //g++ grader.h grader.cpp encoder.h encoder.cpp decoder.h decoder.cpp -o main -std=c++14
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...