結果

問題 No.593 4進FizzBuzz
ユーザー RyutoRyuto
提出日時 2017-12-16 15:24:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 359 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 188,332 KB
最終ジャッジ日時 2023-08-21 09:17:26
合計ジャッジ時間 10,002 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,184 KB
testcase_01 AC 73 ms
71,268 KB
testcase_02 AC 70 ms
71,108 KB
testcase_03 AC 72 ms
71,468 KB
testcase_04 AC 71 ms
71,372 KB
testcase_05 AC 71 ms
71,464 KB
testcase_06 AC 72 ms
71,444 KB
testcase_07 AC 72 ms
71,456 KB
testcase_08 AC 72 ms
71,336 KB
testcase_09 AC 73 ms
71,104 KB
testcase_10 AC 73 ms
71,296 KB
testcase_11 AC 74 ms
71,272 KB
testcase_12 AC 74 ms
71,384 KB
testcase_13 AC 73 ms
70,896 KB
testcase_14 AC 72 ms
71,076 KB
testcase_15 AC 73 ms
71,184 KB
testcase_16 AC 311 ms
188,116 KB
testcase_17 AC 354 ms
188,304 KB
testcase_18 AC 304 ms
187,968 KB
testcase_19 AC 355 ms
188,188 KB
testcase_20 AC 258 ms
188,200 KB
testcase_21 AC 304 ms
188,296 KB
testcase_22 AC 356 ms
187,852 KB
testcase_23 AC 254 ms
188,164 KB
testcase_24 AC 354 ms
188,220 KB
testcase_25 AC 359 ms
188,332 KB
testcase_26 AC 358 ms
188,176 KB
testcase_27 AC 355 ms
188,312 KB
testcase_28 AC 257 ms
188,280 KB
testcase_29 AC 358 ms
188,056 KB
testcase_30 AC 254 ms
187,856 KB
testcase_31 AC 305 ms
188,296 KB
testcase_32 AC 357 ms
188,276 KB
testcase_33 AC 359 ms
188,132 KB
testcase_34 AC 304 ms
188,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def chmod(p, n, mod):
    tmp = 0
    for i in range(len(n)):
        tmp = (tmp * p + int(n[i])) % mod
    return True if tmp == 0 else False

N = input()
SumN = sum([int(x) for x in list(N)])

if chmod(4, N, 15):
    print('FizzBuzz')
elif chmod(4, N, 3):
    print('Fizz')
elif chmod(4, N, 5):
    print('Buzz')
else:
    print(N)
0