fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. const int MAXN = 5e2+5;
  5.  
  6. int n, m;
  7.  
  8. void f (int m){
  9. int dp[m+1];
  10.  
  11. dp[0] = dp[1] =1;
  12. for (int i =2; i <= m; i++){
  13. dp[i] =0;
  14. cout << dp[i] << endl;
  15. for (int j =1; j <= i; j++){
  16. cout << j << endl;
  17. dp[i] += dp[j-1] * dp[i-j];
  18. }
  19. }
  20. // return dp[m];
  21. }
  22. signed main(){
  23. cin >> n;
  24. m = n/2;
  25. // cout << f(m) << endl;
  26. f(m);
  27. }
Success #stdin #stdout 0.01s 5284KB
stdin
2
stdout
Standard output is empty