Submission #12929

# Submission time Handle Problem Language Result Execution time Memory
12929 2015-01-20T15:30:55 Z gs13068 산악 구조대 (JOI13_mountain) C++
0 / 100
12 ms 512 KB
#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 -