結果

問題 No.973 余興
ユーザー titiatitia
提出日時 2020-02-09 04:35:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,001 ms / 4,000 ms
コード長 633 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 272,496 KB
最終ジャッジ日時 2024-04-08 11:54:55
合計ジャッジ時間 32,306 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 957 ms
272,240 KB
testcase_01 AC 1,001 ms
272,496 KB
testcase_02 AC 972 ms
272,112 KB
testcase_03 AC 944 ms
272,240 KB
testcase_04 AC 958 ms
272,240 KB
testcase_05 AC 979 ms
272,240 KB
testcase_06 AC 934 ms
272,368 KB
testcase_07 AC 923 ms
272,240 KB
testcase_08 AC 991 ms
271,600 KB
testcase_09 AC 971 ms
272,368 KB
testcase_10 AC 942 ms
264,176 KB
testcase_11 AC 304 ms
136,560 KB
testcase_12 AC 291 ms
136,560 KB
testcase_13 AC 295 ms
136,560 KB
testcase_14 AC 281 ms
136,560 KB
testcase_15 AC 101 ms
83,252 KB
testcase_16 AC 102 ms
83,624 KB
testcase_17 AC 87 ms
80,220 KB
testcase_18 AC 100 ms
81,896 KB
testcase_19 AC 98 ms
81,748 KB
testcase_20 AC 89 ms
80,224 KB
testcase_21 AC 107 ms
83,372 KB
testcase_22 AC 106 ms
83,372 KB
testcase_23 AC 92 ms
81,740 KB
testcase_24 AC 95 ms
81,744 KB
testcase_25 AC 71 ms
73,048 KB
testcase_26 AC 90 ms
80,240 KB
testcase_27 AC 112 ms
85,144 KB
testcase_28 AC 95 ms
81,736 KB
testcase_29 AC 98 ms
81,624 KB
testcase_30 AC 803 ms
272,112 KB
testcase_31 AC 792 ms
271,984 KB
testcase_32 AC 795 ms
272,112 KB
testcase_33 AC 814 ms
271,856 KB
testcase_34 AC 833 ms
270,704 KB
testcase_35 AC 822 ms
271,984 KB
testcase_36 AC 760 ms
251,248 KB
testcase_37 AC 763 ms
251,248 KB
testcase_38 AC 815 ms
270,960 KB
testcase_39 AC 811 ms
271,472 KB
testcase_40 AC 37 ms
53,460 KB
testcase_41 AC 37 ms
53,460 KB
testcase_42 AC 37 ms
53,460 KB
testcase_43 AC 37 ms
53,460 KB
testcase_44 AC 37 ms
53,460 KB
testcase_45 AC 56 ms
64,196 KB
testcase_46 AC 844 ms
271,984 KB
testcase_47 AC 876 ms
271,856 KB
testcase_48 AC 855 ms
271,984 KB
testcase_49 AC 782 ms
251,248 KB
testcase_50 AC 847 ms
270,064 KB
testcase_51 AC 864 ms
271,984 KB
testcase_52 AC 777 ms
271,984 KB
testcase_53 AC 723 ms
268,144 KB
testcase_54 AC 748 ms
271,984 KB
testcase_55 AC 783 ms
271,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,X=map(int,input().split())
A=list(map(int,input().split()))

DP=[[0]*N for i in range(N)]

for l in range(N-1):
    for i in range(N-l):
        j=i+l
        if DP[i][j]==0:
            w=0
            for k in range(j+1,N):
                w+=A[k]
                if w<=X:
                    DP[i][k]=1
                else:
                    break

            w=0
            for k in range(i-1,-1,-1):
                w+=A[k]
                if w<=X:
                    DP[k][j]=1
                else:
                    break

if DP[0][N-1]==1:
    print("A")
else:
    print("B")
0