結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
suppy193
|
| 提出日時 | 2015-08-03 17:00:23 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 123 ms / 5,000 ms |
| コード長 | 181 bytes |
| コンパイル時間 | 614 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 12,160 KB |
| 最終ジャッジ日時 | 2024-12-27 12:01:11 |
| 合計ジャッジ時間 | 6,505 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n = gets.strip.to_i
v = gets.strip.split(' ').map(&:to_i)
total = [0, 0]
(0..v.length-1).each do |i|
total[0], total[1] = total[1] + v[i], [total[0], total[1]].max
end
p total.max
suppy193