結果
問題 | No.1267 Stop and Coin Game |
ユーザー |
![]() |
提出日時 | 2025-03-24 06:30:55 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 463 bytes |
コンパイル時間 | 524 ms |
コンパイル使用メモリ | 81,788 KB |
実行使用メモリ | 85,568 KB |
最終ジャッジ日時 | 2025-03-24 06:31:00 |
合計ジャッジ時間 | 5,157 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 TLE * 1 -- * 36 |
ソースコード
N, V = map(int, input().split()) A = list(map(int, input().split())) def f(v, used) -> bool: win = False for i in range(N): if used[i]: continue if v - A[i] < 0: continue used[i] = True win = not f(v - A[i], used) used[i] = False if win: return True return win if sum(A) <= V: print('Draw') exit(0) used = [False] * N win = f(V, used) if win: print('First') else: print('Second')