Submission #623001

#TimeUsernameProblemLanguageResultExecution timeMemory
623001ziduoXoractive (IZhO19_xoractive)C++14
100 / 100
3 ms384 KiB
#include "interactive.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define size(x) (int)x.size() vector<int> guess(int n) { vector<int> ans(n); ans[0] = ask(1); map<int, int> pos; for (int i = 0; i < 7; ++i) { vector<int> v; for (int mask = 2; mask <= n; ++mask) if (mask >> i & 1) v.pb(mask); if (v.empty()) continue; vector<int> v1 = get_pairwise_xor(v); v.pb(1); vector<int> v2 = get_pairwise_xor(v); vector<int> v3; for (int i = 0, j = 0; j < size(v2);) { if (i < size(v1) && v1[i] == v2[j]) ++i, ++j; else v3.pb(v2[j++]); } for (int j = 1; j < size(v3); j += 2) pos[v3[j] ^ ans[0]] += (1 << i); } for (auto [x, y] : pos) ans[y-1] = x; return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:39:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   39 |  for (auto [x, y] : pos)
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...