Submission #536110

#TimeUsernameProblemLanguageResultExecution timeMemory
536110Icebear16Dungeons Game (IOI21_dungeons)C++17
0 / 100
157 ms40888 KiB
#include "dungeons.h" #include <bits/stdc++.h> struct edge{ int u,v; int weight; edge(int _u,int _v,int _w){ u=_u; v=_v; weight=_w; } }; std::vector<edge> adj[1000]; int ans; void dfs(int n, int z, std::vector<int> s, std::vector<int> p){ ans=z; int y; for(int i=0;i<adj[n].size();i++){ if(s[n]<ans){ y=adj[n][i].v; ans+=s[n]; }else{ y=adj[n][i].weight; ans+=p[n]; } if(y!=s.size()){ dfs(y,ans,s,p); } } } std::vector<int> g; std::vector<int> h; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { g=s; h=p; for(int i=0;i<w.size();i++){ adj[i].push_back(edge(i,w[i],l[i])); } return; } long long simulate(int x, int z) { dfs(x,z,g,h); return ans; }

Compilation message (stderr)

dungeons.cpp: In function 'void dfs(int, int, std::vector<int>, std::vector<int>)':
dungeons.cpp:21:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int i=0;i<adj[n].size();i++){
      |              ~^~~~~~~~~~~~~~
dungeons.cpp:29:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |   if(y!=s.size()){
      |      ~^~~~~~~~~~
dungeons.cpp: In function 'void init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:40:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |  for(int i=0;i<w.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...