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 <algorithm>
void Rescue(int n,int m,int x,int y,int z)
{
int i,j,t;
i=1;
j=y;
while(i<=x&&j>=1)
{
t=Measure(i,j);
if(t==z)
{
Pinpoint(i,j);
return;
}
if(t>z)i++;
else j--;
}
i=1;
j=y;
while(i<=x&&j<=m)
{
t=Measure(i,j);
if(t==z)
{
Pinpoint(i,j);
return;
}
if(t>z)i++;
else j++;
}
i=n;
j=y;
while(i>=x&&j>=1)
{
t=Measure(i,j);
if(t==z)
{
Pinpoint(i,j);
return;
}
if(t>z)i--;
else j--;
}
i=n;
j=y;
while(i>=x&&j<=m)
{
t=Measure(i,j);
if(t==z)
{
Pinpoint(i,j);
return;
}
if(t>z)i--;
else j++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |