fork download
  1. #include <iostream>
  2.  
  3. #define _size 200
  4.  
  5. using namespace std;
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11. unsigned long long tab[_size][_size];
  12. tab[1][1] = 1;
  13. tab[2][1] = 2;
  14. tab[2][2] = 1;
  15. for(int i=3;i<_size-1;i++)
  16. {
  17. tab[i][1] = i;
  18. for(int j=2;j<_size-1;j++)
  19. {
  20. tab[i][j] = tab[i-1][j-1]+tab[i-1][j];
  21. }
  22. }
  23. int x,y;
  24. cin>>x>>y;
  25. cout<<tab[x][y];
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 3532KB
stdin
10 4
stdout
210