結果
問題 | No.1179 Quadratic Equation |
ユーザー |
|
提出日時 | 2023-10-22 11:20:56 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 174 bytes |
コンパイル時間 | 41 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-22 09:36:41 |
合計ジャッジ時間 | 1,982 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
コンパイルメッセージ
Main.rb:7: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
a,b,c=gets.split.map &:to_i(a=-a;b=-b;c=-c) if a<0d=b*b-4*a*cif d<0puts :imaginaryelsif d==0p -b/a/2elseputs [(-b-Math.sqrt(d))/a/2, (-b+Math.sqrt(d))/a/2]*' 'end