# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
633342 | minhcool | 산악 구조대 (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 std;
//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int oo = 1e18 + 7, mod = 1e9 + 7;
const int N = 1e5 + 5;
void rescue(int R, int C, int Rm, int Cm, int X){
int cur_itr = R;
for(int i = Cm; i >= 1; i--){
int temp = Measure(cur_itr, i);
while(cur_itr >= Rm && temp < X){
cur_itr--;
if(cur_itr < Rm) break;
temp = Measure(cur_itr, i);
}
if(cur_itr < Rm) break;
if(temp == X){
Pinpoint(cur_itr, i);
}
}
cur_itr = 1;
for(int i = Cm; i >= 1; i--){
int temp = Measure(cur_itr, i);
while(cur_itr <= Rm && temp < X){
cur_itr++;
if(cur_itr > Rm) break;
temp = Measure(cur_itr, i);
}
if(cur_itr > Rm) break;
if(temp == X){
Pinpoint(cur_itr, i);
}
}
cur_itr = R;
for(int i = Cm; i <= C; i--){
int temp = Measure(cur_itr, i);
while(cur_itr >= Rm && temp < X){
cur_itr--;
if(cur_itr < Rm) break;
temp = Measure(cur_itr, i);
}
if(cur_itr < Rm) break;
if(temp == X){
Pinpoint(cur_itr, i);
}
}
cur_itr = 1;
for(int i = Cm; i <= C; i++){
int temp = Measure(cur_itr, i);
while(cur_itr <= Rm && temp < X){
cur_itr++;
if(cur_itr > Rm) break;
temp = Measure(cur_itr, i);
}
if(cur_itr > Rm) break;
if(temp == X){
Pinpoint(cur_itr, i);
}
}
}