結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー airisairis
提出日時 2015-12-12 21:56:21
言語 Python2
(2.7.18)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 216 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 6,668 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2023-08-13 15:58:34
合計ジャッジ時間 2,464 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,792 KB
testcase_01 AC 22 ms
7,800 KB
testcase_02 AC 23 ms
7,808 KB
testcase_03 AC 22 ms
7,804 KB
testcase_04 AC 22 ms
7,752 KB
testcase_05 AC 21 ms
7,684 KB
testcase_06 AC 22 ms
7,700 KB
testcase_07 AC 22 ms
7,736 KB
testcase_08 AC 22 ms
7,620 KB
testcase_09 AC 22 ms
7,840 KB
testcase_10 AC 22 ms
7,744 KB
testcase_11 AC 21 ms
7,684 KB
testcase_12 AC 22 ms
7,620 KB
testcase_13 AC 22 ms
7,800 KB
testcase_14 AC 21 ms
7,684 KB
testcase_15 AC 22 ms
7,808 KB
testcase_16 AC 22 ms
7,612 KB
testcase_17 AC 21 ms
7,804 KB
testcase_18 AC 22 ms
7,824 KB
testcase_19 AC 22 ms
7,660 KB
testcase_20 AC 21 ms
7,620 KB
testcase_21 AC 21 ms
7,620 KB
testcase_22 AC 21 ms
7,680 KB
testcase_23 AC 21 ms
7,804 KB
testcase_24 AC 22 ms
7,776 KB
testcase_25 AC 21 ms
7,700 KB
testcase_26 AC 22 ms
7,700 KB
testcase_27 AC 22 ms
7,664 KB
testcase_28 AC 22 ms
7,848 KB
testcase_29 AC 22 ms
7,808 KB
testcase_30 AC 22 ms
7,624 KB
testcase_31 AC 21 ms
7,760 KB
testcase_32 AC 22 ms
7,672 KB
testcase_33 AC 22 ms
7,652 KB
testcase_34 AC 21 ms
7,632 KB
testcase_35 AC 22 ms
7,632 KB
testcase_36 AC 22 ms
7,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import fractions

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

n = input()
a,b,c = map(int, raw_input().split())
ans = n/a + n/b + n/c - n/lcm(a, b) - n/lcm(b, c) - n/lcm(a, c) + n/lcm(a,lcm(b,c))
print ans
0