結果

問題 No.593 4進FizzBuzz
ユーザー ttrttr
提出日時 2020-05-30 19:50:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 393 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 51,020 KB
最終ジャッジ日時 2024-04-25 13:10:28
合計ジャッジ時間 5,797 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,692 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 30 ms
10,624 KB
testcase_10 AC 30 ms
10,624 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 29 ms
10,624 KB
testcase_13 AC 29 ms
10,752 KB
testcase_14 AC 28 ms
10,752 KB
testcase_15 AC 27 ms
10,624 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()

L3 = [0]*len(N)
L5 = [0]*len(N)
L3[0] = 1
L5[0] = 1
for i in range(len(N)-1):
    L3[i+1] = (L3[i]*4)%3
    L5[i+1] = (L5[i]*4)%5

n3 = 0
n5 = 0
for i in range(len(N)):
    n3 += L3[i]*int(N[-i-1])
    n5 += L5[i]*int(N[-i-1])
    n3 %= 3
    n5 %= 5

if n3 == 0 and n5 == 0:
    print("FizzBuzz")
elif n3 == 0:
    print("Fizz")
elif n5 == 0:
    print("Buzz")
else:
    print(N)
0