# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
202391 | 2020-02-16T02:56:31 Z | klungs | Xoractive (IZhO19_xoractive) | C++14 | 0 ms | 0 KB |
#include "interactive.h" #include <bits/stdc++.h> using namespace std; vector <int> ans; vector<int> contains(vector<int> q) { vector<int> qf = q; qf.push_back(1); auto res1 = get_pairwise_xor(qf); auto res2 = get_pairwise_xor(f); set<int> gg (res1.begin(), res1.end()); for (auto x : res2) gg.erase(res2); return vector<int>(gg.begin(), gg.end()); } vector<int> guess(int n) { ans.resize(n + 1); ans[1] = ask(1); vector<int> questions[7], answers[7]; for (int i = 2; i <= n; i++) { for (int j = 0; j < 7; j++) if ((1 << j) & i) { questions[j].push_back(i); } } map<int, int> id; for (int j = 0; j < 7; j++) { answers[j] = contains(questions[j]); for (int x : answers[j]) { id[x] ^= (1 << j); } } for (auto x : id) { ans[x.second] = x.first; } // for (int i = 1; i <= n; i++) { // int num = ask(i); // cnt[num]++; // ans.push_back(num); // // assert(cnt[num] <= 1); // } return ans; }