#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;
std::pair<int, int> scout(int R, int H) {
int a=0, b=0;
for(int s=1, e=1000; s<=e; ) {
int m=(s+e)/2;
vector<int> t;
for(int i=s; i<=m; i++) t.push_back(i);
send(t);
if(wait()[0]) a=m, e=m-1;
else s=m+1;
}
for(int s=1, e=1000; s<=e; ) {
int m=(s+e)/2;
vector<int> t;
for(int i=s; i<=m; i++) if(i!=a) t.push_back(i);
if(t.empty()) s=m;
else {
send(t);
if(wait()[0]) b=m, e=m-1;
else s=m+1;
}
}
if(!b) b=a;
return {a, b};
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
2 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
3 |
Correct |
0 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
4 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
5 |
Correct |
0 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
6 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
7 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
8 |
Correct |
1 ms |
344 KB |
Correct: 19 robot(s) used, 19 hour(s) passed |
9 |
Correct |
0 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
10 |
Correct |
1 ms |
596 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
11 |
Correct |
1 ms |
344 KB |
Correct: 20 robot(s) used, 20 hour(s) passed |
12 |
Execution timed out |
3084 ms |
348 KB |
Time limit exceeded |
13 |
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 |
- |