# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
623766 | iomoon191 | 산악 구조대 (JOI13_mountain) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <grader.h>
#include <bits/stdc++.h>
using namespace sstd;
int x_;
void sub(int x1, int x2, int y1, int y2, int cx, int cy, int dx, int dy){
while(x1 <= cx and cx <= x2 and y1 <= cy and cy <= y2){
int h = Measure(cx, cy);
if(h == x_){
Pinpoint(cx, cy);
}
else if(h < x_) cx += dx;
else cy += dy;
}
}
void Rescue(int r, int c, int rs, int cs, int x){
_x = x;
sub(1, rs, 1, cs, 1, cs, 1, -1);
sub(rs, r, 1, cs, r, cs, -1, -1);
sub(1, rs, cs, c, 1, cs, 1, 1);
sub(rs, r, cs, c, r, cs, -1, 1);
}