結果

問題 No.1208 anti primenumber game
ユーザー marroncastlemarroncastle
提出日時 2020-08-30 17:03:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,852 KB
最終ジャッジ日時 2024-04-27 11:16:53
合計ジャッジ時間 7,940 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 34 ms
10,880 KB
testcase_05 AC 32 ms
10,880 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 30 ms
10,880 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 31 ms
10,752 KB
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 105 ms
13,980 KB
testcase_16 AC 102 ms
14,056 KB
testcase_17 AC 103 ms
14,056 KB
testcase_18 AC 103 ms
14,036 KB
testcase_19 AC 132 ms
16,980 KB
testcase_20 AC 124 ms
16,988 KB
testcase_21 AC 183 ms
20,076 KB
testcase_22 AC 181 ms
20,212 KB
testcase_23 AC 156 ms
20,056 KB
testcase_24 AC 252 ms
32,720 KB
testcase_25 AC 244 ms
32,724 KB
testcase_26 AC 252 ms
32,848 KB
testcase_27 AC 248 ms
32,852 KB
testcase_28 AC 246 ms
32,724 KB
testcase_29 AC 251 ms
32,848 KB
testcase_30 AC 120 ms
20,564 KB
testcase_31 AC 145 ms
21,588 KB
testcase_32 AC 122 ms
19,924 KB
testcase_33 AC 174 ms
22,136 KB
testcase_34 AC 164 ms
14,056 KB
testcase_35 AC 166 ms
14,056 KB
testcase_36 AC 151 ms
18,180 KB
testcase_37 AC 213 ms
23,384 KB
testcase_38 AC 219 ms
27,296 KB
testcase_39 AC 222 ms
27,500 KB
testcase_40 AC 250 ms
32,092 KB
testcase_41 AC 160 ms
22,420 KB
testcase_42 AC 199 ms
23,420 KB
testcase_43 AC 193 ms
23,304 KB
testcase_44 AC 180 ms
22,784 KB
testcase_45 AC 175 ms
22,772 KB
testcase_46 AC 169 ms
21,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
  N, M = map(int, input().split())
  A = list(map(int, input().split()))[::-1]
  first = [0]*N
  remain = A[0]-1-(1-M)
  get_all = A[0]-M
  if A[0]>1:
    if M==0:
      first[0] = get_all
    else:
      first[0] = remain
  else:
    first[0] = get_all
  for i in range(1,N):
    remain = A[i]-1-(1-M)
    get_all = A[i]-M
    if A[i]>1:
      first[i] = max(first[i-1]+remain,-first[i-1]+get_all)
    else:
      first[i] = -first[i-1]+get_all
  if first[-1]>0:
    return 'First'
  return 'Second'
print(solve())
0