結果

問題 No.1095 Smallest Kadomatsu Subsequence
ユーザー tailstails
提出日時 2020-06-29 17:01:25
言語 cLay
(20240104-1)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 1,976 ms
コンパイル使用メモリ 159,288 KB
実行使用メモリ 13,880 KB
最終ジャッジ日時 2023-09-19 00:41:01
合計ジャッジ時間 3,748 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,376 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 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,388 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 14 ms
13,880 KB
testcase_24 AC 13 ms
13,876 KB
testcase_25 AC 14 ms
13,856 KB
testcase_26 AC 14 ms
13,780 KB
testcase_27 AC 13 ms
13,852 KB
testcase_28 AC 13 ms
13,728 KB
testcase_29 AC 14 ms
13,852 KB
testcase_30 AC 13 ms
13,780 KB
testcase_31 AC 13 ms
13,728 KB
testcase_32 AC 14 ms
13,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// もしかして配列いらない?

ll n,r=MD;
ll f(ll i,ll w){
	if(i==n){
		return MD;
	}
	ll x,y;
	rd(x);
	y=f(i+1,w<x?w:x);
	if((w<x)!=(x<y))r<?=w+x+y;
	return y<x?y:x;
}
{
	rd(n);
	f(0,MD);
	wt(r<MD?r:-1);
}
0