結果

問題 No.593 4進FizzBuzz
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-21 11:46:28
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 77,108 KB
実行使用メモリ 80,592 KB
最終ジャッジ日時 2023-10-17 10:29:41
合計ジャッジ時間 8,367 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
76,024 KB
testcase_01 AC 73 ms
76,024 KB
testcase_02 AC 73 ms
76,024 KB
testcase_03 AC 73 ms
76,024 KB
testcase_04 AC 73 ms
76,024 KB
testcase_05 AC 73 ms
76,024 KB
testcase_06 AC 74 ms
76,024 KB
testcase_07 AC 74 ms
76,024 KB
testcase_08 AC 73 ms
76,024 KB
testcase_09 AC 74 ms
76,024 KB
testcase_10 AC 73 ms
76,024 KB
testcase_11 AC 72 ms
76,024 KB
testcase_12 AC 73 ms
76,024 KB
testcase_13 AC 73 ms
76,024 KB
testcase_14 AC 74 ms
76,024 KB
testcase_15 AC 72 ms
76,024 KB
testcase_16 AC 144 ms
80,464 KB
testcase_17 AC 136 ms
80,592 KB
testcase_18 AC 137 ms
80,592 KB
testcase_19 AC 138 ms
80,592 KB
testcase_20 AC 136 ms
80,592 KB
testcase_21 AC 137 ms
80,592 KB
testcase_22 AC 138 ms
80,592 KB
testcase_23 AC 136 ms
80,592 KB
testcase_24 AC 137 ms
80,592 KB
testcase_25 AC 137 ms
80,592 KB
testcase_26 AC 137 ms
80,592 KB
testcase_27 AC 137 ms
80,592 KB
testcase_28 AC 136 ms
80,592 KB
testcase_29 AC 137 ms
80,592 KB
testcase_30 AC 132 ms
80,592 KB
testcase_31 AC 133 ms
80,592 KB
testcase_32 AC 135 ms
80,592 KB
testcase_33 AC 136 ms
80,592 KB
testcase_34 AC 137 ms
80,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod3 = [0, 1, 2, 0]
mod5 = [[0, 1, 2, 3], [0, 4, 3, 2]]
N = raw_input()
cnt3 = 0
cnt5 = 0
for i in range(0, len(N)):
	cnt3 += mod3[int(N[-1-i])]
	cnt5 += mod5[i%2][int(N[-1-i])]
ans = ''
if cnt3%3 == 0: ans = ans + 'Fizz'
if cnt5%5 == 0: ans = ans + 'Buzz'
if ans != '': print ans
else: print N
0