結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー takakin
提出日時 2020-04-12 21:28:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-22 09:20:25
合計ジャッジ時間 2,307 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 22 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a

n=int(input())
a,b,c=map(int,input().split())
ab,bc,ca,abc=a*b//gcd(a,b),b*c//gcd(b,c),c*a//gcd(c,a),a*b*c//gcd(a,gcd(b,c))

print(n//a+n//b+n//c-n//ab-n//bc-n//ca+n//abc)
0