제출 #837874

#제출 시각아이디문제언어결과실행 시간메모리
837874IS_Rushdi던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; int n; vector<int>s,p,w,l; void init(int N, vector<int> S,vector<int> P,vector<int> W,vector<int> L) { s=S; p=P; w=W; l=L; } ll simulate(int i, int curr) { while(i != n){ if(curr >= s[i]){ curr+=s[i]; idx=w[i]; } else{ curr+=p[i]; idx=l[i]; } } return curr; }

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

dungeons.cpp: In function 'll simulate(int, int)':
dungeons.cpp:20:13: error: 'idx' was not declared in this scope; did you mean 'index'?
   20 |             idx=w[i];
      |             ^~~
      |             index
dungeons.cpp:24:13: error: 'idx' was not declared in this scope; did you mean 'index'?
   24 |             idx=l[i];
      |             ^~~
      |             index