Submission #995385

#TimeUsernameProblemLanguageResultExecution timeMemory
995385BorsData Transfer (IOI19_transfer)C++17
100 / 100
189 ms2756 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...