結果

問題 No.1267 Stop and Coin Game
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-10-23 23:08:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 452 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 86,056 KB
最終ジャッジ日時 2023-09-28 17:48:50
合計ジャッジ時間 8,359 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,236 KB
testcase_01 AC 74 ms
71,328 KB
testcase_02 AC 73 ms
71,348 KB
testcase_03 AC 74 ms
71,296 KB
testcase_04 AC 74 ms
71,260 KB
testcase_05 AC 74 ms
71,056 KB
testcase_06 AC 75 ms
71,456 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 77 ms
71,376 KB
testcase_10 WA -
testcase_11 AC 170 ms
79,652 KB
testcase_12 WA -
testcase_13 AC 74 ms
71,432 KB
testcase_14 AC 75 ms
71,244 KB
testcase_15 AC 88 ms
75,904 KB
testcase_16 AC 471 ms
85,928 KB
testcase_17 AC 75 ms
71,264 KB
testcase_18 AC 97 ms
76,296 KB
testcase_19 AC 73 ms
71,376 KB
testcase_20 AC 75 ms
71,220 KB
testcase_21 AC 74 ms
71,436 KB
testcase_22 AC 91 ms
76,588 KB
testcase_23 AC 73 ms
71,400 KB
testcase_24 AC 108 ms
81,248 KB
testcase_25 WA -
testcase_26 AC 75 ms
71,204 KB
testcase_27 AC 74 ms
71,704 KB
testcase_28 AC 73 ms
71,196 KB
testcase_29 AC 88 ms
76,192 KB
testcase_30 AC 97 ms
84,896 KB
testcase_31 WA -
testcase_32 AC 75 ms
72,244 KB
testcase_33 AC 88 ms
80,548 KB
testcase_34 AC 303 ms
82,076 KB
testcase_35 AC 78 ms
79,708 KB
testcase_36 AC 73 ms
71,436 KB
testcase_37 WA -
testcase_38 AC 580 ms
86,032 KB
testcase_39 AC 121 ms
78,232 KB
testcase_40 AC 74 ms
71,268 KB
testcase_41 AC 119 ms
78,484 KB
testcase_42 AC 74 ms
71,544 KB
testcase_43 WA -
testcase_44 AC 76 ms
79,572 KB
testcase_45 AC 73 ms
71,224 KB
testcase_46 AC 73 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(s, total):
    if total > V:
        dp[s] = 0
        return 0
    if dp[s] != -1:
        return dp[s]
    R = 0
    for i in range(N):
        if (1<<i) & s:
            continue
        c = f((1<<i)|s, total+X[i])
        R = R|c
    dp[s] = R
    return not R


N, V = map(int, input().split())
X = list(map(int, input().split()))
dp = [-1]*(2**N)
if sum(X) <= V:
    print("Draw")
elif f(0, 0):
    print("Second")
else:
    print("First")
0