結果

問題 No.593 4進FizzBuzz
ユーザー brthyyjpbrthyyjp
提出日時 2021-04-07 00:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 856 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 175,040 KB
最終ジャッジ日時 2023-09-02 16:55:48
合計ジャッジ時間 9,369 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,200 KB
testcase_01 AC 75 ms
70,920 KB
testcase_02 AC 74 ms
70,948 KB
testcase_03 AC 77 ms
71,152 KB
testcase_04 AC 74 ms
71,088 KB
testcase_05 AC 78 ms
71,356 KB
testcase_06 AC 77 ms
71,296 KB
testcase_07 AC 77 ms
71,256 KB
testcase_08 AC 78 ms
71,280 KB
testcase_09 AC 78 ms
71,364 KB
testcase_10 AC 74 ms
71,200 KB
testcase_11 AC 74 ms
71,356 KB
testcase_12 AC 80 ms
71,256 KB
testcase_13 AC 75 ms
71,000 KB
testcase_14 AC 77 ms
71,448 KB
testcase_15 AC 75 ms
71,360 KB
testcase_16 AC 231 ms
172,948 KB
testcase_17 AC 225 ms
173,020 KB
testcase_18 AC 225 ms
172,736 KB
testcase_19 AC 227 ms
174,896 KB
testcase_20 AC 229 ms
172,956 KB
testcase_21 AC 226 ms
172,944 KB
testcase_22 AC 232 ms
174,820 KB
testcase_23 AC 227 ms
172,956 KB
testcase_24 AC 230 ms
172,856 KB
testcase_25 AC 228 ms
172,848 KB
testcase_26 AC 228 ms
174,916 KB
testcase_27 AC 229 ms
175,040 KB
testcase_28 AC 236 ms
172,960 KB
testcase_29 AC 237 ms
174,664 KB
testcase_30 AC 234 ms
172,856 KB
testcase_31 AC 231 ms
172,868 KB
testcase_32 AC 225 ms
172,756 KB
testcase_33 AC 234 ms
174,972 KB
testcase_34 AC 231 ms
172,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = str(input())
s = list(n)
s.reverse()
r3 = 0
r5 = 0
for i, c in enumerate(s):
    c = int(c)
    r3 += c
    if i%2 == 0:
        r5 += c
    else:
        r5 -= c
r3 %= 3
r5 %= 5
if r3 == 0 and r5 == 0:
    print('FizzBuzz')
elif r3 == 0:
    print('Fizz')
elif r5 == 0:
    print('Buzz')
else:
    print(n)
0