#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 |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Incorrect |
5 ms |
364 KB |
Wrong Answer [5] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
512 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |