結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー r_ishida
提出日時 2025-07-30 06:43:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 513 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-07-30 06:43:09
合計ジャッジ時間 3,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
a, b, c = MI()

g_abc = math.lcm(a, b, c)
g_ab = math.lcm(a, b)
g_ac = math.lcm(a, c)
g_bc = math.lcm(b, c)

ans = n//a + n//b + n//c - (n//g_ab + n//g_ac + n//g_bc) + n//g_abc
print(ans)
0