結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 66 ms
40,064 KB
testcase_03 AC 66 ms
40,320 KB
testcase_04 AC 66 ms
40,064 KB
testcase_05 AC 65 ms
40,064 KB
testcase_06 AC 64 ms
40,064 KB
testcase_07 AC 64 ms
40,064 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 66 ms
40,064 KB
testcase_12 AC 64 ms
40,192 KB
testcase_13 AC 67 ms
40,064 KB
testcase_14 AC 67 ms
40,192 KB
testcase_15 AC 66 ms
40,064 KB
testcase_16 AC 64 ms
40,064 KB
testcase_17 AC 63 ms
40,064 KB
testcase_18 AC 63 ms
40,064 KB
testcase_19 AC 64 ms
40,320 KB
testcase_20 AC 69 ms
40,064 KB
testcase_21 AC 70 ms
40,320 KB
testcase_22 AC 64 ms
40,320 KB
testcase_23 AC 64 ms
40,320 KB
testcase_24 AC 63 ms
40,320 KB
testcase_25 AC 64 ms
40,064 KB
testcase_26 AC 64 ms
40,192 KB
testcase_27 AC 65 ms
40,192 KB
testcase_28 AC 64 ms
40,320 KB
testcase_29 AC 63 ms
40,064 KB
testcase_30 AC 64 ms
40,192 KB
testcase_31 AC 64 ms
40,320 KB
testcase_32 AC 63 ms
40,064 KB
testcase_33 AC 64 ms
40,192 KB
testcase_34 AC 65 ms
40,064 KB
testcase_35 AC 65 ms
40,064 KB
testcase_36 AC 66 ms
40,064 KB
testcase_37 AC 65 ms
40,320 KB
testcase_38 AC 66 ms
40,192 KB
testcase_39 AC 66 ms
40,192 KB
testcase_40 AC 66 ms
40,064 KB
testcase_41 AC 68 ms
40,192 KB
testcase_42 AC 64 ms
40,064 KB
testcase_43 AC 62 ms
40,064 KB
testcase_44 AC 65 ms
40,064 KB
testcase_45 AC 66 ms
40,320 KB
testcase_46 AC 68 ms
40,064 KB
testcase_47 AC 65 ms
40,064 KB
testcase_48 AC 64 ms
40,192 KB
testcase_49 AC 64 ms
40,320 KB
testcase_50 AC 64 ms
40,064 KB
testcase_51 AC 64 ms
40,064 KB
testcase_52 AC 67 ms
39,936 KB
testcase_53 AC 65 ms
40,192 KB
testcase_54 AC 64 ms
40,192 KB
testcase_55 AC 65 ms
40,064 KB
testcase_56 AC 66 ms
40,192 KB
testcase_57 AC 64 ms
40,320 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))/3.0 - 1000.0;
  for(var i=0;i<1000;++i)
	x0 -= f(x0) / df(x0);
  x2 = (-a + Math.sqrt(a*a - 3*b))/3.0 + 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