結果

問題 No.550 夏休みの思い出(1)
ユーザー okadukiokaduki
提出日時 2017-07-29 00:09:43
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 616 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 39,808 KB
最終ジャッジ日時 2024-04-21 01:50:33
合計ジャッジ時間 5,077 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 62 ms
39,680 KB
testcase_03 AC 66 ms
39,552 KB
testcase_04 AC 64 ms
39,552 KB
testcase_05 AC 60 ms
39,424 KB
testcase_06 AC 63 ms
39,808 KB
testcase_07 AC 64 ms
39,680 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 60 ms
39,552 KB
testcase_12 AC 60 ms
39,424 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 62 ms
39,808 KB
testcase_16 WA -
testcase_17 AC 60 ms
39,424 KB
testcase_18 AC 59 ms
39,808 KB
testcase_19 WA -
testcase_20 AC 60 ms
39,552 KB
testcase_21 WA -
testcase_22 AC 62 ms
39,424 KB
testcase_23 WA -
testcase_24 AC 57 ms
39,552 KB
testcase_25 AC 60 ms
39,808 KB
testcase_26 AC 61 ms
39,424 KB
testcase_27 AC 60 ms
39,552 KB
testcase_28 AC 62 ms
39,680 KB
testcase_29 AC 60 ms
39,424 KB
testcase_30 AC 59 ms
39,680 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 59 ms
39,552 KB
testcase_34 WA -
testcase_35 AC 59 ms
39,424 KB
testcase_36 AC 68 ms
39,808 KB
testcase_37 WA -
testcase_38 AC 59 ms
39,680 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 59 ms
39,552 KB
testcase_43 WA -
testcase_44 AC 57 ms
39,552 KB
testcase_45 AC 60 ms
39,552 KB
testcase_46 WA -
testcase_47 AC 59 ms
39,552 KB
testcase_48 WA -
testcase_49 AC 59 ms
39,808 KB
testcase_50 AC 58 ms
39,808 KB
testcase_51 AC 60 ms
39,424 KB
testcase_52 WA -
testcase_53 AC 67 ms
39,808 KB
testcase_54 WA -
testcase_55 AC 61 ms
39,424 KB
testcase_56 AC 58 ms
39,808 KB
testcase_57 AC 58 ms
39,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
  var data = input.split(" ")
  var a = parseFloat(data[0]);
  var b = parseFloat(data[1]);
  var c = parseFloat(data[2]);
  var f = x => x*x*x + a*x*x + b*x + c;
  var df = x => 3*x*x + 2*a*x + b;

  x0 = (-a - Math.sqrt(a*a - 3*b)) - 1000.0;
  for(var i=0;i<1000;++i)
	x0 -= f(x0) / df(x0);
  x2 = (-a + Math.sqrt(a*a - 3*b)) + 1000.0;
  for(var i=0;i<1000;++i)
	x2 -= f(x2) / df(x2);
  x1 = -a / 3.0;
  for(var i=0;i<1000;++i)
	x1 -= f(x1) / df(x1);
  
  console.log(Math.round(x0) + ' ' + Math.round(x1) + ' ' + Math.round(x2));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0