# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
526615 | peuch | Xoractive (IZhO19_xoractive) | C++11 | 3 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "interactive.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> guess(int n) {
vector<int> ans(n);
map<int, int> id;
ans[n - 1] = ask(n);
for(int i = 0; i < 7; i++){
vector<int> qry;
for(int j = 1; j < n; j++)
if((1 << i) & j) qry.push_back(j);
if(qry.empty()) continue;
qry.push_back(n);
vector<int> p1 = get_pairwise_xor(qry);
qry.pop_back();
vector<int> p2 = get_pairwise_xor(qry);
int it = p1.size() - 1;
while(!p2.empty()){
if(p1[it] == p2.back()){
swap(p1[it], p1[p1.size() - 1]);
p1.pop_back();
p2.pop_back();
}
it--;
}
for(int j = 1; j < p1.size(); j++)
id[p1[j] ^ ans[n - 1]] |= (1 << i);
}
map<int, int> :: iterator it;
for(it = id.begin(); it != id.end(); it++)
ans[it->second - 1] = it->first;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |