結果

問題 No.550 夏休みの思い出(1)
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-30 15:43:26
言語 PHP
(8.3.4)
結果
TLE  
実行時間 -
コード長 692 bytes
コンパイル時間 1,761 ms
コンパイル使用メモリ 31,760 KB
実行使用メモリ 39,472 KB
最終ジャッジ日時 2024-04-19 05:54:59
合計ジャッジ時間 4,246 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
$array = explode(" ", trim(fgets(STDIN)));
$A = $array[0];
$B = $array[1];
$C = $array[2];
$left = (-1) * pow(10, 9);
$right = pow(10, 9);
$x1 = 0;
while($right - $left > 0) {
  $med = intdiv($right - $left, 2);
  $med += $left;
  $y = pow($med, 3) + $A * pow($med, 2) + $B * $med + $C;
  if($y > 0) {
    $right = $med;
  } else if($y < 0) {
    $left = $med;
  } else {
    $x1 = $med;
    break;
  }
}
$b = $A + $x1;
$c = $x1 * $A + pow($x1, 2) + $B;
$x2 = ((-1) * $b - sqrt(pow($b, 2) - 4 * $c)) / 2;
$x3 = ((-1) * $b + sqrt(pow($b, 2) - 4 * $c)) / 2;
$ans = array($x1, $x2, $x3);
sort($ans);
for($i = 0; $i < 3; $i++) {
  print($ans[$i]);
  if($i < 2) print(" ");
}
print("\n");
?>
0