結果

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

ソースコード

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]))
    
    if M > 1:
        total = 0
        for a in A:
            if a == 1:
                total += (1 - M)
            else:
                total += (a - 2 + M)
        print("First" if total > 0 else "Second")
    else:
        total = 0
        sign = 1
        for a in A:
            contribution = (a - M) * sign
            total += contribution
            sign *= -1
        print("First" if total > 0 else "Second")

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