結果

問題 No.1208 anti primenumber game
ユーザー marroncastlemarroncastle
提出日時 2020-08-30 17:03:36
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 10,976 KB
実行使用メモリ 30,052 KB
最終ジャッジ日時 2023-08-09 16:31:29
合計ジャッジ時間 6,911 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 15 ms
7,960 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 15 ms
7,824 KB
testcase_06 AC 15 ms
7,796 KB
testcase_07 AC 15 ms
7,860 KB
testcase_08 AC 16 ms
7,796 KB
testcase_09 AC 16 ms
7,800 KB
testcase_10 AC 16 ms
7,976 KB
testcase_11 AC 16 ms
7,836 KB
testcase_12 AC 15 ms
7,876 KB
testcase_13 AC 15 ms
7,852 KB
testcase_14 AC 17 ms
7,800 KB
testcase_15 AC 85 ms
11,432 KB
testcase_16 AC 81 ms
11,476 KB
testcase_17 AC 80 ms
11,440 KB
testcase_18 AC 79 ms
11,436 KB
testcase_19 AC 97 ms
14,272 KB
testcase_20 AC 88 ms
14,312 KB
testcase_21 AC 133 ms
17,584 KB
testcase_22 AC 131 ms
17,556 KB
testcase_23 AC 118 ms
17,500 KB
testcase_24 AC 189 ms
30,052 KB
testcase_25 AC 189 ms
29,940 KB
testcase_26 AC 184 ms
30,032 KB
testcase_27 AC 188 ms
29,896 KB
testcase_28 AC 188 ms
30,016 KB
testcase_29 AC 190 ms
29,996 KB
testcase_30 AC 92 ms
17,672 KB
testcase_31 AC 103 ms
18,892 KB
testcase_32 AC 91 ms
17,248 KB
testcase_33 AC 133 ms
19,488 KB
testcase_34 AC 127 ms
11,436 KB
testcase_35 AC 124 ms
11,380 KB
testcase_36 AC 110 ms
15,420 KB
testcase_37 AC 160 ms
20,520 KB
testcase_38 AC 170 ms
24,260 KB
testcase_39 AC 174 ms
24,668 KB
testcase_40 AC 194 ms
29,428 KB
testcase_41 AC 120 ms
19,800 KB
testcase_42 AC 149 ms
20,972 KB
testcase_43 AC 144 ms
20,688 KB
testcase_44 AC 134 ms
20,016 KB
testcase_45 AC 135 ms
20,052 KB
testcase_46 AC 130 ms
18,420 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