結果

問題 No.1208 anti primenumber game
ユーザー furafura
提出日時 2020-09-13 17:17:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 3,244 ms
コンパイル使用メモリ 198,500 KB
実行使用メモリ 13,080 KB
最終ジャッジ日時 2023-09-03 22:59:48
合計ジャッジ時間 5,511 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 23 ms
12,820 KB
testcase_17 AC 23 ms
12,836 KB
testcase_18 AC 24 ms
12,796 KB
testcase_19 AC 23 ms
12,756 KB
testcase_20 WA -
testcase_21 AC 24 ms
12,860 KB
testcase_22 AC 24 ms
12,972 KB
testcase_23 AC 25 ms
12,864 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 38 ms
12,844 KB
testcase_27 AC 38 ms
12,852 KB
testcase_28 AC 39 ms
12,812 KB
testcase_29 WA -
testcase_30 AC 23 ms
12,860 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 24 ms
12,756 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 23 ms
12,860 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 25 ms
12,860 KB
testcase_43 WA -
testcase_44 AC 25 ms
12,840 KB
testcase_45 AC 26 ms
12,740 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

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 cum[200001];

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

	lint tmp=cum[n]-cum[i+1]-(n-i-1)*m-2*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]);

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

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

	return 0;
}
0