| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367394 | lucasdmy | Trains (BOI24_trains) | C++20 | 215 ms | 980 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int, int>>v(n+10);
vector<int>dp(n+10, 1);
for(int k=1;k<=n;k++){
cin>>v[k].first>>v[k].second;
}
for(int k=n;k>0;k--){
if(v[k].first==0){
continue;
}
int at=k+v[k].first, tot=1;
while(tot<=v[k].second and at<=n){
dp[k]+=dp[at];
at+=v[k].first;
tot++;
}
}
cout<<dp[1];
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
