This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "avoid.h"
#include <vector>
#include <bits/stdc++.h>
typedef int ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
using namespace std;
map<vector<ll>, ll> pos;
std::pair<int, int> scout(int R, int H) {
FOR(i,0,10){
vector<ll> temp;
FOR(j,1,1001){
if (j&(1<<i)) temp.push_back(j);
}
send(temp);
temp.clear();
FOR(j,1,1001){
if (!(j&(1<<i))) temp.push_back(j);
}
send(temp);
}
ll cnt = 20;
FOR(i,0,10){
FOR(j,i+1,10){
vector<ll> temp;
FOR(k,1,1001){
if ((k & (1<<i)) && (k&(1<<j))){
temp.push_back(k);
}
}
send(temp);
temp.clear();
pos[{i,j}] = cnt++;
}
}
vector<ll>sus = wait();
ll xored = 0;
bool done = false;
ll one = 0;
FOR(i,0,10){
xored += (1-(sus[2*i] ^ sus[2*i+1])) * (1<<i);
if (sus[2*i]==1 && sus[2*i+1]==1 && !done){
one += (1<<i);
FOR(j,0,10){
if (i==j) continue;
ll a = i;
ll b = j;
if (a>b) swap(a,b);
if (sus[pos[{a,b}]]) one += (1<<j);
}
done = 1;
}
}
return {one, (xored^one)};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |