結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー 👑 H20H20
提出日時 2020-11-17 13:14:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 228 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 71,796 KB
最終ジャッジ日時 2023-09-30 14:10:48
合計ジャッジ時間 4,659 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,492 KB
testcase_01 AC 70 ms
71,400 KB
testcase_02 AC 71 ms
71,240 KB
testcase_03 AC 70 ms
71,724 KB
testcase_04 AC 70 ms
71,476 KB
testcase_05 AC 70 ms
71,552 KB
testcase_06 AC 71 ms
71,796 KB
testcase_07 AC 69 ms
71,296 KB
testcase_08 AC 69 ms
71,516 KB
testcase_09 AC 69 ms
71,236 KB
testcase_10 AC 69 ms
71,412 KB
testcase_11 AC 68 ms
71,564 KB
testcase_12 AC 70 ms
71,616 KB
testcase_13 AC 69 ms
71,780 KB
testcase_14 AC 70 ms
71,548 KB
testcase_15 AC 69 ms
71,324 KB
testcase_16 AC 70 ms
71,728 KB
testcase_17 AC 68 ms
71,696 KB
testcase_18 AC 70 ms
71,548 KB
testcase_19 AC 70 ms
71,484 KB
testcase_20 AC 69 ms
71,168 KB
testcase_21 AC 68 ms
71,604 KB
testcase_22 AC 70 ms
71,620 KB
testcase_23 AC 70 ms
71,688 KB
testcase_24 AC 71 ms
71,432 KB
testcase_25 AC 69 ms
71,392 KB
testcase_26 AC 70 ms
71,320 KB
testcase_27 AC 70 ms
71,552 KB
testcase_28 AC 70 ms
71,496 KB
testcase_29 AC 70 ms
71,552 KB
testcase_30 AC 70 ms
71,604 KB
testcase_31 AC 72 ms
71,404 KB
testcase_32 AC 70 ms
71,456 KB
testcase_33 AC 71 ms
71,600 KB
testcase_34 AC 72 ms
71,484 KB
testcase_35 AC 69 ms
71,496 KB
testcase_36 AC 71 ms
71,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N = int(input())
A, B, C = map(int, input().split())
AB = lcm(A,B)
BC = lcm(B,C)
CA = lcm(C,A)
ABC = lcm(AB,BC)

print(N//A+N//B+N//C-N//AB-N//BC-N//CA+N//ABC)


0