結果

問題 No.1375 Divide and Update
ユーザー tailstails
提出日時 2021-02-09 12:28:53
言語 cLay
(20231016-1)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 161,596 KB
実行使用メモリ 8,732 KB
最終ジャッジ日時 2023-09-19 02:10:38
合計ジャッジ時間 5,183 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,376 KB
testcase_01 AC 2 ms
5,600 KB
testcase_02 AC 2 ms
5,448 KB
testcase_03 AC 2 ms
5,320 KB
testcase_04 AC 2 ms
5,536 KB
testcase_05 AC 2 ms
5,348 KB
testcase_06 AC 2 ms
5,600 KB
testcase_07 AC 2 ms
5,332 KB
testcase_08 AC 2 ms
5,524 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 17 ms
8,432 KB
testcase_11 AC 16 ms
8,168 KB
testcase_12 AC 10 ms
7,588 KB
testcase_13 AC 8 ms
7,120 KB
testcase_14 AC 18 ms
8,624 KB
testcase_15 AC 18 ms
8,732 KB
testcase_16 AC 18 ms
8,488 KB
testcase_17 AC 18 ms
8,492 KB
testcase_18 AC 18 ms
8,444 KB
testcase_19 AC 18 ms
8,652 KB
testcase_20 AC 15 ms
7,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll a[2d5],b[2d5];
{
	ll @n,@x,@y;
	rd(a(n));
	ll s=sum(a(n));
	{
		ll l=-ll_inf,p=0,m=0;
		rep(i,n-2){
			p+=x-a[i];
			b[i]=l>?=p-m+s;
			m<?=p;
		}
	}
	{
		ll l=-ll_inf,p=0,m=0;
		rrep(i,2,n){
			p+=y-a[i];
			b[i-2]+=l>?=p-m;
			m<?=p;
		}
	}
	wtLn(b(n-2));
}
0