답안 #623766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
623766 2022-08-06T13:12:29 Z iomoon191 산악 구조대 (JOI13_mountain) C++17
컴파일 오류
0 ms 0 KB
#include <grader.h>
#include <bits/stdc++.h>
using namespace sstd;

int x_;

void sub(int x1, int x2, int y1, int y2, int cx, int cy, int dx, int dy){
	while(x1 <= cx and cx <= x2 and y1 <= cy and cy <= y2){
		int h = Measure(cx, cy);
		if(h == x_){
			Pinpoint(cx, cy);
		}
		else if(h < x_) cx += dx;
		else cy += dy;
	}
}

void Rescue(int r, int c, int rs, int cs, int x){
	_x = x;
	sub(1, rs, 1, cs, 1, cs, 1, -1);
	sub(rs, r, 1, cs, r, cs, -1, -1);
	sub(1, rs, cs, c, 1, cs, 1, 1);
	sub(rs, r, cs, c, r, cs, -1, 1);
}

Compilation message

mountain.cpp:3:17: error: 'sstd' is not a namespace-name
    3 | using namespace sstd;
      |                 ^~~~
mountain.cpp: In function 'void Rescue(int, int, int, int, int)':
mountain.cpp:19:2: error: '_x' was not declared in this scope; did you mean 'x'?
   19 |  _x = x;
      |  ^~
      |  x