Submission #896228

#TimeUsernameProblemLanguageResultExecution timeMemory
896228Muhammad_AneeqDungeons Game (IOI21_dungeons)C++17
11 / 100
7097 ms26928 KiB
#include <vector> #include "dungeons.h" using namespace std; int const N=4e5+10; int wi[N],lo[N],po[N],st[N]; int nn; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) { nn=n; for (int i=0;i<n;i++) { wi[i]=w[i]; lo[i]=l[i]; st[i]=s[i]; po[i]=p[i]; } } long long simulate(int i, int z) { long long ans=z; bool w=0; while (i!=nn) { if (z>=st[i]) { z+=st[i]; i=wi[i]; } else { z+=po[i]; i=lo[i]; } } return z; }

Compilation message (stderr)

dungeons.cpp: In function 'long long int simulate(int, int)':
dungeons.cpp:20:12: warning: unused variable 'ans' [-Wunused-variable]
   20 |  long long ans=z;
      |            ^~~
dungeons.cpp:21:7: warning: unused variable 'w' [-Wunused-variable]
   21 |  bool w=0;
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...