結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー alexara1123alexara1123
提出日時 2019-09-23 01:55:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 1,000 ms
コード長 460 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 56,072 KB
最終ジャッジ日時 2024-04-14 16:40:41
合計ジャッジ時間 3,145 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
56,040 KB
testcase_01 AC 42 ms
55,928 KB
testcase_02 AC 43 ms
55,792 KB
testcase_03 AC 43 ms
54,924 KB
testcase_04 AC 42 ms
54,548 KB
testcase_05 AC 43 ms
54,432 KB
testcase_06 AC 42 ms
54,828 KB
testcase_07 AC 43 ms
54,812 KB
testcase_08 AC 41 ms
54,524 KB
testcase_09 AC 42 ms
54,772 KB
testcase_10 AC 44 ms
54,588 KB
testcase_11 AC 42 ms
55,204 KB
testcase_12 AC 42 ms
55,152 KB
testcase_13 AC 42 ms
55,920 KB
testcase_14 AC 41 ms
55,332 KB
testcase_15 AC 41 ms
55,624 KB
testcase_16 AC 42 ms
54,568 KB
testcase_17 AC 41 ms
55,080 KB
testcase_18 AC 42 ms
55,148 KB
testcase_19 AC 41 ms
54,652 KB
testcase_20 AC 42 ms
55,404 KB
testcase_21 AC 42 ms
55,432 KB
testcase_22 AC 41 ms
55,000 KB
testcase_23 AC 42 ms
54,840 KB
testcase_24 AC 42 ms
54,268 KB
testcase_25 AC 42 ms
54,536 KB
testcase_26 AC 43 ms
54,644 KB
testcase_27 AC 43 ms
54,276 KB
testcase_28 AC 41 ms
56,072 KB
testcase_29 AC 42 ms
55,960 KB
testcase_30 AC 41 ms
54,632 KB
testcase_31 AC 41 ms
54,656 KB
testcase_32 AC 41 ms
55,528 KB
testcase_33 AC 41 ms
54,728 KB
testcase_34 AC 41 ms
54,524 KB
testcase_35 AC 42 ms
54,660 KB
testcase_36 AC 42 ms
54,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
from heapq import*
import math
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def main():
    n = int(input())
    a, b, c = map(int, input().split())

    def lcm(a, b):
        return a * b // gcd(a, b)

    print(int(n // a + n // b + n // c - n // (lcm(a, b)) -
              n//(lcm(b, c)) - n//(lcm(c, a)) + n//(lcm(a, lcm(b, c)))))


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