Submission #151290

#TimeUsernameProblemLanguageResultExecution timeMemory
151290theboatmanXoractive (IZhO19_xoractive)C++17
6 / 100
3029 ms632 KiB
#include <bits/stdc++.h> #include "interactive.h" #define y1 theboatman #define make_struct(args...) {args} using namespace std; typedef long long ll; const long long INF = 1e18 + 10; const int inf = 1e9 + 10; const int N = 1e6 + 10; //vector <int> get_pairwise_xor(vector <int> a) { // return vector <int> (3); //} // //int ask(int pos) { // return pos; //} vector <int> guess(int n) { vector <int> ans(n); ans[0] = ask(1); vector <int> b, b1; for(int i = 1; i <= n; i++) { b.push_back(i); if (i != 1) { b1.push_back(i); } } map <int, int> cnt; for(auto i : get_pairwise_xor(b)) { cnt[i]++; } for(auto i : get_pairwise_xor(b1)) { cnt[i]--; } vector <int> vals; for(auto i : cnt) { if (i.second) { vals.push_back(i.first); } } int now = 1; while(now + 3 < n) { vector <int> c, c1; c.push_back(now); c.push_back(now + 1); c1.push_back(now + 1); c1.push_back(now + 2); vector <int> kek = get_pairwise_xor(c); vector <int> kek1 = get_pairwise_xor(c); int flag = 0; for(auto x : vals) { if (flag) { break; } for(auto y : vals) { if (flag) { break; } for(auto z : vals) { vector <int> first; first.push_back(x ^ x); first.push_back(x ^ y); first.push_back(x ^ y); first.push_back(y ^ y); vector <int> second; second.push_back(y ^ y); second.push_back(y ^ z); second.push_back(y ^ z); second.push_back(z ^ z); sort(first.begin(), first.end()); sort(second.begin(), second.end()); if (first == kek && second == kek1) { ans[now++] = x; ans[now++] = y; ans[now++] = z; flag = 1; break; } } } } } while(now < n) { ans[now] = ask(now + 1); now++; } return ans; } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...