結果
問題 |
No.1208 anti primenumber game
|
ユーザー |
![]() |
提出日時 | 2020-08-30 15:17:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 410 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 33,760 KB |
最終ジャッジ日時 | 2024-11-15 08:49:57 |
合計ジャッジ時間 | 7,203 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 WA * 8 |
ソースコード
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 if M==0: for i in range(N): if i%2==0: S+=A[i] else: G+=A[i] else: 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")