結果

問題 No.1208 anti primenumber game
ユーザー gew1fw
提出日時 2025-06-12 17:59:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 107,548 KB
最終ジャッジ日時 2025-06-12 17:59:53
合計ジャッジ時間 4,981 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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

current_total = 0
current_player = True  # True represents the first player

for a in A:
    if a == 0:
        diff_original = 0
    elif a == 1:
        diff_original = 1 - M
    else:
        option1 = a - M
        option2 = a - 2 + M
        diff_original = max(option1, option2)
    
    if current_player:
        diff = diff_original
    else:
        diff = -diff_original
    
    current_total += diff
    
    # Update the current player based on the original difference's sign
    if diff_original > 0:
        current_player = not current_player

if current_total > 0:
    print("First")
else:
    print("Second")
0