#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;
ll anded = 0;
bool done = false;
ll one = 0;
FOR(i,0,10){
xored += (1-(sus[2*i] ^ sus[2*i+1])) * (1<<i);
anded += (sus[2*i] * (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;
}
}
if (!done){
return {anded, anded};
}
return {one, (xored^one)};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
2 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
3 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
4 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
5 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
6 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
7 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
8 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
9 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
10 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
11 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
12 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
13 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
14 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |
15 |
Correct |
1 ms |
344 KB |
Correct: 65 robot(s) used, 1 hour(s) passed |