結果

問題 No.966 引き算をして門松列(その1)
ユーザー tailstails
提出日時 2021-02-04 11:06:15
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 425 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 06:04:09
合計ジャッジ時間 2,095 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 325 ms
4,380 KB
testcase_05 AC 346 ms
4,380 KB
testcase_06 AC 425 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

inf=0x70000000
f='e>=0?e:0'
read
while
	read a b c
do
	echo $[
	a>c?t=a,a=c,c=t:0,
	a-=x=a==c,
	y=b>2?(e=c-(b-1),f)+(e=a-(b-2),f):inf,
	z=a>1?(e=b-(a-1),f):inf,
	x+=y<z?y:z,
	!a|x>=inf?-1:x
	]
done
0