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