fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long n, x;
  6. cin >> n >> x;
  7. long x_val = x;
  8. long n_val = 1;
  9. long res = x;
  10. for (int i = 2; i <= n; i++) {
  11. x_val *= x;
  12. n_val *= i;
  13. res += x_val / n_val;
  14. }
  15. cout << res;
  16. return 0;
  17. }
Runtime error #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty