結果
問題 |
No.8072 Sum of sqrt(x)
|
ユーザー |
|
提出日時 | 2023-07-21 23:32:00 |
言語 | Ruby (3.4.1) |
結果 |
OLE
|
実行時間 | - |
コード長 | 224 bytes |
コンパイル時間 | 409 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 17,664 KB |
最終ジャッジ日時 | 2024-09-22 01:01:55 |
合計ジャッジ時間 | 43,324 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 OLE * 12 -- * 11 |
コンパイルメッセージ
Main.rb:19: warning: assigned but unused variable - i Syntax OK
ソースコード
def gi gets.chomp.to_i end def gm gets.chomp.split.map(&:to_i) end def gc gets.chomp end def gs gets.chomp.split end N = gi ans = 0 for i in 0..N-1 x = gi ans += Math.sqrt(x) puts sprintf("%.20f", ans) end