이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |