結果

問題 No.593 4進FizzBuzz
ユーザー GrayCoder
提出日時 2017-11-12 15:01:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 14,776 KB
最終ジャッジ日時 2024-11-24 23:13:53
合計ジャッジ時間 14,155 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = input()

    three = 3
    five = 11
    even = 0
    odd = 0
    i = len(N) - 1
    while i > 0:
        odd += int(N[i])
        even += int(N[i-1])
        i -= 2
    if not i:
        odd += int(N[0])

    ans = ''
    if not (odd + even) % three:
        ans += 'Fizz'
    if not (odd - even) % five:
        ans += 'Buzz'
    if ans == '':
        print(N)
    else:
        print(ans)

main()
0