Submission #1007246

#TimeUsernameProblemLanguageResultExecution timeMemory
1007246FaggiData Transfer (IOI19_transfer)C++17
15 / 100
153 ms3172 KiB
#include <bits/stdc++.h> using namespace std; std::vector<int>get_attachment(std::vector<int> source) { vector<int>ret; int un=0; for(auto k:source) { if(k==1) un++; } for(auto k:source) ret.push_back(k); if(un%2==0) ret.push_back(0); else ret.push_back(1); return ret; } std::vector<int>retrieve(std::vector<int> data) { int bit, i, un=0; vector<int>a,b; bit=data[int(data.size())-1]; data.pop_back(); for(i=0; i<int(data.size())/2; i++) { a.push_back(data[i]); if(data[i]==1) un++; } if(un%2==0&&bit==0) return a; else if(un%2==1&&bit==1) return a; for(i=int(data.size())/2; i<int(data.size()); i++) { b.push_back(data[i]); } return b; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...