#include "avoid.h"
#include <vector>
using namespace std;
const int N = 1000, L = 10;
typedef vector<int> vi;
typedef pair<int, int> pi;
pi scout(int q, int b) {
if (q == 10) {
for (int l = 0; l < L; l++) {
vi ii;
for (int i = 0; i < N; i++)
if ((i >> l & 1) != 0)
ii.push_back(i + 1);
send(ii);
}
vi cc = wait();
int i = 0;
for (int l = 0; l < L; l++)
if (cc[l])
i |= 1 << l;
return { i + 1, i + 1 };
} else if (q == 20) {
int lower = 0, upper = N;
while (upper - lower > 1) {
int m = (lower + upper) / 2;
vi ii;
for (int i = lower; i < m; i++)
ii.push_back(i + 1);
send(ii);
if (wait()[0])
upper = m;
else
lower = m;
}
int u = lower;
lower = 0, upper = N;
while (upper - lower > 1) {
int m = (lower + upper) / 2;
vi ii;
for (int i = lower; i < m; i++)
if (i != u)
ii.push_back(i + 1);
if (ii.size() == 0) {
lower = m;
continue;
}
send(ii);
if (wait()[0])
upper = m;
else
lower = m;
}
int v = lower;
return { u + 1, v + 1 };
} else {
return { -1, -1 };
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
2 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
3 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
4 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
5 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
6 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
7 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
8 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
9 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
10 |
Correct |
0 ms |
344 KB |
Correct: 10 robot(s) used, 1 hour(s) passed |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |