fork download
  1. REP (i, N) {
  2. newt[i][0] = newt[i][i] = 1;
  3. }
  4. RE (i, N - 1) {
  5. FOR (j, 1, i - 1) {
  6. newt[i][j] = (newt[i - 1][j] + newt[i - 1][j - 1]) % P;
  7. }
  8. }
  9. make2(int, n, k);
  10. int ans = 0;
  11. dp[1][1][1] = 1;
  12. pref[1][1][1] = 1;
  13. RE (check, n) {
  14. int c = check % 2;
  15. FOR (all, 1, n) {
  16. if (check == 1 && all == 1) { continue; }
  17. RE (ord, all) {
  18. dp[all][ord][c] = (pref[all - 1][ord - 1][c] + pref[all - 1][all - 1][c ^ 1] - pref[all - 1][ord - 1][c ^ 1] + P) % P;
  19. debug4(all, ord, check, dp[all][ord][c]);
  20. pref[all][ord][c] = (pref[all][ord - 1][c] + dp[all][ord][c]);
  21. }
  22. }
  23. RE (o1, k) {
  24. RE (o2, n - k + 1) {
  25. ans += dp[k][o1][c] * dp[n - k + 1][o2][c] % P * newt[o1 + o2 - 2][o1 - 1] % P * newt[n + 1 - o1 - o2][k - o1] % P;
  26. ans %= P;
  27. }
  28. }
  29. debug2(check, ans);
  30. }
  31. cout<<ans<<"\n";
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:5: error: expected constructor, destructor, or type conversion before '(' token
 REP (i, N) {
     ^
prog.cpp:4:6: error: expected constructor, destructor, or type conversion before '(' token
   RE (i, N - 1) {
      ^
stdout
Standard output is empty