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