結果

問題 No.1208 anti primenumber game
ユーザー furafura
提出日時 2020-09-13 17:09:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 197,868 KB
実行使用メモリ 13,064 KB
最終ジャッジ日時 2023-09-03 22:33:59
合計ジャッジ時間 6,009 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 WA -
testcase_16 AC 23 ms
12,868 KB
testcase_17 AC 24 ms
12,772 KB
testcase_18 AC 23 ms
12,924 KB
testcase_19 AC 24 ms
12,864 KB
testcase_20 WA -
testcase_21 AC 25 ms
12,732 KB
testcase_22 AC 24 ms
12,772 KB
testcase_23 WA -
testcase_24 AC 40 ms
12,936 KB
testcase_25 AC 41 ms
12,776 KB
testcase_26 AC 39 ms
12,800 KB
testcase_27 AC 39 ms
12,764 KB
testcase_28 AC 38 ms
12,860 KB
testcase_29 AC 38 ms
12,872 KB
testcase_30 AC 23 ms
12,840 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 24 ms
12,932 KB
testcase_34 AC 24 ms
12,740 KB
testcase_35 AC 23 ms
12,800 KB
testcase_36 AC 19 ms
10,828 KB
testcase_37 AC 24 ms
12,764 KB
testcase_38 AC 36 ms
12,780 KB
testcase_39 AC 35 ms
12,936 KB
testcase_40 AC 38 ms
12,732 KB
testcase_41 AC 25 ms
12,776 KB
testcase_42 AC 25 ms
12,788 KB
testcase_43 WA -
testcase_44 AC 26 ms
12,936 KB
testcase_45 WA -
testcase_46 AC 23 ms
11,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

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

using namespace std;
using lint=long long;

const long long INF=1LL<<61;

int n;
lint m,a[200000];
lint cum[200001];

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

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

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

	rep(i,n) cum[i+1]=cum[i]+a[i];

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

	return 0;
}
0