結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー shika_126
提出日時 2022-03-21 01:45:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-07 20:16:08
合計ジャッジ時間 2,317 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n = int(input())
a,b,c = map(int,input().split())
s, x, y, z = 0, 1, 1, 1
ab = math.lcm(a,b)
bc = math.lcm(b,c)
ca = math.lcm(c,a)
abc = math.lcm(a,b,c)
if a%b and a%c:
    s += (n//a)
else:
    x = 0
if b%a and b%c:
    s += (n//b)
else:
    y = 0
if c%a and c%b:
    s += (n//c)
else:
    z = 0
print(s)
if x and y:
    s -= (n//ab)
if y and z:
    s -= (n//bc)
if z and x:
    s -= (n//ca)
print(s)
if x and y and z:
    s += (n//abc)
print(s)
0