# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
533166 |
2022-03-05T03:59:39 Z |
huangqr |
Aliens (IOI07_aliens) |
C++14 |
|
2 ms |
456 KB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
typedef pair<ll,pl> ppl;
const ll lim=2e5+5;
inline bool query(ll x,ll y){
cout<<"examine "<<x<<" "<<y<<"\n";
cout.flush();
string s;
cin>>s;
return (s=="true");
}
int main(){
ios_base::sync_with_stdio(0),cin.tie(NULL);
ll n,x,y;
cin>>n>>x>>y;
int dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
ll dist[4]={n-x,x-1,n-y,y-1},tsa[4];
for(int i=0;i<4;i++){
ll left = 0, right = dist[i], best = 0; //Binary search for the largest value that is red. Some modifications due to checkerboard
bool vroomed=0;
while(left<=right){
ll mid = (left+right)/2;
if(query(x + mid * dx[i], y + mid * dy[i])){
if(vroomed){
best = max(best, mid);
left = mid + 1;
}
else{
if(query(x + (mid/2) * dx[i], y + (mid/2) * dy[i])){
if(query(x + (mid/4) * dx[i], y + (mid/4) * dy[i])){
left = mid + 1;
}
else{
right = (mid/4) - 1;
}
}
else{
right = (mid/2) - 1;
}
vroomed = true;
}
}
else{
right = mid - 1;
}
if(i<2)tsa[i]=x+dx[i]*best;
else tsa[i]=y+dy[i]*best;
}
}
//cout<<"\n\n";
//for(int i=0;i<4;i++)cout<<tsa[i]<<" ";
assert(tsa[1]-tsa[0]==tsa[3]-tsa[2]);
cout<<"solution 1 1\n";
cout.flush();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |