제출 #1301362

#제출 시각아이디문제언어결과실행 시간메모리
1301362tamir1장애물 (IOI25_obstacles)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "obstacles.h" using namespace std; static int N, M; static vector<int> Tval, Hval; static vector<int> c; static vector<int> b; void initialize(vector<int> T, vector<int> H) { Tval = T; Hval = H; N = Tval.size(); M = Hval.size(); c.assign(M, 0); b.assign(M, -1); int d = Tval[N-1]; int mx=-1; for(int i=0; i<M; i++) { mx=max(mx, Hval[i]); } } bool can_reach(int L, int R, int S, int D) { if(d>mx) { return true; } else { return false; } }

컴파일 시 표준 에러 (stderr) 메시지

obstacles.cpp: In function 'bool can_reach(int, int, int, int)':
obstacles.cpp:29:8: error: 'd' was not declared in this scope
   29 |     if(d>mx) {
      |        ^
obstacles.cpp:29:10: error: 'mx' was not declared in this scope
   29 |     if(d>mx) {
      |          ^~
obstacles.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^