結果

問題 No.311 z in FizzBuzzString
コンテスト
ユーザー excnct
提出日時 2024-12-22 16:54:28
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 317 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 54 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-06 01:57:30
合計ジャッジ時間 6,571 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 TLE * 1 -- * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

    for num in nums:
        if num % 3 == 0 and num % 5 == 0:
            count += 4
        elif num % 3 == 0:
            count += 2
        elif num % 5 == 0:
            count += 2
    print(count)


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