이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dungeons.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<int>s,p,w,l;
int n;
long long funk(int u,long long k){
if(u==n){
return k;
}
if(k>=s[u]){
funk(w[u],k+s[u]);
}
else{
funk(l[u],k+p[u]);
}
}
void init(int nn,vector<int> ss,vector<int> pp,vector<int> ww,vector<int> ll) {
n=nn;
s=ss,p=pp,w=ww,l=ll;
}
long long simulate(int x, int z) {
return funk(x,z);
}
컴파일 시 표준 에러 (stderr) 메시지
dungeons.cpp: In function 'long long int funk(int, long long int)':
dungeons.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
17 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |