Submission #1312303

#TimeUsernameProblemLanguageResultExecution timeMemory
1312303opeleklanosDungeons Game (IOI21_dungeons)C++20
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include "dungeons" using namespace std; #define ll long long vector<int> w, l, s, p; int n; int init(int n1, vector<int> s1, vector<int> p1, vector<int> w1, vector<int> l1){ n = n1; s = s1; p = p1; w = w1; l = l1; } ll simulate(int x, int z1){ ll z = ll(z1); while(x!=n){ if(z < s[x]){ z += (ll)p[x]; x = l[x]; } else{ z += (ll)s[x]; x = w[x]; } } return z; }

Compilation message (stderr)

dungeons.cpp: In function 'int init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
dungeons.cpp: In function 'long long int simulate(int, int)':
dungeons.cpp:6:12: error: expected primary-expression before 'long'
    6 | #define ll long long
      |            ^~~~
dungeons.cpp:20:12: note: in expansion of macro 'll'
   20 |     ll z = ll(z1);
      |            ^~