Advertisement
MathQ_

Untitled

Jun 19th, 2022
1,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. vector<vector<ll>> dp(12, vector<ll>(100));
  2. dp[0][0] = 6;
  3. dp[0][3] = dp[0][6] = dp[0][9] = 1;
  4. for (int i = 1; i < 12; ++i) {
  5.   for (int j = 0; j < 100; ++j) {
  6.     for (int k = 0; k < 10; ++k) {
  7.       dp[i][j] += dp[i - 1][j - k * (k % 3 == 0)];
  8.     }
  9.   }
  10. }
  11. cout << dp[11][99] << '\n';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement