結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー nohakai3nohakai3
提出日時 2022-10-19 15:02:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 1,000 ms
コード長 335 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 72,756 KB
最終ジャッジ日時 2023-09-12 04:35:46
合計ジャッジ時間 6,114 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
72,752 KB
testcase_01 AC 109 ms
72,412 KB
testcase_02 AC 108 ms
72,476 KB
testcase_03 AC 105 ms
72,756 KB
testcase_04 AC 106 ms
72,480 KB
testcase_05 AC 105 ms
72,280 KB
testcase_06 AC 108 ms
72,540 KB
testcase_07 AC 107 ms
72,716 KB
testcase_08 AC 107 ms
72,316 KB
testcase_09 AC 108 ms
72,592 KB
testcase_10 AC 110 ms
72,332 KB
testcase_11 AC 108 ms
72,592 KB
testcase_12 AC 108 ms
72,756 KB
testcase_13 AC 106 ms
72,744 KB
testcase_14 AC 107 ms
72,488 KB
testcase_15 AC 110 ms
72,280 KB
testcase_16 AC 109 ms
72,552 KB
testcase_17 AC 109 ms
72,296 KB
testcase_18 AC 108 ms
72,552 KB
testcase_19 AC 107 ms
72,568 KB
testcase_20 AC 107 ms
72,328 KB
testcase_21 AC 108 ms
72,504 KB
testcase_22 AC 110 ms
72,576 KB
testcase_23 AC 103 ms
72,532 KB
testcase_24 AC 108 ms
72,488 KB
testcase_25 AC 109 ms
72,576 KB
testcase_26 AC 109 ms
72,480 KB
testcase_27 AC 108 ms
72,648 KB
testcase_28 AC 109 ms
72,440 KB
testcase_29 AC 109 ms
72,456 KB
testcase_30 AC 107 ms
72,596 KB
testcase_31 AC 106 ms
72,592 KB
testcase_32 AC 105 ms
72,432 KB
testcase_33 AC 108 ms
72,324 KB
testcase_34 AC 107 ms
72,588 KB
testcase_35 AC 107 ms
72,276 KB
testcase_36 AC 107 ms
72,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
import math
def my_lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def my_lcm(*numbers):
    return reduce(my_lcm_base, numbers, 1)
n=int(input())
a,b,c=map(int,input().split())
x=my_lcm_base(a,b)
y=my_lcm_base(b,c)
z=my_lcm_base(a,c)
l=[a,b,c]
p=my_lcm(*l)

print(n//a+n//b+n//c-n//x-n//y-n//z+n//p)
0