結果

問題 No.1267 Stop and Coin Game
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-10-24 00:58:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 85,924 KB
最終ジャッジ日時 2023-09-28 19:51:32
合計ジャッジ時間 7,837 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,344 KB
testcase_01 AC 74 ms
71,360 KB
testcase_02 WA -
testcase_03 AC 74 ms
71,368 KB
testcase_04 AC 75 ms
71,300 KB
testcase_05 AC 75 ms
71,436 KB
testcase_06 AC 73 ms
71,328 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 74 ms
71,180 KB
testcase_10 WA -
testcase_11 AC 159 ms
79,780 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,180 KB
testcase_14 AC 73 ms
71,296 KB
testcase_15 AC 81 ms
75,900 KB
testcase_16 AC 453 ms
85,680 KB
testcase_17 AC 74 ms
71,488 KB
testcase_18 AC 95 ms
76,328 KB
testcase_19 AC 74 ms
71,328 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 93 ms
76,640 KB
testcase_23 AC 74 ms
71,128 KB
testcase_24 AC 107 ms
81,568 KB
testcase_25 WA -
testcase_26 AC 73 ms
71,284 KB
testcase_27 AC 74 ms
71,616 KB
testcase_28 AC 74 ms
71,276 KB
testcase_29 AC 89 ms
76,328 KB
testcase_30 AC 97 ms
84,656 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 85 ms
80,184 KB
testcase_34 AC 282 ms
82,200 KB
testcase_35 AC 79 ms
79,316 KB
testcase_36 AC 75 ms
71,364 KB
testcase_37 WA -
testcase_38 AC 566 ms
85,900 KB
testcase_39 AC 118 ms
78,304 KB
testcase_40 AC 73 ms
71,124 KB
testcase_41 AC 119 ms
78,244 KB
testcase_42 AC 75 ms
71,124 KB
testcase_43 WA -
testcase_44 AC 74 ms
71,280 KB
testcase_45 AC 74 ms
71,128 KB
testcase_46 AC 74 ms
71,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, v = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) <= v:
    exit(print("Draw"))
dp = [-1] * (1 << n)
def dfs(S, t):
    if t > v:
        dp[S] = 0
        return 0
    if dp[S] != -1:
        return dp[S]
    res = 0
    for i in range(n):
        if (1 << i) & S:
            continue
        res |= dfs((1 << i) | S, t + a[i])
    dp[S] = res
    return res
if dfs(0, 0):
    print("Second")
else:
    print("First")
0