제출 #542854

#제출 시각아이디문제언어결과실행 시간메모리
542854AJ00던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int N; int simulate(int x, int z){ int moves = 0; while(x != N){ moves++; if (z >= s[x]){ z += s[x]; x = w[x]; } else { z += p[x]; x = l[x]; } } return moves; } void init(int n, vector<int> _s, vector<int> _p, vector<int> _w,vector<int> _l){ vector<int> s = _s; vector<int> p = _p; vector<int> w = _w; vector<int> l = _l; N = n; }

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

dungeons.cpp: In function 'long long int simulate(long long int, long long int)':
dungeons.cpp:9:18: error: 's' was not declared in this scope
    9 |         if (z >= s[x]){
      |                  ^
dungeons.cpp:11:17: error: 'w' was not declared in this scope
   11 |             x = w[x];
      |                 ^
dungeons.cpp:14:18: error: 'p' was not declared in this scope
   14 |             z += p[x];
      |                  ^
dungeons.cpp:15:17: error: 'l' was not declared in this scope
   15 |             x = l[x];
      |                 ^