結果

問題 No.281 門松と魔法(1)
ユーザー tailstails
提出日時 2015-09-18 23:30:31
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 11:41:27
合計ジャッジ時間 1,684 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 4 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
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 4 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
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 3 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 4 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 3 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 4 ms
5,376 KB
testcase_30 WA -
testcase_31 AC 3 ms
5,376 KB
testcase_32 AC 3 ms
5,376 KB
testcase_33 WA -
testcase_34 AC 3 ms
5,376 KB
testcase_35 WA -
testcase_36 AC 4 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 3 ms
5,376 KB
testcase_46 AC 4 ms
5,376 KB
testcase_47 AC 3 ms
5,376 KB
testcase_48 AC 3 ms
5,376 KB
testcase_49 AC 3 ms
5,376 KB
testcase_50 AC 3 ms
5,376 KB
testcase_51 WA -
testcase_52 AC 3 ms
5,376 KB
testcase_53 AC 3 ms
5,376 KB
testcase_54 WA -
testcase_55 AC 3 ms
5,376 KB
testcase_56 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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