Submission #165817

#TimeUsernameProblemLanguageResultExecution timeMemory
165817mathking1021산악 구조대 (JOI13_mountain)C++11
100 / 100
18 ms896 KiB
#include "grader.h" #include <cmath> bool v = false; void f(int rmn, int cmn, int rmx, int cmx, int dr, int dc, int X) { if(v) return; if((rmn - rmx) * dr > 0 || (cmn - cmx) * dc > 0) return; int t = Measure(rmn, cmx); if(t < X) { f(rmn + dr, cmn, rmx, cmx, dr, dc, X); } else if(t > X) { f(rmn, cmn, rmx, cmx - dc, dr, dc, X); } else { Pinpoint(rmn, cmx); v = true; } } void Rescue(int R, int C, int RS, int CS, int X) { f(1, 1, RS, CS, 1, 1, X); f(1, C, RS, CS, 1, -1, X); f(R, 1, RS, CS, -1, 1, X); f(R, C, RS, CS, -1, -1, X); // Measure(1, 2); // Pinpoint(1, 2); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...