제출 #1315258

#제출 시각아이디문제언어결과실행 시간메모리
1315258lynessiTrains (BOI24_trains)C++20
0 / 100
1234 ms1340 KiB
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef long long ll; typedef vector<ll> vll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N; int mod = 0x3B9ACA07; cin >> N; vll dp(N+1); dp[1] = 1; ll total = 1; for (int i=1; i<=N; i++) { ll d, x; cin >> d >> x; if (!d) continue; ll t = 1, s = i + d; cout << d << ' ' << x << '\n'; while (t <= x && s <= N) { dp[s] += dp[i]; s += d; t++; total += dp[i]; total %= mod; } } cout << total << endl; }
#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...