結果

問題 No.2169 To Arithmetic
ユーザー tailstails
提出日時 2022-12-21 02:23:09
言語 cLay
(20240104-1)
結果
TLE  
実行時間 -
コード長 189 bytes
コンパイル時間 2,202 ms
コンパイル使用メモリ 172,824 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-29 03:09:05
合計ジャッジ時間 6,399 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 5 ms
5,376 KB
testcase_05 AC 7 ms
5,376 KB
testcase_06 AC 10 ms
5,376 KB
testcase_07 AC 7 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@q,@a[n];
rep(i,n)a[i]=a[i+1]-a[i];
rep(q){
	ll@d,x=0,y=0;
	rep(i,n-1){
		ll e=d-a[i];
		if(e>=0){
			x+=e;
			y+=e;
		}else{
			ll f=max(0,-e-y);
			x+=f;
			y+=f+e;
		}
	}
	wt(x);
}
0