제출 #1057135

#제출 시각아이디문제언어결과실행 시간메모리
10571350npataTrains (BOI24_trains)C++17
8 / 100
389 ms2140 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define vec vector const int MOD = 1e9 + 7; int32_t main() { int N; cin >> N; vec<int> D(N), X(N); for(int i = 0; i<N; i++) { cin >> D[i]; cin >> X[i]; } vec<int> f(N, 1); for(int i = N-2; i>=0; i--) { if(D[i] == 0) continue; for(int j = 1; j<=X[i] && i+(j*D[i]) < N; j++) { f[i] += f[i+(j*D[i])]; assert(i+(j*D[i]) < N); } } cout << f[0] << '\n'; }
#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...