結果
| 問題 |
No.8072 Sum of sqrt(x)
|
| ユーザー |
|
| 提出日時 | 2023-04-14 22:11:33 |
| 言語 | Ruby (3.4.1) |
| 結果 |
OLE
|
| 実行時間 | - |
| コード長 | 209 bytes |
| コンパイル時間 | 536 ms |
| コンパイル使用メモリ | 7,168 KB |
| 実行使用メモリ | 19,108 KB |
| 最終ジャッジ日時 | 2024-10-10 13:02:20 |
| 合計ジャッジ時間 | 43,741 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 OLE * 13 -- * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
def gi
gets.to_i
end
def gm
gets.split.map(&:to_i)
end
def gc
gets.chomp
end
def gf
gets.to_f
end
n = gi
sum = 0.0
(1..n).each do |i|
x = gi
sum += Math.sqrt(x)
puts format("%.20f", sum)
end