Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- const int INF = 1e9;
- const int mod = 1e9 + 7;
- const int N = 1e6 + 5;
- int dp[N];
- signed main()
- {
- int n;
- cin >> n;
- dp[0] = 0;
- for(int i = 1; i <= 6; i++)
- dp[i] = 1;
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= 6; j++){
- if(i >= j)
- dp[i] += dp[i - j];
- dp[i] %= mod;
- }
- }
- cout << dp[n] << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement