이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "interactive.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> guess(int n) {
vector<int> ans;
if(n<15){
for(int i=1;i<=n;i++){
ans.push_back(ask(i));
}return ans;
} int tem=ask(1);
map<int,int> mp;
for(int i=0;i<7;i++){
vector<int> t;
for(int j=1;j<n;j++){
if(j>>i & 1) t.push_back(j+1);
}
vector<int> a=get_pairwise_xor(t);
t.push_back(1);
vector<int> b=get_pairwise_xor(t);
map<int,int> m;
for(auto u:a) m[u]--;
for(auto u:b) m[u]++;
for(auto u:m){
if(u.second>0) mp[u.first^tem]+=(1<<i);
}
}vector<int> ans2(n);
ans[0]=tem;
for(auto u:mp) if(u.second<n) ans2[u.second]=u.first;
return ans2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |