結果

問題 No.281 門松と魔法(1)
ユーザー tailstails
提出日時 2015-09-18 22:48:39
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 32 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 5,504 KB
最終ジャッジ日時 2024-04-24 11:07:10
合計ジャッジ時間 1,323 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,376 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 3 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 3 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 AC 3 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 3 ms
5,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 2 ms
5,376 KB
testcase_35 WA -
testcase_36 AC 3 ms
5,376 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 3 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 WA -
testcase_47 AC 2 ms
5,376 KB
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 3 ms
5,376 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub min{$_[0]<$_[1]?$_[0]:$_[1]}
sub max{$_[0]>$_[1]?$_[0]:$_[1]}
($d,$i,$h,$j)=<>;
exit!print 0+($i<$h&&$j<$h||$i>$h&&$j>$h) if $d==0;
$n=max(0,int(($h-min($i,$j)+$d)/$d));
$n=1e11 if $h-$d*$n<0;
$o=max(0,int(($i-$h+$d)/$d));
$o=1e11 if $i-$d*$o<0;
$p=max(0,int(($j-$h+$d)/$d));
$p=1e11 if $j-$d*$p<0;
$n=min($n,$o+$p);
$n=-1 if $n>=1e11;
print$n
0