제출 #837739

#제출 시각아이디문제언어결과실행 시간메모리
837739Mohmad_Zaid던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
    // vector<vector<int>>g_win(n,vector<int>()),g_lose(n,vector<int>());
    // for(int i=0;i<n;i++){
    //     g_win[i].pb(w[i]);
    //     g_lose[i].pb(l[i]);        
    // }
    while(x!=n){
        if(z<s[x]){
            z+=p[x];
            x=l[x];
        }else{
            z+=s[x];
            x=w[x];
        }
    }
    // cout<<z<<endl;
    return;
}

ll simulate(int x, int z) {
    // vector<int>s={2,6,9},p={3,1,2},w={2,2,3},l={1,0,1};
    // init(3,s,p,w,l,x,z);
    return 0;
}
// int main(){
//     int n=3,q=2;
//     simulate(0,1);
//     simulate(2,3);
//     return 0;
// }

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

dungeons.cpp: In function 'void init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:12:11: error: 'x' was not declared in this scope
   12 |     while(x!=n){
      |           ^
dungeons.cpp:13:12: error: 'z' was not declared in this scope
   13 |         if(z<s[x]){
      |            ^