Submission #1007217

#TimeUsernameProblemLanguageResultExecution timeMemory
1007217FaggiData Transfer (IOI19_transfer)C++17
5 / 100
425 ms4952 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...