結果
| 問題 | No.593 4進FizzBuzz | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-11-12 22:56:20 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 922 ms / 2,000 ms | 
| コード長 | 312 bytes | 
| コンパイル時間 | 81 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 14,576 KB | 
| 最終ジャッジ日時 | 2024-11-24 23:22:45 | 
| 合計ジャッジ時間 | 18,903 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 31 | 
ソースコード
def main():
    N = input()
    three = five = 0
    for s in N:
        three = (three * 4 + int(s)) % 3
        five = (five * 4 + int(s)) % 5
    ans = ''
    if not three:
        ans += 'Fizz'
    if not five:
        ans += 'Buzz'
    if ans == '':
        print(N)
    else:
        print(ans)
main()
            
            
            
        