結果

問題 No.1208 anti primenumber game
ユーザー lam6er
提出日時 2025-04-16 15:37:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 645 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 81,408 KB
実行使用メモリ 107,648 KB
最終ジャッジ日時 2025-04-16 15:42:25
合計ジャッジ時間 5,441 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = list(map(int, input().split()))

current_turn = True  # True for First player's turn
total = 0

for num in a:
    if num == 0:
        continue
    elif num == 1:
        diff = (1 - m) if current_turn else -(1 - m)
        total += diff
        current_turn = not current_turn
    else:
        if m <= 1:
            diff_val = num - m
        else:
            diff_val = num - 2 + m
        if current_turn:
            total += diff_val
        else:
            total -= diff_val
        if m <= 1:
            current_turn = not current_turn

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