結果
問題 | No.973 余興 |
ユーザー | neterukun |
提出日時 | 2020-01-19 16:17:15 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 867 bytes |
コンパイル時間 | 1,296 ms |
コンパイル使用メモリ | 86,888 KB |
実行使用メモリ | 282,296 KB |
最終ジャッジ日時 | 2023-09-15 20:16:07 |
合計ジャッジ時間 | 46,751 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | AC | 2,475 ms
105,588 KB |
testcase_16 | AC | 1,185 ms
91,356 KB |
testcase_17 | AC | 651 ms
86,556 KB |
testcase_18 | AC | 877 ms
88,268 KB |
testcase_19 | AC | 2,014 ms
94,052 KB |
testcase_20 | AC | 632 ms
85,228 KB |
testcase_21 | AC | 1,157 ms
90,688 KB |
testcase_22 | AC | 1,158 ms
90,384 KB |
testcase_23 | AC | 889 ms
88,420 KB |
testcase_24 | AC | 743 ms
88,104 KB |
testcase_25 | AC | 739 ms
85,100 KB |
testcase_26 | AC | 627 ms
85,264 KB |
testcase_27 | AC | 3,627 ms
113,820 KB |
testcase_28 | AC | 1,946 ms
98,112 KB |
testcase_29 | AC | 860 ms
88,408 KB |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | AC | 71 ms
71,004 KB |
testcase_41 | AC | 72 ms
71,000 KB |
testcase_42 | AC | 71 ms
70,760 KB |
testcase_43 | AC | 73 ms
71,156 KB |
testcase_44 | AC | 70 ms
71,216 KB |
testcase_45 | AC | 115 ms
78,328 KB |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
ソースコード
import sys sys.setrecursionlimit = 10**5 n, x = map(int, input().split()) a = list(map(int, input().split())) ruiseki = [0] * (n + 1) for i in range(n): ruiseki[i + 1] = ruiseki[i] + a[i] def solve(l, r): # [l, r)のシュークリームが残っているときの先手の勝ち負け if r - l == 0: dp[l][r] = True return True if r - l == 1: dp[l][r] = False return False if dp[l][r] is not None: return dp[l][r] tmp = False for newl in range(l + 1, r + 1): if ruiseki[newl] - ruiseki[l] <= x: tmp |= not solve(newl, r) for newr in range(l, r): if ruiseki[r] - ruiseki[newr] <= x: tmp |= not solve(l, newr) dp[l][r] = tmp return tmp dp = [[None] * (n + 1) for i in range(n + 1)] if solve(0, n): print("A") else: print("B")