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 <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++;
}
}
Compilation message (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... |