Submission #907119

#TimeUsernameProblemLanguageResultExecution timeMemory
907119vjudge1Xoractive (IZhO19_xoractive)C++17
100 / 100
4 ms600 KiB
#include <bits/stdc++.h> #include "interactive.h" namespace operators { template <typename T1, typename T2> std::istream &operator>>(std::istream &in, std::pair<T1, T2> &x) { in >> x.first >> x.second; return in; } template <typename T1, typename T2> std::ostream &operator<<(std::ostream &out, std::pair<T1, T2> x) { out << x.first << " " << x.second; return out; } template <typename T1> std::istream &operator>>(std::istream &in, std::vector<T1> &x) { for (auto &i : x) in >> i; return in; } template <typename T1> std::ostream &operator<<(std::ostream &out, std::vector<T1> &x) { for (auto &i : x) out << i << " "; return out; } template <typename T1> std::ostream &operator<<(std::ostream &out, std::set<T1> &x) { for (auto &i : x) out << i << " "; return out; } } // name spaces using namespace std; using namespace operators; #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) { if (!goodPoses[bit].size()) continue; 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 : x) cnt[el]--; for (auto el : y) { cnt[el]++; if (cnt[el] > 1) 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...