結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー gr1msl3y
提出日時 2022-08-29 23:30:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 1,000 ms
コード長 217 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 82,000 KB
実行使用メモリ 53,556 KB
最終ジャッジ日時 2024-11-06 20:11:14
合計ジャッジ時間 2,944 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N=int(input())
a,b,c=map(int,input().split())
ans=N//a+N//b+N//c
ans-=N//(a*b//gcd(a,b))
ans-=N//(b*c//gcd(b,c))
ans-=N//(c*a//gcd(c,a))
ans+=N//(a*b//gcd(a,b)*c//gcd(a*b//gcd(a,b),c))
print(ans)
0