fork(1) download
  1. #include <iostream>
  2.  
  3. int main(){
  4. int dp[82][10];
  5.  
  6. for(int i = 0; i < 82; i++)
  7. for(int j = 0; j < 10; j++)
  8. dp[i][j] = 0;
  9.  
  10. dp[1][1] = 1;
  11. for(int s = 1; s < 82; s++)
  12. for(int n = 1; n < 10; n++)
  13. for(int i = 0; i <= 9; i++){
  14. dp[s][n] += ((s - i >= 0) ? dp[n-1][s-1] : 0);
  15. }
  16.  
  17. for(int i = 1; i < 82; i++){
  18. for(int j = 1; j < 10; j++)
  19. std::cout << dp[i][j] << " ";
  20. std::cout << std::endl;
  21. }
  22.  
  23. std::cout << dp[1][9];
  24.  
  25. int pause;
  26. std::cin >> pause;
  27. }
Success #stdin #stdout 0s 3416KB
stdin
Standard input is empty
stdout
1 0 0 0 0 0 0 0 0 
0 3 0 0 0 0 0 0 0 
0 0 12 0 0 0 0 0 0 
0 0 0 60 0 0 0 0 0 
0 0 0 0 360 0 0 0 0 
0 0 0 0 0 2520 0 0 0 
0 0 0 0 0 0 20160 0 0 
0 0 0 0 0 0 0 181440 0 
0 0 0 0 0 0 0 0 1814400 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
10 0 0 0 0 0 0 0 0 
0 30 0 0 0 0 0 0 0 
0 0 120 0 0 0 0 0 0 
0 0 0 600 0 0 0 0 0 
0 0 0 0 3600 0 0 0 0 
0 0 0 0 0 25200 0 0 0 
0 0 0 0 0 0 201600 0 0 
0 0 0 0 0 0 0 1814400 0 
0 0 0 0 0 0 0 0 18144000 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
30 0 0 0 0 0 0 0 0 
0 120 0 0 0 0 0 0 0 
0 0 600 0 0 0 0 0 0 
0 0 0 3600 0 0 0 0 0 
0 0 0 0 25200 0 0 0 0 
0 0 0 0 0 201600 0 0 0 
0 0 0 0 0 0 1814400 0 0 
0 0 0 0 0 0 0 18144000 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
120 0 0 0 0 0 0 0 0 
0 600 0 0 0 0 0 0 0 
0 0 3600 0 0 0 0 0 0 
0 0 0 25200 0 0 0 0 0 
0 0 0 0 201600 0 0 0 0 
0 0 0 0 0 1814400 0 0 0 
0 0 0 0 0 0 18144000 0 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 100 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
600 0 0 0 0 0 0 0 0 
0 3600 0 0 0 0 0 0 0 
0 0 25200 0 0 0 0 0 0 
0 0 0 201600 0 0 0 0 0 
0 0 0 0 1814400 0 0 0 0 
0 0 0 0 0 18144000 0 0 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 100 0 
0 0 0 0 0 0 0 0 300 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
3600 0 0 0 0 0 0 0 0 
0 25200 0 0 0 0 0 0 0 
0 0 201600 0 0 0 0 0 0 
0 0 0 1814400 0 0 0 0 0 
0 0 0 0 18144000 0 0 0 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 100 0 0 
0 0 0 0 0 0 0 300 0 
0 0 0 0 0 0 0 0 1200 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
25200 0 0 0 0 0 0 0 0 
0 201600 0 0 0 0 0 0 0 
0 0 1814400 0 0 0 0 0 0 
0 0 0 18144000 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 100 0 0 0 
0 0 0 0 0 0 300 0 0 
0 0 0 0 0 0 0 1200 0 
0 0 0 0 0 0 0 0 6000 
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
201600 0 0 0 0 0 0 0 0 
0 1814400 0 0 0 0 0 0 0 
0 0 18144000 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 
0