# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781991 | Dan4Life | Data Transfer (IOI19_transfer) | C++17 | 4 ms | 2488 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;
using vi = vector<int>;
#define sz(a) (int)a.size()
vi get_attachment(vi v) {
int x = 0, y = 0, m = sz(v)<99?6:8; vi ans;
for(int i = 0; i < sz(v); i++) if(v[i]) x^=i+1;
for(int i = 0; i < m; i++)
ans.push_back((x>>i)&1), y^=ans.back();
ans.push_back(y); return ans;
}
vi retrieve(vi v){
int x = 0, xx = 0, y = 0, m = sz(v)<99?6:8, n=sz(v)<99?63:255;
for(int i = 0; i < n; i++) if(v[i]) x^=i+1;
for(int i = 0; i < m; i++) if(v[n+i]) xx^=1<<i, y^=1;
if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |