Submission #1111371

#TimeUsernameProblemLanguageResultExecution timeMemory
1111371RuichenTrains (BOI24_trains)C++17
0 / 100
2063 ms2104 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; long long ans=0; cin >> n; vector<long long> a(n); a[0]=1; vector<int> v(n),x(n); for(int i=0; i<n; i++){ cin >> v[i] >> x[i]; for(int j=i+v[i]; j<min((x[i]+1)*v[i]+i,n); j+=v[i]){ a[j]+=a[i]; a[j]%=1000000007; } ans+=a[i]; ans%=1000000007; } cout << ans << endl; 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...