# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1111418 |
2024-11-12T08:19:59 Z |
Ruichen |
Drivers (BOI24_drivers) |
C++17 |
|
1 ms |
336 KB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, ans=0, d, x;
long long p;
cin >> n;
vector<int> a(n,0);
a[0]=1;
for(int i=0; i<n; i++){
cin >> d >> x;
p=i;
if(d>0){
for(int j=0; j<x; j++){
p+=d;
if(p<n){
a[p]+=a[i];
//cout << a[i] << " " << a[p] << endl;
a[p]%=(int)1e9+7;
}
}
}
ans+=a[i];
ans%=(int)1e9+7;
}
cout << ans << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |