Submission #24908

# Submission time Handle Problem Language Result Execution time Memory
24908 2017-06-17T05:41:51 Z dotorya 산악 구조대 (JOI13_mountain) C++14
Compilation error
0 ms 0 KB
void Rescue(int R, int C, int RS, int CS, int X) {
	int i, j, k;
	
	int ax = -1, ay = -1;
	int x = RS, y = 1;
	while (x >= 1 && x <= R && y >= 1 && y <= C && y <= CS) {
		int t = Measure(x, y);
		if (t == X) ax = x, ay = y;
		if (t >= X) x--;
		else y++;
	}
	x = RS, y = C;
	while (x >= 1 && x <= R && y >= 1 && y <= C && y >= CS) {
		int t = Measure(x, y);
		if (t == X) ax = x, ay = y;
		if (t >= X) x--;
		else y--;
	}

	x = RS, y = 1;
	while (x >= 1 && x <= R && y >= 1 && y <= C && y <= CS) {
		int t = Measure(x, y);
		if (t == X) ax = x, ay = y;
		if (t >= X) x++;
		else y++;
	}
	x = RS, y = C;
	while (x >= 1 && x <= R && y >= 1 && y <= C && y >= CS) {
		int t = Measure(x, y);
		if (t == X) ax = x, ay = y;
		if (t >= X) x++;
		else y--;
	}
	Pinpoint(ax, ay);
}

Compilation message

mountain.cpp: In function 'void Rescue(int, int, int, int, int)':
mountain.cpp:7:11: error: 'Measure' was not declared in this scope
   int t = Measure(x, y);
           ^~~~~~~
mountain.cpp:14:11: error: 'Measure' was not declared in this scope
   int t = Measure(x, y);
           ^~~~~~~
mountain.cpp:22:11: error: 'Measure' was not declared in this scope
   int t = Measure(x, y);
           ^~~~~~~
mountain.cpp:29:11: error: 'Measure' was not declared in this scope
   int t = Measure(x, y);
           ^~~~~~~
mountain.cpp:34:2: error: 'Pinpoint' was not declared in this scope
  Pinpoint(ax, ay);
  ^~~~~~~~
mountain.cpp:2:6: warning: unused variable 'i' [-Wunused-variable]
  int i, j, k;
      ^
mountain.cpp:2:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j, k;
         ^
mountain.cpp:2:12: warning: unused variable 'k' [-Wunused-variable]
  int i, j, k;
            ^