結果
問題 | No.973 余興 |
ユーザー | tekihei2317 |
提出日時 | 2020-01-17 22:56:00 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 767 bytes |
コンパイル時間 | 1,582 ms |
コンパイル使用メモリ | 171,520 KB |
実行使用メモリ | 8,848 KB |
最終ジャッジ日時 | 2023-09-08 06:18:53 |
合計ジャッジ時間 | 11,786 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 366 ms
6,752 KB |
testcase_01 | AC | 376 ms
6,480 KB |
testcase_02 | AC | 361 ms
6,412 KB |
testcase_03 | AC | 374 ms
6,444 KB |
testcase_04 | AC | 380 ms
6,488 KB |
testcase_05 | AC | 368 ms
6,748 KB |
testcase_06 | AC | 379 ms
6,604 KB |
testcase_07 | AC | 381 ms
6,552 KB |
testcase_08 | AC | 373 ms
6,612 KB |
testcase_09 | AC | 386 ms
6,532 KB |
testcase_10 | AC | 358 ms
6,388 KB |
testcase_11 | TLE | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
ソースコード
#include<bits/stdc++.h> using namespace std; using Lint=long long; int main() { int N,X; cin>>N>>X; vector<int> a(N); for(int i=0;i<N;i++) cin>>a[i]; vector<vector<bool>> dp(N+1,vector<bool>(N+1)); for(int i=0;i<=N;i++) dp[i][i]=true; for(int len=1;len<=N;len++){ for(int l=0;l+len<=N;l++){ int r=l+len; Lint sum=0; for(int i=l;i<r;i++){ sum+=a[i]; if(sum>X) break; // dp[l][r]|=!dp[i+1][r]; if(!dp[i+1][r]) dp[l][r]=true; } sum=0; for(int i=r-1;i>=l;i--){ sum+=a[i]; if(sum>X) break; // dp[l][r]|=!dp[l][i]; if(!dp[l][i]) dp[l][r]=true; } } } cout<<(dp[0][N]? 'A':'B')<<endl; return 0; }