# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
328368 | 2020-11-16T10:08:33 Z | Sho10 | Xoractive (IZhO19_xoractive) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10 #include "interactive.h" #define ll long long #define double long double #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #define all(a) (a).begin(), (a).end() #define f first #define s second #define pb push_back #define mp make_pair #define pi pair #define rc(s) return cout<<s,0 #define endl '\n' #define mod (10*10*10*10*10*10*10*10*10+7) #define PI 3.14159265359 #define MAXN 100005 #define INF 1000000005 #define LINF 1000000000000000005ll #define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; vector<int>res[105]; int a[105]; set<int>s,ss[105]; void calc(int pos){ vector<int>x,y; x=get_pairwise_xor(res[pos]); res[pos].pb(1); y=get_pairwise_xor(res[pos]); for(auto it : x){ y.erase(y.find(it)); } for(auto it : y){ s.insert(it^ans[0]); ss[pos].insert(it^ans[0]); } } vector<int> guess(int n){ vector<int>ans; ans.pb(ask(1)); for(ll i=2;i<=n;i++) { for(ll j=0;j<=6;j++) { if(i&(1<<j)){ res[j].pb(i); } } } for(ll i=0;i<7;i++) { if(res[i].size()){ calc(i); } } for(auto it : s){ ll pos=0; for(ll i=0;i<7;i++) { if(ss[i].find(it)!=ss[i].end()){ pos^=(1<<i); } } a[pos]=it; } for(ll i=2;i<=n;i++) { ans.pb(a[i]); } return ans; } /* int32_t main(){ CODE_START; */