結果
問題 | No.973 余興 |
ユーザー | pekempey |
提出日時 | 2020-01-17 22:19:52 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,199 bytes |
コンパイル時間 | 1,810 ms |
コンパイル使用メモリ | 172,008 KB |
実行使用メモリ | 296,940 KB |
最終ジャッジ日時 | 2023-09-08 04:05:16 |
合計ジャッジ時間 | 94,361 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2,711 ms
296,620 KB |
testcase_01 | AC | 2,742 ms
296,476 KB |
testcase_02 | AC | 2,753 ms
296,468 KB |
testcase_03 | AC | 2,723 ms
296,316 KB |
testcase_04 | AC | 2,733 ms
296,568 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 2,614 ms
284,920 KB |
testcase_11 | AC | 864 ms
108,836 KB |
testcase_12 | AC | 856 ms
108,872 KB |
testcase_13 | WA | - |
testcase_14 | AC | 864 ms
108,100 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 44 ms
10,764 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 77 ms
15,292 KB |
testcase_23 | AC | 61 ms
13,068 KB |
testcase_24 | AC | 59 ms
12,880 KB |
testcase_25 | AC | 26 ms
7,908 KB |
testcase_26 | AC | 43 ms
10,448 KB |
testcase_27 | AC | 90 ms
16,672 KB |
testcase_28 | WA | - |
testcase_29 | AC | 58 ms
12,644 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 2,763 ms
295,192 KB |
testcase_35 | AC | 2,782 ms
296,744 KB |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | AC | 2,844 ms
295,808 KB |
testcase_39 | WA | - |
testcase_40 | AC | 2 ms
4,380 KB |
testcase_41 | AC | 1 ms
4,376 KB |
testcase_42 | AC | 1 ms
4,376 KB |
testcase_43 | WA | - |
testcase_44 | AC | 2 ms
4,380 KB |
testcase_45 | WA | - |
testcase_46 | AC | 2,292 ms
296,628 KB |
testcase_47 | WA | - |
testcase_48 | AC | 2,216 ms
296,536 KB |
testcase_49 | WA | - |
testcase_50 | AC | 2,201 ms
294,628 KB |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | AC | 2,939 ms
291,840 KB |
testcase_54 | AC | 3,013 ms
296,584 KB |
testcase_55 | AC | 3,072 ms
296,668 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() int main() { int N; cin >> N; ll X; cin >> X; vector<ll> A(N); rep(i, N) cin >> A[i]; vector<ll> S(N + 1); rep(i, N) S[i + 1] = S[i] + A[i]; vector<ll> R(N + 1); repr(i, N) R[i] = R[i + 1] + A[i]; vector<vector<int>> dp(N, vector<int>(N)); vector<vector<int>> eplr(N, vector<int>(N)); vector<vector<int>> eprl(N, vector<int>(N)); for (int d = 1; d <= N - 1; d++) { for (int l = 0; l + d <= N - 1; l++) { int r = l + d; // dpl[l][r]...dpl[x][r] -> 0 // dpr[l][y]...dpr[l][r] -> 0 int x = upper_bound(range(S), X + S[l]) - S.begin() - 2; int y = R.rend() - upper_bound(R.rbegin(), R.rend(), X + R[r + 1]) + 2; if (eprl[r][l] - eprl[r][x] + dp[r][x] != x - l + 1) { dp[l][r] = 1; } if (eplr[l][r] - eplr[l][y] + dp[l][y] != r - y + 1) { dp[l][r] = 1; } eplr[l][r] = dp[l][r] + eplr[l][r - 1]; eprl[r][l] = dp[l][r] + eprl[r][l + 1]; } } cout << (dp[0][N - 1] ? "A" : "B") << endl; }