제출 #828615

#제출 시각아이디문제언어결과실행 시간메모리
828615LiudasDungeons Game (IOI21_dungeons)C++17
11 / 100
7040 ms26692 KiB
#include "dungeons.h" #include <vector> #include <cassert> #include <cstdio> using namespace std; struct node{ int ws, ls, w, l; }; vector<node> tree; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l){ tree.resize(n); for(int i = 0; i < n; i ++){ tree[i].ws = s[i]; tree[i].ls = p[i]; tree[i].w = w[i]; tree[i].l = l[i]; } } long long simulate(int x, int z){ long long ans = z; while(x != tree.size()){ if(ans >= tree[x].ws){ ans += tree[x].ws; x = tree[x].w; } else{ ans += tree[x].ls; x = tree[x].l; } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

dungeons.cpp: In function 'long long int simulate(int, int)':
dungeons.cpp:21:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<node>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     while(x != tree.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...