제출 #598669

#제출 시각아이디문제언어결과실행 시간메모리
598669MKopchev던전 (IOI21_dungeons)C++17
11 / 100
7083 ms26648 KiB
#include "dungeons.h" #include<bits/stdc++.h> using namespace std; int mem_n; vector<int> opponent_power,lose_gain,win_move,lose_move; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { mem_n=n; opponent_power=s; lose_gain=p; win_move=w; lose_move=l; } long long simulate(int x, int z_) { long long z=z_; while(x!=mem_n) { if(opponent_power[x]<=z) { z+=opponent_power[x]; x=win_move[x]; } else { z+=lose_gain[x]; x=lose_move[x]; } } return z; } /* static int n, q; static std::vector<int> s, p, z; static std::vector<int> w, l, x; static std::vector<long long> answer; int main() { assert(scanf("%d %d", &n, &q) == 2); s.resize(n); p.resize(n); w.resize(n); l.resize(n); x.resize(q); z.resize(q); answer.resize(q); for (int i = 0; i < n; i++) { assert(scanf("%d", &s[i]) == 1); } for (int i = 0; i < n; i++) { assert(scanf("%d", &p[i]) == 1); } for (int i = 0; i < n; i++) { assert(scanf("%d", &w[i]) == 1); } for (int i = 0; i < n; i++) { assert(scanf("%d", &l[i]) == 1); } init(n, s, p, w, l); for (int i = 0; i < q; i++) { assert(scanf("%d %d", &x[i], &z[i]) == 2); answer[i] = simulate(x[i], z[i]); } fclose(stdin); for (int i = 0; i < q; i++) { printf("%lld\n", answer[i]); } fclose(stdout); 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...