結果

問題 No.593 4進FizzBuzz
ユーザー maimai
提出日時 2017-08-01 06:23:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 110,720 KB
最終ジャッジ日時 2024-04-22 14:34:57
合計ジャッジ時間 6,767 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,032 KB
testcase_01 AC 79 ms
12,032 KB
testcase_02 AC 79 ms
12,160 KB
testcase_03 AC 77 ms
12,032 KB
testcase_04 AC 75 ms
11,904 KB
testcase_05 AC 74 ms
12,160 KB
testcase_06 AC 78 ms
11,904 KB
testcase_07 AC 76 ms
11,904 KB
testcase_08 AC 78 ms
12,160 KB
testcase_09 AC 80 ms
12,032 KB
testcase_10 AC 76 ms
12,160 KB
testcase_11 AC 79 ms
12,032 KB
testcase_12 AC 78 ms
12,032 KB
testcase_13 AC 80 ms
12,032 KB
testcase_14 AC 76 ms
12,032 KB
testcase_15 AC 77 ms
12,032 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 160 ms
110,592 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 155 ms
110,464 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 155 ms
110,336 KB
testcase_32 WA -
testcase_33 AC 158 ms
110,464 KB
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

str = gets.chomp!
abort "EOF" unless !gets
abort "Format error" unless str=~/^[0-3]+$/


# 末尾15文字だけを検査すればおk
tail =  str.size > 15 ? str[-15..-1] : str

e = tail.to_i(4)
puts e%15 == 0 ? "FizzBuzz" : (e%5 == 0 ? "Buzz" : (e%3 == 0 ? "Fizz" : str))
0