이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int n, m;
void Rescue(int N, int M, int cy, int cx, int val)
{
n=N, m=M;
int i, j;
int y=1, x=cx;
while(y<=cy && 1<=x)
{
int t=Measure(y, x);
if(t==val)
{
Pinpoint(y, x);
return;
}
else if(t<val) y++;
else if(t>val) x--;
}
y=1, x=cx;
while(y<=cy && x<=m)
{
int t=Measure(y, x);
if(t==val)
{
Pinpoint(y, x);
return;
}
else if(t<val) y++;
else if(t>val) x++;
}
y=n, x=cx;
while(cy<=y && 1<=x)
{
int t=Measure(y, x);
if(t==val)
{
Pinpoint(y, x);
return;
}
else if(t<val) y--;
else if(t>val) x--;
}
y=n, x=cx;
while(cy<=y && x<=m)
{
int t=Measure(y, x);
if(t==val)
{
Pinpoint(y, x);
return;
}
else if(t<val) y--;
else if(t>val) x++;
}
}
컴파일 시 표준 에러 (stderr) 메시지
mountain.cpp: In function 'void Rescue(int, int, int, int, int)':
mountain.cpp:14:9: warning: unused variable 'i' [-Wunused-variable]
int i, j;
^
mountain.cpp:14:12: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |