# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
173317 | 2020-01-03T18:32:41 Z | GoldeN | Xoractive (IZhO19_xoractive) | C++17 | 0 ms | 0 KB |
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define f first #define s second #define pb push_back #define all(a) a.begin(),a.end() typedef long long ll; typedef long double ld; typedef pair <int,int> pii; typedef pair <ll,ll> pll; typedef vector <ll> vl; typedef vector <int> vi; typedef vector <bool> vb; typedef vector <vector <int> > vvi; typedef vector <vector <ll> > vvl; typedef vector <pair<int,int> > vii; typedef vector <pair<ll,ll> > vll; string itos(int n) {stringstream ss;ss<<n;string s=ss.str();return s;} vi guess(int n) { vi ans(n); ans[0]=ask(1); map<int,int> check; for (int ind=0;ind<7;++ind) { vi cur; for (int i=1;i<=n;++i) { if (i&(1<<ind)) { cur.pb(i); } } vi a=get_pairwise_xor(cur); cur.pb(ans[0]); vi b=get_pairwise_xor(cur); map<int,int> cnt; for (int i : b) { cnt[i]++: } for (int i : a) cnt[i]--; for (auto i : cnt) { if (i.f && i.s) { check[i.f^ans[0]]|=(1<<ind); } } } for (auto i : check) { ans[i.s-1]=i.f; } return ans; }