Submission #676046

#TimeUsernameProblemLanguageResultExecution timeMemory
676046pirhosigData Transfer (IOI19_transfer)C++17
100 / 100
87 ms2500 KiB
#include "transfer.h" #include <bits/stdc++.h> #define R(a) for (int i = 0; i < a; ++i) using namespace std; vector<int> get_attachment(vector<int> source) { int chk = 0; R((int)source.size()) if (source[i]) chk ^= (i + 1); if (source.size() == 63) { vector<int> ret(7); R(6) ret[i] = (chk >> i) & 1; R(6) ret[6] ^= ret[i]; return ret; } vector<int> ret(9); R(8) ret[i] = (chk >> i) & 1; R(8) ret[8] ^= ret[i]; return ret; } vector<int> retrieve(vector<int> data) { if (data.size() <= 70) { int fck = 0; R(6) fck ^= data[data.size() - 7 + i]; if (fck != data[data.size() - 1]) return vector<int>(data.begin(), data.end()-7); int chk = 0; R((int)data.size() - 7) if (data[i]) chk ^= (i + 1); int ick = 0; R(6) ick += (data[data.size() - 7 + i] << i); int diff = chk ^ ick; if (diff) data[diff - 1] ^= 1; return vector<int>(data.begin(), data.end()-7); } int fck = 0; R(8) fck ^= data[data.size() - 9 + i]; if (fck != data[data.size() - 1]) return vector<int>(data.begin(), data.end()-9); int chk = 0; R((int)data.size() - 9) if (data[i]) chk ^= (i + 1); int ick = 0; R(8) ick += (data[data.size() - 9 + i] << i); int diff = chk ^ ick; if (diff) data[diff - 1] ^= 1; return vector<int>(data.begin(), data.end()-9); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...