Submission #907099

#TimeUsernameProblemLanguageResultExecution timeMemory
907099vjudge1Xoractive (IZhO19_xoractive)C++17
0 / 100
4 ms600 KiB
#include <bits/stdc++.h> #include "interactive.h" using namespace std; #define ll long long #define ull unsigned long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define f first #define s second #define uint unsigned int #define all(vc) vc.begin(), vc.end() vector<int> guess(int n) { vector<int> ans; ans.resize(n); ans[0] = ask(1); vector<vector<int>> goodPoses(7); for (int i = 1; i < n; ++i) for (int bit = 0; bit < 7; ++bit) if (i & (1 << bit)) goodPoses[bit].pb(i + 1); map<int, int> poses; for (int bit = 0; bit < 7; ++bit) { vector<int> x = get_pairwise_xor(goodPoses[bit]); goodPoses[bit].pb(1); vector<int> y = get_pairwise_xor(goodPoses[bit]); map<int, int> cnt; cnt[0]--; for (auto el : y) cnt[el]--; vector<int> vals; for (auto el : x) { cnt[el]++; if (cnt[el]) poses[el ^ ans[0]] += (1 << bit); } } for (auto [v, pos] : poses) ans[pos] = v; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...