fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. long long combination(int n, int k) {
  6. long double acc = 0;
  7. for (int i = 0; i < k; i++) {
  8. acc += logl(n - i) - logl(k - i);
  9. }
  10. return (long long)round(expl(acc));
  11. }
  12.  
  13. long long euler_15(int n) {
  14. return combination(2 * n, n);
  15. }
  16.  
  17. int main(void) {
  18. printf("%lld\n", euler_15(20));
  19. return EXIT_SUCCESS;
  20. }
  21.  
Success #stdin #stdout 0s 5504KB
stdin
Standard input is empty
stdout
137846528820