結果

問題 No.1208 anti primenumber game
ユーザー gew1fw
提出日時 2025-06-12 12:47:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,600 KB
実行使用メモリ 119,316 KB
最終ジャッジ日時 2025-06-12 12:48:31
合計ジャッジ時間 5,262 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    M = int(input[1])
    A = list(map(int, input[2:2+N]))
    
    sum_diff = 0
    for idx in range(N):
        a = A[idx]
        if a == 0:
            f = 0
        elif a == 1:
            f = 1 - M
        else:
            if M >= 1:
                f = (a - 2) + M
            else:
                f = a
        if idx % 2 == 0:
            sum_diff += f
        else:
            sum_diff -= f
    
    if sum_diff > 0:
        print("First")
    else:
        print("Second")

if __name__ == "__main__":
    main()
0