結果

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

ソースコード

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(gcd(a,b),c))
print(ans)
0