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 "grader.h"
bool solve(int xa, int ya, int xb, int yb, int dx, int dy, int v){
int x=xa, y=ya;
while(xa<=x-dx && x-dx<=xb) x-=dx;
while(ya<=y-dy && y-dy<=yb) y-=dy;
while(xa<=x && x<=xb && ya<=y && y<=yb){
int now = Measure(x,y);
if(now==v){ Pinpoint(x,y); return true; }
if(now<v) x+=dx;
if(now>v) y+=dy;
}
return false;
}
void Rescue(int R, int C, int RS, int CS, int X) {
solve(1,1,RS,CS,1,-1,X);
solve(1,CS,RS,C,1,1,X);
solve(RS,1,R,CS,-1,-1,X);
solve(RS,CS,R,C,-1,1,X);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |