結果

問題 No.1208 anti primenumber game
ユーザー H3PO4
提出日時 2022-01-15 09:10:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 283 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 29,524 KB
最終ジャッジ日時 2024-11-21 06:15:00
合計ジャッジ時間 9,288 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

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

dp = 0
for a in reversed(A):
    new_dp = a - M - dp
    if a > 1:
        new_dp = max(new_dp, a - 1 + M - 1 + dp)
    dp = new_dp
print("First" if dp > 0 else "Second")
0