#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++;
}
}
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
512 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |