# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
766127 | bachhoangxuan | 코알라 (JOI13_koala) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
int t=0;
int get(int x,int y){
int h=Measure(x,y);
if(h==t) Pinpoint(x,y);
return h;
}
//g++ −O2 grader.cpp mountain.cpp −o mountain
void Rescue(int R, int C, int RS, int CS, int X) {
int x=1,y=CS;t=X;
while(x<=RS && y>=1){
int h=get(x,y);
if(h<X) x++;
else y--;
}
x=1,y=CS;
while(x<=RS && y<=C){
int h=get(x,y);
if(h<X) x++;
else y++;
}
x=R;y=CS;
while(x>RS && y>=1){
int h=get(x,y);
if(h<X) x--;
else y--;
}
x=R;y=CS;
while(x>RS && y<=C){
int h=get(x,y);
if(h<X) x--;
else y++;
}
}