Submission #151058

#TimeUsernameProblemLanguageResultExecution timeMemory
151058nekiData Transfer (IOI19_transfer)C++14
0 / 100
19 ms5604 KiB
#include "transfer.h" #include <bits/stdc++.h> #define loop(i, a, b) for(int i=a;i<b;i++) using namespace std; vector<int> get_attachment(vector<int> s) { int n=s.size(); vector<int> ans(n+9, 0); loop(i, 0, n){ int t=i; loop(j, 0, 8) ans[n+j]^=ans[i]&& (t&1), t>>=1; } loop(i, n, n+8) ans[n+9]^=ans[i]; return ans; } vector<int> retrieve(vector<int> d) { int n=d.size()-9, te=0, wr=0, fl=1; vector<int> ans, check(8, 0);loop(i, 0, n) ans[i]=d[i]; loop(i, n, n+8) te^=ans[i]; if(te!=ans[n+9]) return ans; loop(i, 0, n){ int t=i; loop(j, 0, 8) check[j]^=d[i]&& (t&1), t<<=1; } loop(i, 0, 8) if(check[i]!=ans[n+i]) wr+=(1<<i), fl=0; if(fl) return ans; ans[wr]=(!ans[wr]); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...