제출 #1345019

#제출 시각아이디문제언어결과실행 시간메모리
1345019yc11던전 (IOI21_dungeons)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define int long long
using namespace std;


vector<int> s1;
vector<int> p1;
vector<int> w1;
vector<int> l1;
int N;
void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) {
    s1 = s;
    p1 = p;
    w1 = w;
    l1 = l;
    N = n;
	return;
}

long long simulate(int x, int z) {
    while (x!=N){
        if (z>=s[x]){
            z+=s[x];
            x = w[x];
        }
        else{
            z+=p[x];
            x = l[x];
        }
    }
	return (long long )z;
}

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

dungeons.cpp: In function 'long long int simulate(long long int, long long int)':
dungeons.cpp:22:16: error: 's' was not declared in this scope
   22 |         if (z>=s[x]){
      |                ^
dungeons.cpp:24:17: error: 'w' was not declared in this scope
   24 |             x = w[x];
      |                 ^
dungeons.cpp:27:16: error: 'p' was not declared in this scope
   27 |             z+=p[x];
      |                ^
dungeons.cpp:28:17: error: 'l' was not declared in this scope
   28 |             x = l[x];
      |                 ^