結果

問題 No.1208 anti primenumber game
ユーザー tktk_snsntktk_snsn
提出日時 2021-02-11 22:37:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 106,636 KB
最終ジャッジ日時 2023-09-25 12:26:31
合計ジャッジ時間 8,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,224 KB
testcase_01 AC 71 ms
71,316 KB
testcase_02 AC 71 ms
71,316 KB
testcase_03 AC 72 ms
71,156 KB
testcase_04 AC 70 ms
71,472 KB
testcase_05 AC 70 ms
71,028 KB
testcase_06 AC 70 ms
71,376 KB
testcase_07 AC 72 ms
71,272 KB
testcase_08 AC 71 ms
71,364 KB
testcase_09 AC 69 ms
71,348 KB
testcase_10 AC 69 ms
71,024 KB
testcase_11 AC 71 ms
71,324 KB
testcase_12 AC 70 ms
71,264 KB
testcase_13 AC 70 ms
71,252 KB
testcase_14 AC 70 ms
71,068 KB
testcase_15 AC 108 ms
105,844 KB
testcase_16 AC 106 ms
106,076 KB
testcase_17 AC 107 ms
105,884 KB
testcase_18 AC 105 ms
106,136 KB
testcase_19 AC 105 ms
105,764 KB
testcase_20 AC 106 ms
105,888 KB
testcase_21 AC 111 ms
106,076 KB
testcase_22 AC 116 ms
106,112 KB
testcase_23 AC 114 ms
106,228 KB
testcase_24 AC 128 ms
104,780 KB
testcase_25 AC 127 ms
104,876 KB
testcase_26 AC 129 ms
104,152 KB
testcase_27 AC 127 ms
104,000 KB
testcase_28 AC 129 ms
104,296 KB
testcase_29 AC 129 ms
104,172 KB
testcase_30 AC 112 ms
106,092 KB
testcase_31 AC 110 ms
106,008 KB
testcase_32 AC 112 ms
105,832 KB
testcase_33 AC 112 ms
105,976 KB
testcase_34 AC 106 ms
106,096 KB
testcase_35 AC 105 ms
106,064 KB
testcase_36 AC 101 ms
99,280 KB
testcase_37 AC 109 ms
105,948 KB
testcase_38 AC 137 ms
101,324 KB
testcase_39 AC 133 ms
101,264 KB
testcase_40 AC 131 ms
104,244 KB
testcase_41 AC 111 ms
106,420 KB
testcase_42 AC 121 ms
106,636 KB
testcase_43 AC 112 ms
106,612 KB
testcase_44 AC 117 ms
106,592 KB
testcase_45 AC 112 ms
106,576 KB
testcase_46 AC 108 ms
102,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = list(map(int, input().split()))
inf = 10 ** 18

dp = [-inf] * (N + 1)
dp[0] = 0
A.reverse()
for i, a in enumerate(A, 1):
    dp[i] = max(dp[i], a - M - dp[i - 1])
    if a > 1:
        dp[i] = max(dp[i], (a - 1) + (M - 1) + dp[i - 1])

if dp[N] > 0:
    print("First")
else:
    print("Second")
0