Submission #35321

#TimeUsernameProblemLanguageResultExecution timeMemory
35321cheater2k산악 구조대 (JOI13_mountain)C++14
100 / 100
21 ms1024 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int r, c, rs, cs, x; void solve(int mask) { int nr = (mask & 1) ? rs : r - rs + 1; int nc = (mask & 2) ? cs : c - cs + 1; int j = 1; int ask = 0; for (int i = nr; i >= 1; --i) { while(j <= nc) { ask = Measure( (mask&1) ? i : r - i + 1, (mask&2) ? j : c - j + 1 ); if (ask <= x) { if (ask == x) { Pinpoint( (mask&1) ? i : r - i + 1, (mask&2) ? j : c - j + 1 ); } ++j; } else break; } } } void Rescue(int R, int C, int RS, int CS, int X) { r = R; c = C; rs = RS; cs = CS; x = X; for (int mask = 0; mask < 4; ++mask) { solve(mask); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...