제출 #837747

#제출 시각아이디문제언어결과실행 시간메모리
837747Mohmad_Zaid던전 (IOI21_dungeons)C++17
11 / 100
7060 ms23100 KiB
#include "dungeons.h" #include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std; int final; vector<int>st,po,wi,lo; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) { final=n; st=s; po=p; wi=w; lo=l; return; } ll simulate(int x, int z) { // vector<int>s={2,6,9},p={3,1,2},w={2,2,3},l={1,0,1}; // init(3,s,p,w,l,x,z); ll ans=z; while(x!=final){ if(ans<st[x]){ ans+=po[x]; x=lo[x]; }else{ ans+=st[x]; x=wi[x]; } } return ans; } // int main(){ // int n=3,q=2; // simulate(0,1); // simulate(2,3); // return 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...