結果

問題 No.2138 Add Bacon
ユーザー kwkkwk
提出日時 2022-12-13 13:59:52
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 30,664 KB
実行使用メモリ 31,240 KB
最終ジャッジ日時 2024-04-25 00:01:35
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
30,472 KB
testcase_01 WA -
testcase_02 AC 39 ms
30,552 KB
testcase_03 AC 40 ms
30,564 KB
testcase_04 AC 41 ms
30,636 KB
testcase_05 AC 41 ms
30,528 KB
testcase_06 AC 42 ms
30,308 KB
testcase_07 AC 42 ms
30,784 KB
testcase_08 WA -
testcase_09 AC 41 ms
30,652 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 42 ms
30,716 KB
testcase_13 WA -
testcase_14 AC 41 ms
30,648 KB
testcase_15 AC 40 ms
30,416 KB
testcase_16 AC 42 ms
30,608 KB
testcase_17 AC 40 ms
30,680 KB
testcase_18 AC 38 ms
30,536 KB
testcase_19 AC 42 ms
30,780 KB
testcase_20 AC 40 ms
30,548 KB
testcase_21 AC 41 ms
30,712 KB
testcase_22 AC 41 ms
30,476 KB
testcase_23 AC 41 ms
30,684 KB
testcase_24 AC 41 ms
30,452 KB
testcase_25 WA -
testcase_26 AC 42 ms
30,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
[$a,$b,$c,$d,$e] = explode(" ",trim(fgets(STDIN)));
$ans=0;
for ($i = 0; $i <= $c; $i++) {
     $f =($a+$i*$d)-($b+$i*$e);
     if ($f >= $ans) {
         $ans=$f;
     }elseif($f<0 && $ans<$f){
         $ans=$f;
     }
}
 echo $ans;


?>
0