結果

問題 No.1208 anti primenumber game
ユーザー furafura
提出日時 2020-09-13 18:25:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,968 ms
コンパイル使用メモリ 197,384 KB
実行使用メモリ 8,312 KB
最終ジャッジ日時 2023-09-03 23:49:04
合計ジャッジ時間 6,810 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 20 ms
8,172 KB
testcase_16 AC 19 ms
8,176 KB
testcase_17 AC 20 ms
8,084 KB
testcase_18 AC 20 ms
8,104 KB
testcase_19 AC 20 ms
8,160 KB
testcase_20 AC 20 ms
8,220 KB
testcase_21 AC 21 ms
8,164 KB
testcase_22 AC 20 ms
8,204 KB
testcase_23 AC 21 ms
8,208 KB
testcase_24 AC 36 ms
8,220 KB
testcase_25 AC 35 ms
8,156 KB
testcase_26 AC 35 ms
8,208 KB
testcase_27 AC 35 ms
8,220 KB
testcase_28 AC 35 ms
8,304 KB
testcase_29 AC 34 ms
8,244 KB
testcase_30 AC 20 ms
8,244 KB
testcase_31 AC 20 ms
8,092 KB
testcase_32 AC 20 ms
8,140 KB
testcase_33 AC 20 ms
8,156 KB
testcase_34 AC 20 ms
8,100 KB
testcase_35 AC 20 ms
8,108 KB
testcase_36 AC 16 ms
7,088 KB
testcase_37 AC 19 ms
8,312 KB
testcase_38 AC 33 ms
8,288 KB
testcase_39 AC 32 ms
8,308 KB
testcase_40 AC 34 ms
8,112 KB
testcase_41 AC 21 ms
8,156 KB
testcase_42 AC 21 ms
8,156 KB
testcase_43 AC 21 ms
8,292 KB
testcase_44 AC 22 ms
8,088 KB
testcase_45 AC 22 ms
8,148 KB
testcase_46 AC 19 ms
7,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

int n;
lint m,a[200000];

lint dfs(int i){
	if(i==n) return 0;

	lint tmp=dfs(i+1);
	lint res=a[i]-m-tmp; // 全部取る
	if(a[i]>1){
		res=max(res,a[i]-1+m+tmp); // 1 個残す
	}
	return res;
}

int main(){
	scanf("%d%lld",&n,&m);
	rep(i,n) scanf("%lld",&a[i]);

	puts(dfs(0)>0?"First":"Second");

	return 0;
}
0