이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "interactive.h"
//#include "grader.cpp"
using namespace std;
int i,j,p,q,n,m,k;
map <int,int> who;
multiset <int> turn(vector <int> v)
{
multiset <int> s;
for(auto iii:v)
s.insert(iii);
return s;
}
vector <int> guess(int n)
{
vector <int> ans(n);
int first_element = ask(1);
set <int> all;
for(int ii=0;ii<7;ii++)
{
vector <int> current;
for(j=2;j<=n;j++)
{
if(((1<<ii)&j))
current.push_back(j);
}
if(current.empty())
break;
multiset <int> s1 = turn(get_pairwise_xor(current));
current.push_back(1);
multiset <int> s2 = turn(get_pairwise_xor(current));
set <int> now;
for(auto i:s2)
{
if(s1.find(i)==s1.end())
now.insert(i);
}
for(auto i:now)
{
//cout<<ii<<" "<<(i^first_element)<<endl;
all.insert(i);
//cout<<all.size()<<endl;
who[i]|=(1<<ii);
}
}
for(auto i:all)
ans[who[i]-1] = (i^first_element);
ans[0] = first_element;
return ans;
}
/*
4
1 5 6 3
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |