Submission #1075548

#TimeUsernameProblemLanguageResultExecution timeMemory
1075548oscar1fTrains (BOI24_trains)C++17
21 / 100
2095 ms7376 KiB
#include<bits/stdc++.h> using namespace std; #define int long long const int TAILLE_MAX=100*1000+5,LIMITE=400,MODU=1000*1000*1000+7; int nbVal; vector<int> cumu[LIMITE][LIMITE]; int duree[TAILLE_MAX],nbTraj[TAILLE_MAX]; int rep[TAILLE_MAX]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>nbVal; for (int i=1;i<=nbVal;i++) { cin>>duree[i]>>nbTraj[i]; if (duree[i]==0) { duree[i]=MODU; } } for (int i=nbVal;i>=1;i--) { for (int j=i;j<=min(nbVal,i+duree[i]*nbTraj[i]);j+=duree[i]) { rep[i]+=rep[j]; rep[i]%=MODU; } rep[i]++; rep[i]%=MODU; //cout<<i<<" : "<<rep[i]<<endl; } cout<<rep[1]<<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...