結果

問題 No.1208 anti primenumber game
ユーザー 37zigen37zigen
提出日時 2020-08-30 14:47:18
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 31,112 KB
最終ジャッジ日時 2023-08-09 12:38:52
合計ジャッジ時間 11,191 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 14 ms
7,716 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 AC 15 ms
7,916 KB
testcase_05 AC 15 ms
7,816 KB
testcase_06 AC 15 ms
7,796 KB
testcase_07 AC 15 ms
7,732 KB
testcase_08 AC 15 ms
7,856 KB
testcase_09 AC 15 ms
7,808 KB
testcase_10 AC 16 ms
7,876 KB
testcase_11 AC 16 ms
7,816 KB
testcase_12 AC 15 ms
7,864 KB
testcase_13 AC 16 ms
7,708 KB
testcase_14 AC 15 ms
7,816 KB
testcase_15 AC 167 ms
12,028 KB
testcase_16 AC 174 ms
12,136 KB
testcase_17 AC 175 ms
12,092 KB
testcase_18 AC 170 ms
11,976 KB
testcase_19 AC 188 ms
16,216 KB
testcase_20 AC 175 ms
14,620 KB
testcase_21 AC 258 ms
17,412 KB
testcase_22 AC 264 ms
17,420 KB
testcase_23 AC 230 ms
17,604 KB
testcase_24 AC 329 ms
31,112 KB
testcase_25 AC 346 ms
31,112 KB
testcase_26 AC 341 ms
31,056 KB
testcase_27 AC 349 ms
30,948 KB
testcase_28 AC 339 ms
30,900 KB
testcase_29 AC 353 ms
30,944 KB
testcase_30 AC 178 ms
17,876 KB
testcase_31 AC 187 ms
19,112 KB
testcase_32 AC 183 ms
17,692 KB
testcase_33 AC 260 ms
19,752 KB
testcase_34 AC 276 ms
11,980 KB
testcase_35 AC 276 ms
11,976 KB
testcase_36 AC 225 ms
15,144 KB
testcase_37 AC 310 ms
20,852 KB
testcase_38 AC 296 ms
24,540 KB
testcase_39 AC 305 ms
24,692 KB
testcase_40 AC 324 ms
30,396 KB
testcase_41 AC 201 ms
20,260 KB
testcase_42 AC 294 ms
20,840 KB
testcase_43 AC 276 ms
20,568 KB
testcase_44 AC 252 ms
19,944 KB
testcase_45 AC 245 ms
19,876 KB
testcase_46 AC 227 ms
18,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=list(map(int,input().split()))
dp=[-10**20]*(N+1)
dp[N]=0
for i in range(N-1,-1,-1):
    dp[i]=max(dp[i],A[i]-M-dp[i+1]) # 全部取る
    if A[i]>1:
        dp[i]=max(dp[i],A[i]-1-(1-M)+dp[i+1]) # 1つ残す
if dp[0]>0:
    print("First")
else:
    print("Second")
0