fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. typedef long long int ll ;
  6. const int MAXN = 10000;
  7. const int MOD =1000000007;
  8.  
  9. ll dp[MAXN+1][MAXN+1];
  10. int main() {
  11. // your code goes here
  12. for(int i = 0 ; i< MAXN; i++){
  13. for(int j = 0 ; j<=MAXN;j++){
  14. if(i==j || j==0) dp[i][j] = 1;
  15. else if(i==0 || j>i) dp[i][j]=0;
  16. else {
  17. dp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % MOD;
  18. }
  19. }
  20.  
  21. }
  22. cout<<dp[6][4]<<" "<<dp[6][2];
  23. return 0;
  24. }
Success #stdin #stdout 0.38s 784860KB
stdin
Standard input is empty
stdout
15 15