Submission #173015

#TimeUsernameProblemLanguageResultExecution timeMemory
173015abacabaXoractive (IZhO19_xoractive)C++14
100 / 100
7 ms400 KiB
#include <iostream> #include <string> #include <unordered_map> #include <unordered_set> #include <cstring> #include <chrono> #include "interactive.h" #include <vector> #include <map> #include <random> #include <set> #include <algorithm> #include <math.h> #include <cstdio> #include <stdio.h> #include <queue> #include <bitset> #include <cstdlib> #include <deque> #include <cassert> #include <stack> using namespace std; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define mp make_pair #define f first #define se second #define pb push_back #define ppb pop_back #define ll long long #define y1 abcde #define ull unsigned long long #define cntbit(x) __builtin_popcount(x) #define endl '\n' #define uset unordered_set #define umap unordered_map #define all(x) x.begin(), x.end() #define pii pair<int, int> #define ld long double #define pll pair<long long, long long> vector<int> guess(int n) { vector <int> ans(n); ans[0] = ask(1); map <int, int> ind = {}; for(int i = 0; i < 7; ++i) { vector <int> cur = {}; for(int j = 2; j <= n; ++j) if((1 << i) & j) cur.pb(j); if(cur.empty()) continue; vector <int> cur_with_known = cur; cur_with_known.pb(1); cur = get_pairwise_xor(cur); cur_with_known = get_pairwise_xor(cur_with_known); map <int, int> cnt = {}; for(int j : cur_with_known) if(j) ++cnt[j]; for(int j : cur) if(j) --cnt[j]; for(int j : cur_with_known) if(cnt[j]) ind[j ^ ans[0]] |= 1 << i; } for(pii x : ind) ans[x.se - 1] = x.f; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...