# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007235 | Faggi | Data Transfer (IOI19_transfer) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>using namespace std;//0 par 1 imparstd::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;}