QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#481349#9128. Priority Queue 3ucup-team3215Compile Error//C++20884b2024-07-17 04:33:492024-07-17 04:33:49

Judging History

你现在查看的是最新测评结果

  • [2024-07-17 04:33:49]
  • 评测
  • [2024-07-17 04:33:49]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

constexpr int N = 301, mod = 998244353;

uint64_t dp[N][N][N]{1};

int main() {
  int n, m; cin >> n >> m;
  string s; cin >> s;
  vector<int> a(m);
  for (auto& a: a) cin >> a;
  for (int i = 0, d = 0; i < n + m; d += s[i++] == '-')
  for (int l = d + 1; l--; ) if (s[i] == '+') {
    for (int c = i - d + 1; c-- > d; )
    for (int t = 0; t <= c - l; ++t) (dp[l][c + 1][t + 1] += exchange(dp[l][c][t], dp[l][c][t] * max(0, n - (l == m? 0: a[m - 1 - l]) - l - i + d + c) % mod)) %= mod;
  } else {
    for (auto j = 1ull, A = j; j <= d + 1 - l; (A *= d + 1 - l - j++) % mod)
    for (auto t = 1ull; t <= d + 1 - l; ++t) (dp[l + j][d + 1][0] += t * A % mod * dp[l][d + 1][t]) %= mod;
    for (int t = 1; t <= d + 1 - l; ++t) (dp[l][d + 1][0] += exchange(dp[l][d + 1][t], 0)) %= mod;
  }
  cout << dp[m][m][0];
}

Details

/tmp/cc2POQp1.s: Assembler messages:
/tmp/cc2POQp1.s: Fatal error: can't write 8 bytes to section .data of /tmp/cc5Awyo3.o: 'File too large'
/tmp/cc2POQp1.s: Fatal error: can't close /tmp/cc5Awyo3.o: File too large