Submission #1006157

#TimeUsernameProblemLanguageResultExecution timeMemory
1006157AlmontherData Transfer (IOI19_transfer)C++17
0 / 100
2 ms1048 KiB
#include <bits/stdc++.h> #define ll long long #define co cout<< //#pragma GCC optimize("O3,Ofast,unroll-loops") //#pragma GCC target("avx2,sse3,sse4,avx") using namespace std; //stuff vector<int>get_attachment(vector<int>source){ vector<int>arr=source; ll n=arr.size(); ll num=0; ll pa=0; for(int i=0;i<n;i++){ pa^=source[i]; num^=((source[i])?i+1:0); } for(int i=n+8;i>=n;i--){ arr.push_back(num&(i-n)); } arr.push_back(pa); return arr; } vector<int>retrieve(vector<int>data){ vector<int>arr=data; ll n=arr.size(); ll pa,pa1,num; pa=0,pa1=0,num=0; ll test=arr[n-1]; vector<int>ans; for(int i=n-9;i<n-1;i++) num=num*2+arr[i]; for(int i=0;i<n-9;i++){ pa^=arr[i]; num^=((arr[i])?i:0); } pa1=pa; if(num){ if(arr[num-1]) pa1--; else pa1++; if(pa1==test){ for(int i=0;i<255;i++){ ans.push_back(arr[i]); } ans[num]^=1; return ans; } else{ for(int i=0;i<255;i++){ ans.push_back(arr[i]); } return ans; } } else{ for(int i=0;i<255;i++){ ans.push_back(arr[i]); } return ans; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...