이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "interactive.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
vector<int> guess(int n) {
map <int,int> mp;
vector <int> ans(n);
ans[0] = ask(1);
for (int b = 0; b < 7; b++) {
vector <int> v;
for (int i = 2; i <= n; i++){
if (((i >> b) & 1)) v.pb(i);
}
if (!v.size()) continue;
vector <int> ans1 = get_pairwise_xor(v);
v.pb(1);
vector <int> ans2 = get_pairwise_xor(v);
multiset <int> st1,st2;
for (int x: ans1) st1.insert(x);
for (int x: ans2) st2.insert(x);
while (st1.size()){
st2.erase(st2.find(*st1.begin()));
st1.erase(st1.begin());
}
st2.erase(st2.find(0));
for (int x: st2){
mp[x ^ ans[0]] |= (1<<b);
}
}
for (auto [x,y]: mp)
ans[y - 1] = x;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |