結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー vjudge1
提出日時 2025-02-05 01:14:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 1,000 ms
コード長 259 bytes
コンパイル時間 552 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2025-02-05 01:14:32
合計ジャッジ時間 4,321 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n = int(input())
a,b,c=map(int,input().split())
# inc exc pol 
# a + b + c - ab - ac - bc + abc
A,B,C = n//a, n//b,n//c
AB,AC,BC = n//math.lcm(a,b), n//math.lcm(a,c), n//math.lcm(b,c)
ABC = n//math.lcm(a, math.lcm(b,c))

print(A+B+C-AB-AC-BC+ABC)
0