結果
問題 |
No.316 もっと刺激的なFizzBuzzをください
|
ユーザー |
|
提出日時 | 2021-07-02 17:28:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 142 ms / 1,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 87,040 KB |
最終ジャッジ日時 | 2024-06-29 02:03:20 |
合計ジャッジ時間 | 6,034 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools import bisect import heapq def input(): return sys.stdin.readline()[:-1] # sys.setrecursionlimit(1000000) # _INPUT = """100 # 2 3 5 # """ # sys.stdin = io.StringIO(_INPUT) def lcm(n1, n2): return n1 * n2 // math.gcd(n1, n2) N = int(input()) a, b, c = map(int, input().split()) ans = N//a + N//b + N//c - N//lcm(a,b) - N//lcm(b,c) - N//lcm(a,c) + N//lcm(a,lcm(b,c)) print(ans)