Submission #107431

#TimeUsernameProblemLanguageResultExecution timeMemory
107431Diuven산악 구조대 (JOI13_mountain)C++14
100 / 100
27 ms896 KiB
#include "grader.h" int V; bool solve(int xa, int ya, int xb, int yb, int dx, int dy){ 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) { V = X; bool ans = solve(1,1,RS,CS,1,-1) || solve(1,CS,RS,C,1,1) || solve(RS,1,R,CS,-1,-1) || solve(RS,CS,R,C,-1,1); }

Compilation message (stderr)

mountain.cpp: In function 'void Rescue(int, int, int, int, int)':
mountain.cpp:22:7: warning: unused variable 'ans' [-Wunused-variable]
  bool ans =
       ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...