結果

問題 No.1179 Quadratic Equation
ユーザー cielciel
提出日時 2023-10-22 11:19:05
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 150 bytes
コンパイル時間 1,546 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 16,108 KB
最終ジャッジ日時 2023-10-22 11:19:10
合計ジャッジ時間 3,891 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,104 KB
testcase_01 AC 90 ms
16,108 KB
testcase_02 AC 90 ms
16,108 KB
testcase_03 AC 95 ms
16,108 KB
testcase_04 AC 97 ms
16,108 KB
testcase_05 AC 89 ms
16,108 KB
testcase_06 AC 98 ms
16,108 KB
testcase_07 AC 91 ms
16,108 KB
testcase_08 AC 88 ms
16,108 KB
testcase_09 AC 88 ms
16,108 KB
testcase_10 WA -
testcase_11 AC 92 ms
16,108 KB
testcase_12 AC 90 ms
16,108 KB
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

a,b,c=gets.split.map &:to_i
d=b*b-4*a*c
if d<0
	puts :imaginary
elsif d==0
	p -b/a/2
else
	puts [(-b-Math.sqrt(d))/a/2, (-b+Math.sqrt(d))/a/2]*' '
end
0