Submission #439674

#TimeUsernameProblemLanguageResultExecution timeMemory
439674tutisDungeons Game (IOI21_dungeons)C++17
11 / 100
7059 ms19756 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; int N; int S[400002]; int P[400002]; int W[400002]; int L[400002]; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) { N = n; for (int i = 0; i < s.size(); i++) S[i] = s[i]; for (int i = 0; i < p.size(); i++) P[i] = p[i]; for (int i = 0; i < w.size(); i++) W[i] = w[i]; for (int i = 0; i < l.size(); i++) L[i] = l[i]; } long long simulate(int x, int z) { long long s = z; while (x != N) { if (s >= S[x]) { s += S[x]; x = W[x]; } else { s += P[x]; x = L[x]; } } return s; }

Compilation message (stderr)

dungeons.cpp: In function 'void init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for (int i = 0; i < s.size(); i++)
      |                  ~~^~~~~~~~~~
dungeons.cpp:13:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for (int i = 0; i < p.size(); i++)
      |                  ~~^~~~~~~~~~
dungeons.cpp:15:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for (int i = 0; i < w.size(); i++)
      |                  ~~^~~~~~~~~~
dungeons.cpp:17:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for (int i = 0; i < l.size(); i++)
      |                  ~~^~~~~~~~~~
#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...