結果
問題 | No.1208 anti primenumber game |
ユーザー |
|
提出日時 | 2020-08-30 17:03:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 258 ms / 2,000 ms |
コード長 | 528 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 32,724 KB |
最終ジャッジ日時 | 2024-11-15 12:45:53 |
合計ジャッジ時間 | 8,025 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
def solve():N, M = map(int, input().split())A = list(map(int, input().split()))[::-1]first = [0]*Nremain = A[0]-1-(1-M)get_all = A[0]-Mif A[0]>1:if M==0:first[0] = get_allelse:first[0] = remainelse:first[0] = get_allfor i in range(1,N):remain = A[i]-1-(1-M)get_all = A[i]-Mif A[i]>1:first[i] = max(first[i-1]+remain,-first[i-1]+get_all)else:first[i] = -first[i-1]+get_allif first[-1]>0:return 'First'return 'Second'print(solve())