Submission #536461

#TimeUsernameProblemLanguageResultExecution timeMemory
536461Icebear16Dungeons Game (IOI21_dungeons)C++17
11 / 100
7068 ms20296 KiB
#include "dungeons.h" #include <bits/stdc++.h> int ans; void dfs(int n, int z, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l){ ans=z; while(n!=s.size()){ if(ans>=s[n]){ ans+=s[n]; n=w[n]; }else{ ans+=p[n]; n=l[n]; } } } std::vector<int> a; std::vector<int> b; std::vector<int> c; std::vector<int> d; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { a=s,b=p,c=w,d=l; return; } long long simulate(int x, int z) { dfs(x,z,a,b,c,d); return ans; }

Compilation message (stderr)

dungeons.cpp: In function 'void dfs(int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:7:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  while(n!=s.size()){
      |        ~^~~~~~~~~~
#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...