Submission #107432

#TimeUsernameProblemLanguageResultExecution timeMemory
107432Diuven산악 구조대 (JOI13_mountain)C++14
100 / 100
18 ms896 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...