Submission #444065

#TimeUsernameProblemLanguageResultExecution timeMemory
444065leinad2Dungeons Game (IOI21_dungeons)C++17
Compilation error
0 ms0 KiB
#include "dungeons.h" #include<bits/stdc++.h> using namespace std; int N; vector<int>S, P, W, L; void init(int n, vector<int>s, vector<int>p, vector<int>w, vector<int>l) { N=n;S=s;P=p;W=w;L=l; } long long simulate(int x, int z) { if(x==n)return z; if(z>=S[x])simulate(W[x], z+S[x]); else simulate(L[x], z+P[x]); }

Compilation message (stderr)

dungeons.cpp: In function 'long long int simulate(int, int)':
dungeons.cpp:12:11: error: 'n' was not declared in this scope
   12 |     if(x==n)return z;
      |           ^
dungeons.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^