結果
| 問題 | No.550 夏休みの思い出(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-28 23:35:09 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 209 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,800 KB |
| 最終ジャッジ日時 | 2024-10-10 05:27:59 |
| 合計ジャッジ時間 | 10,254 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 50 WA * 5 |
コンパイルメッセージ
Syntax OK
ソースコード
def ascan; gets.split.map(&:to_i); end
def scan; gets.to_i; end
aa,bb,cc = ascan
@a=aa
@b=bb
@c=cc
def calc(x)
x*x*x+@a*x*x+@b*x+@c
end
def divc(x)
3*x*x+2*@a*x+@b
end
def newton(x)
x = (x).to_f
50.times{
x = x-calc(x)/divc(x)
}
x.round
end
li = []
while li.size<3
z = newton(rand((-1e9.to_i)..(1e9.to_i)))
li << z
li.sort!.uniq!
end
puts li*" "