제출 #1223228

#제출 시각아이디문제언어결과실행 시간메모리
1223228porquenomedejainiciarsesion던전 (IOI21_dungeons)C++20
컴파일 에러
0 ms0 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; int n; vector<int> s,p,w,l; void init(int in, vector<int> is, vector<int> ip, vector<int> iw, vector<int> il){ n=in; s=is; p=ip; w=iw; l=il; } int simulate(int a,int b){ while(a!=n){ if(b>=s[a]){ b+=s[a]; a=w[a]; }else{ b+=p[a]; a=l[a]; } } return b; }

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

dungeons.cpp:13:5: error: ambiguating new declaration of 'int simulate(int, int)'
   13 | int simulate(int a,int b){
      |     ^~~~~~~~
In file included from dungeons.cpp:1:
dungeons.h:4:11: note: old declaration 'long long int simulate(int, int)'
    4 | long long simulate(int x, int z);
      |           ^~~~~~~~