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;
#define rep(i,n) for(int i=0; i<n; i++)
#define range(v,l,r) v.begin()+l,v.begin()+r
typedef vector<int> vi;
vi get_attachment(vi source){
int n=source.size(),k=(n>200 ? 8:6);
vi v(k+1,0);
rep(i,n) rep(j,k) if((i+1)&(1<<j)) v[j]^=source[i];
rep(i,n) v[k]^=source[i];
return v;
}
vi retrieve(vi data){
int n=(data.size()>200 ? 255:63),
k=(n==255?8:6);
vi v(k,0);
rep(i,n) rep(j,k) if((i+1)&(1<<j)) v[j]^=data[i];
int x=0;
rep(i,n) x^=data[i];
if(x!=data[n+k] and v!=vi(range(data,n,n+k))){
x=0;
rep(i,k) if(v[i]^data[i+n]) x^=(1<<i);
data[--x]^=1;
}
return vi(range(data,0,n));
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |