結果
| 問題 |
No.8043 yukicoderへようこそ!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-01 21:57:09 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| コード長 | 464 bytes |
| コンパイル時間 | 116 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-11-26 22:37:37 |
| 合計ジャッジ時間 | 1,084 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
a = gets(p).split("\n")
# p a
case a.size
when 1
N = a[0].to_i
if N == 0
puts "Hello World!"
else
if N > 75
p [*1..N].sum
else
(1..N).each{|i|
s = ""
s << "Fizz" if i % 3 == 0
s << "Buzz" if i % 5 == 0
puts s.empty? ? i : s
}
end
end
when 2
if a[1][" "]
p a[1].split.map(&:to_i).sum
else
puts "#{a[0].split.map(&:to_i).sum} #{a[1]}"
end
else
p a[1..-1].map(&:to_i).sum
end