結果

問題 No.593 4進FizzBuzz
ユーザー ttrttr
提出日時 2020-05-30 19:51:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 2,348 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 111,228 KB
最終ジャッジ日時 2024-04-25 13:10:40
合計ジャッジ時間 4,651 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,288 KB
testcase_01 AC 35 ms
52,348 KB
testcase_02 AC 35 ms
53,012 KB
testcase_03 AC 34 ms
52,412 KB
testcase_04 AC 35 ms
52,212 KB
testcase_05 AC 35 ms
52,496 KB
testcase_06 AC 40 ms
53,004 KB
testcase_07 AC 38 ms
52,288 KB
testcase_08 AC 39 ms
53,808 KB
testcase_09 AC 37 ms
52,956 KB
testcase_10 AC 39 ms
53,288 KB
testcase_11 AC 38 ms
52,236 KB
testcase_12 AC 40 ms
52,580 KB
testcase_13 AC 37 ms
53,688 KB
testcase_14 AC 38 ms
52,356 KB
testcase_15 AC 40 ms
53,072 KB
testcase_16 AC 156 ms
110,932 KB
testcase_17 AC 151 ms
110,744 KB
testcase_18 AC 149 ms
111,008 KB
testcase_19 AC 149 ms
111,228 KB
testcase_20 AC 148 ms
110,680 KB
testcase_21 AC 151 ms
110,708 KB
testcase_22 AC 152 ms
110,860 KB
testcase_23 AC 148 ms
110,932 KB
testcase_24 AC 146 ms
110,576 KB
testcase_25 AC 147 ms
110,912 KB
testcase_26 AC 149 ms
110,868 KB
testcase_27 AC 150 ms
111,124 KB
testcase_28 AC 146 ms
110,600 KB
testcase_29 AC 153 ms
110,860 KB
testcase_30 AC 148 ms
111,124 KB
testcase_31 AC 149 ms
110,752 KB
testcase_32 AC 150 ms
110,440 KB
testcase_33 AC 154 ms
110,864 KB
testcase_34 AC 147 ms
110,796 KB
権限があれば一括ダウンロードができます

ソースコード

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