結果

問題 No.1208 anti primenumber game
ユーザー Example0911Example0911
提出日時 2020-09-03 19:07:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 165,780 KB
実行使用メモリ 6,456 KB
最終ジャッジ日時 2023-08-15 14:18:51
合計ジャッジ時間 7,340 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,388 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 28 ms
6,344 KB
testcase_16 AC 29 ms
6,344 KB
testcase_17 AC 29 ms
6,456 KB
testcase_18 AC 28 ms
6,188 KB
testcase_19 AC 28 ms
6,140 KB
testcase_20 AC 29 ms
6,196 KB
testcase_21 AC 31 ms
6,200 KB
testcase_22 AC 31 ms
6,224 KB
testcase_23 AC 29 ms
6,444 KB
testcase_24 AC 94 ms
6,136 KB
testcase_25 AC 94 ms
6,340 KB
testcase_26 AC 87 ms
6,196 KB
testcase_27 AC 88 ms
6,288 KB
testcase_28 AC 86 ms
6,348 KB
testcase_29 AC 88 ms
6,276 KB
testcase_30 AC 30 ms
6,456 KB
testcase_31 AC 30 ms
6,296 KB
testcase_32 AC 30 ms
6,204 KB
testcase_33 AC 31 ms
6,340 KB
testcase_34 AC 31 ms
6,268 KB
testcase_35 AC 29 ms
6,340 KB
testcase_36 AC 23 ms
5,368 KB
testcase_37 AC 31 ms
6,232 KB
testcase_38 AC 71 ms
6,192 KB
testcase_39 AC 72 ms
6,344 KB
testcase_40 AC 86 ms
6,340 KB
testcase_41 AC 35 ms
6,144 KB
testcase_42 AC 35 ms
6,140 KB
testcase_43 AC 35 ms
6,348 KB
testcase_44 AC 36 ms
6,136 KB
testcase_45 AC 35 ms
6,156 KB
testcase_46 AC 29 ms
5,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
signed main() {
	long long N, M; cin >> N >> M;
	vector<long long>A(N), dp(N+1);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = N - 1; i >= 0; i--) {
		dp[i] = A[i] - M - dp[i + 1];
		if (A[i] > 1) {
			dp[i] = max(dp[i], A[i] + M - 1 + dp[i + 1]);
		}
	}
	if (dp[0] > 0)cout << "First" << endl;
	else cout << "Second" << endl;
	return 0;
}
0