# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007214 | 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 "transfer.h"#include <bits/stdc++.h>using namespace std;std::vector<int> get_attachment(std::vector<int> source) { vector<int>ret; for(auto k:source) ret.push_back(k); for(auto k:source) ret.push_back(k); return ret;}std::vector<int> retrieve(std::vector<int> data) { int dif=-1; vector<int>a,b,c,uc(2,0); for(int i=0; i<int(data.size())/3; i++) { a.push_back(data[i]); //cout << data[i]; } //cout << endl; for(int i=int(data.size())/3; i<int(data.size())-int(data.size())/3; i++) { b.push_back(data[i]); if(b[int(b.size())-1]!=a[int(b.size())-1]) { dif=int(b.size())-1; } //cout << data[i]; } //cout << endl; for(int i=int(data.size())-int(data.size())/3; i<int(data.size()); i++) { c.push_back(data[i]); if(c[int(c.size())-1]!=a[int(c.size())-1]) { dif=int(c.size())-1; } else if(c[int(c.size())-1]!=b[int(c.size())-1]) { dif=int(c.size())-1; } //cout << data[i]; } //cout << endl; if(dif==-1) return a; //cout << dif; uc[a[dif]]++; uc[b[dif]]++; uc[c[dif]]++; if(uc[0]>uc[1]) a[dif]=0; else a[dif]=1; //for(auto k:a) //cout << k; return a;}