結果

問題 No.593 4進FizzBuzz
ユーザー hedwig100hedwig100
提出日時 2020-05-19 14:51:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 83,548 KB
最終ジャッジ日時 2024-04-09 22:09:08
合計ジャッジ時間 5,217 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,396 KB
testcase_01 AC 32 ms
52,952 KB
testcase_02 AC 34 ms
52,488 KB
testcase_03 AC 33 ms
52,948 KB
testcase_04 AC 33 ms
53,096 KB
testcase_05 AC 32 ms
53,372 KB
testcase_06 AC 34 ms
53,016 KB
testcase_07 AC 33 ms
52,264 KB
testcase_08 AC 34 ms
52,644 KB
testcase_09 AC 32 ms
52,772 KB
testcase_10 AC 35 ms
53,140 KB
testcase_11 AC 34 ms
52,948 KB
testcase_12 AC 32 ms
53,360 KB
testcase_13 AC 33 ms
52,604 KB
testcase_14 AC 33 ms
52,524 KB
testcase_15 AC 33 ms
52,868 KB
testcase_16 AC 131 ms
83,036 KB
testcase_17 AC 131 ms
83,036 KB
testcase_18 AC 131 ms
83,064 KB
testcase_19 AC 146 ms
83,288 KB
testcase_20 AC 128 ms
82,784 KB
testcase_21 AC 126 ms
83,236 KB
testcase_22 AC 147 ms
83,284 KB
testcase_23 AC 128 ms
82,900 KB
testcase_24 AC 124 ms
83,016 KB
testcase_25 AC 126 ms
83,024 KB
testcase_26 AC 147 ms
82,916 KB
testcase_27 AC 144 ms
82,924 KB
testcase_28 AC 130 ms
83,212 KB
testcase_29 AC 150 ms
83,176 KB
testcase_30 AC 129 ms
83,088 KB
testcase_31 AC 132 ms
82,988 KB
testcase_32 AC 129 ms
82,968 KB
testcase_33 AC 150 ms
83,548 KB
testcase_34 AC 129 ms
82,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()[::-1]
three = 0
five = 0
power3 = 1
power5 = 1
for i in range(len(N)):
    three += power3 * int(N[i])
    three %= 3
    five += power5 * int(N[i])
    five %= 5
    power3 *= 4
    power3 %= 3
    power5 *= 4
    power5 %= 5
if three == 0 and five == 0:
    print('FizzBuzz')
elif three == 0:
    print('Fizz')
elif five == 0:
    print('Buzz')
else:
    print(N[::-1])
    
0