結果

問題 No.1208 anti primenumber game
ユーザー gew1fw
提出日時 2025-06-12 18:00:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 119,168 KB
最終ジャッジ日時 2025-06-12 18:01:01
合計ジャッジ時間 4,544 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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]))
    
    total = 0
    for i in range(N):
        a = A[i]
        if a == 0:
            d = 0
        elif a == 1:
            d = 1 - M
        else:
            if M == 0:
                d = a
            else:
                d = a - 2 + M
        
        if (i % 2) == 0:  # 1-based index i+1 is odd (0-based even)
            total += d
        else:
            total -= d
    
    if total > 0:
        print("First")
    else:
        print("Second")

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