結果

問題 No.311 z in FizzBuzzString
ユーザー excnct
提出日時 2024-12-22 16:48:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 467 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,760 KB
最終ジャッジ日時 2024-12-22 16:49:10
合計ジャッジ時間 11,124 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 7 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    nums = range(1, n + 1)

    for num in nums:
        if num % 3 == 0 and num % 5 == 0:
            num = "FizzBuzz"
        elif num % 3 == 0:
            num = "Fizz"
        elif num % 5 == 0:
            num = "Buzz"
        else:
            num = str(num)

    str_nums = "".join(nums)

    count = 0
    for j in str_nums:
        if j == "z":
            count += 1

    print(count)


if __name__ == "__main__":
    main()
0