제출 #612272

#제출 시각아이디문제언어결과실행 시간메모리
612272StrawHatWess던전 (IOI21_dungeons)C++17
0 / 100
7067 ms5552 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int>vi; #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x),end(x) #define FOR(i,a,b) for(int i=a; i<b; i++) #define ROF(i,a,b) for(int i=b-1; i>=a; i--) //------------------------------------------------ int N; vi s, p, w, l; vector<ll>jump; void init(int n, vi s, vi p, vi w, vi l) { N=n; ::s=s; ::p=p; ::w=w; ::l=l; jump.assign(N+1,0); ROF(i,0,N){ jump[i]=s[i]+jump[w[i]]; } } ll simulate(int st, int x){ int i=st; ll X=x; while(1){ if(i==N || X>=s[i]) break; X+=p[i]; i=l[i]; } X+=jump[i]; return X; } /* 3 2 2 6 9 3 1 2 2 2 3 1 0 1 0 1 2 3 24 25 */
#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...