結果

問題 No.966 引き算をして門松列(その1)
ユーザー tailstails
提出日時 2021-02-04 10:42:54
言語 Perl
(5.38.2)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 33 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 6,152 KB
最終ジャッジ日時 2023-09-13 05:40:44
合計ジャッジ時間 918 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,600 KB
testcase_01 AC 2 ms
4,748 KB
testcase_02 AC 2 ms
4,648 KB
testcase_03 AC 2 ms
4,664 KB
testcase_04 AC 19 ms
5,884 KB
testcase_05 AC 21 ms
6,048 KB
testcase_06 AC 26 ms
6,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 6.
Unquoted string "inf" may clash with future reserved word at Main.pl line 7.
Unquoted string "inf" may clash with future reserved word at Main.pl line 9.
Possible precedence problem on bitwise | operator at Main.pl line 9.
Main.pl syntax OK

ソースコード

diff #

<>;
for(<>){
	($a,$b,$c)=split;
	($a,$c)=($c,$a)if$a>$c;
	$a-=$x=$a==$c;
	$y=$b>2?($-=$c-($b-1))+0+($-=$a-($b-2)):inf;
	$z=$a>1?($-=$b-($a-1)):inf;
	$x+=$y<$z?$y:$z;
	print!$a|$x==inf?-1:$x,$/;
}
0