結果

問題 No.593 4進FizzBuzz
ユーザー char134217728char134217728
提出日時 2017-11-20 01:57:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 852 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 11,576 KB
実行使用メモリ 118,172 KB
最終ジャッジ日時 2023-08-17 06:32:42
合計ジャッジ時間 19,508 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,052 KB
testcase_01 AC 80 ms
15,308 KB
testcase_02 AC 80 ms
15,144 KB
testcase_03 AC 81 ms
15,352 KB
testcase_04 AC 79 ms
15,176 KB
testcase_05 AC 79 ms
15,256 KB
testcase_06 AC 80 ms
15,192 KB
testcase_07 AC 80 ms
15,184 KB
testcase_08 AC 78 ms
15,140 KB
testcase_09 AC 80 ms
15,148 KB
testcase_10 AC 80 ms
15,164 KB
testcase_11 AC 78 ms
15,272 KB
testcase_12 AC 79 ms
15,160 KB
testcase_13 AC 79 ms
15,132 KB
testcase_14 AC 80 ms
15,304 KB
testcase_15 AC 79 ms
15,056 KB
testcase_16 AC 828 ms
118,120 KB
testcase_17 AC 837 ms
118,172 KB
testcase_18 AC 834 ms
118,004 KB
testcase_19 AC 836 ms
117,952 KB
testcase_20 AC 834 ms
118,012 KB
testcase_21 AC 833 ms
118,056 KB
testcase_22 AC 833 ms
118,136 KB
testcase_23 AC 829 ms
117,984 KB
testcase_24 AC 831 ms
117,868 KB
testcase_25 AC 831 ms
117,864 KB
testcase_26 AC 833 ms
118,092 KB
testcase_27 AC 831 ms
117,960 KB
testcase_28 AC 852 ms
117,948 KB
testcase_29 AC 832 ms
117,952 KB
testcase_30 AC 829 ms
117,908 KB
testcase_31 AC 833 ms
118,164 KB
testcase_32 AC 836 ms
118,084 KB
testcase_33 AC 837 ms
118,120 KB
testcase_34 AC 835 ms
118,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = 0
k = [0,0]
n = gets.chomp
n.chars.each_with_index do |c, i|
  c = c.to_i
  s += c
  k[i%2] += c
end
t = ""
t << "Fizz" if s % 3 == 0
t << "Buzz" if (k[0] - k[1]) % 5 == 0
puts (t == "" ? n : t)
0