Submission #1096793

#TimeUsernameProblemLanguageResultExecution timeMemory
1096793KasymKXoractive (IZhO19_xoractive)C++17
0 / 100
1 ms344 KiB
#include "bits/stdc++.h" #include "interactive.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define pli pair<ll, int> #define pll pair<ll, ll> #define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i) #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} vector<int> guess(int n){ vector<int> answer; for(int ad = 1; ad <= n; ++ad){ vector<int> A; int ad2; for(ad2 = ad; ad2 <= ad+4; ++ad2) A.pb(ad2); ad = ad2; A = get_pairwise_xor(A); assert((int)A.size() == 16); int a = ask(ad); vector<int> check, same; for(int mk = 0; mk < (1<<16); ++mk){ int cnt = __builtin_popcount(mk); if(cnt != 4) continue; for(int i = 0; i < 16; ++i) if(mk>>i&1) check.pb(A[i]); assert((int)check.size() == 4); for(int i = 0; i < 4; ++i){ int x = a^check[i]; check[i] = x; } for(int i = 0; i < 4; ++i) for(int j = 0; j < 4; ++j) same.pb(check[i]^check[j]); assert((int)same.size() == 16); if(same == A){ for(int i = 0; i < 4; ++i) answer.pb(check[i]); break; } same.clear(), check.clear(); } } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...