# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1061162 | boyliguanhan | Data Transfer (IOI19_transfer) | C++17 | 43 ms | 2524 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"
using namespace std;
vector<int> get_attachment(vector<int> source) {
vector<int>stuf;
int n=source.size(),xorr=0,K=0;
for(int i=0;i<n;i++)
xorr^=source[i]*(i+1),K+=source[i];
vector<int>res;
res.push_back(K&1);
if(n<64)for(int i=6;i--;)
res.push_back(xorr>>i&1);
else for(int i=8;i--;)
res.push_back(xorr>>i&1);
return res;
}
std::vector<int> retrieve(std::vector<int> data) {
int n=data.size()-7;
if(data.size()>70)n-=2;
vector<int>firstcup;
int xorr=0,K=0;
for(int i=0;i<n;i++)
xorr^=data[i]*(i+1),K+=data[i],
firstcup.push_back(data[i]);
K&=1;
int failodd=data[n]!=K;
int xorgiv=0;
for(int i=n+1;i<data.size();i++)
xorgiv=xorgiv<<1|data[i];
if(failodd&&xorgiv^xorr)
firstcup[(xorgiv^xorr)-1]^=1;
return firstcup;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |