結果

問題 No.1208 anti primenumber game
ユーザー titia
提出日時 2020-08-30 15:11:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 33,736 KB
最終ジャッジ日時 2024-11-15 08:39:52
合計ジャッジ時間 7,217 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

A.sort(reverse=True)

S=0
G=0
NOW=0
for i in range(N):
    if A[i]==1:
        break
    if i%2==0:
        S+=A[i]-1
        NOW=1
    else:
        G+=A[i]-1
        NOW=0

if N%2==1 and NOW==0:
    S-=M-1
elif N%2==1 and NOW==1:
    G-=M-1

if S>G:
    print("First")
else:
    print("Second")
0