結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー TawaraTawara
提出日時 2015-12-11 18:47:45
言語 Python2
(2.7.18)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 228 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 6,592 KB
実行使用メモリ 7,824 KB
最終ジャッジ日時 2023-08-13 15:56:53
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,804 KB
testcase_01 AC 22 ms
7,800 KB
testcase_02 AC 22 ms
7,644 KB
testcase_03 AC 22 ms
7,820 KB
testcase_04 AC 22 ms
7,764 KB
testcase_05 AC 21 ms
7,620 KB
testcase_06 AC 22 ms
7,716 KB
testcase_07 AC 22 ms
7,628 KB
testcase_08 AC 22 ms
7,632 KB
testcase_09 AC 22 ms
7,632 KB
testcase_10 AC 23 ms
7,656 KB
testcase_11 AC 23 ms
7,664 KB
testcase_12 AC 23 ms
7,824 KB
testcase_13 AC 22 ms
7,640 KB
testcase_14 AC 22 ms
7,628 KB
testcase_15 AC 22 ms
7,772 KB
testcase_16 AC 22 ms
7,800 KB
testcase_17 AC 22 ms
7,712 KB
testcase_18 AC 22 ms
7,644 KB
testcase_19 AC 22 ms
7,632 KB
testcase_20 AC 22 ms
7,620 KB
testcase_21 AC 22 ms
7,824 KB
testcase_22 AC 22 ms
7,812 KB
testcase_23 AC 23 ms
7,600 KB
testcase_24 AC 22 ms
7,664 KB
testcase_25 AC 21 ms
7,608 KB
testcase_26 AC 22 ms
7,824 KB
testcase_27 AC 22 ms
7,768 KB
testcase_28 AC 22 ms
7,812 KB
testcase_29 AC 22 ms
7,668 KB
testcase_30 AC 22 ms
7,644 KB
testcase_31 AC 22 ms
7,660 KB
testcase_32 AC 21 ms
7,640 KB
testcase_33 AC 22 ms
7,600 KB
testcase_34 AC 21 ms
7,768 KB
testcase_35 AC 21 ms
7,816 KB
testcase_36 AC 21 ms
7,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import gcd
N = input()
z = map(int,raw_input().split())
lcm = [z[i]*z[(i+1)%3]/gcd(z[i],z[(i+1)%3])for i in xrange(3)]
lcm_abc = lcm[0]*z[2]/gcd(lcm[0],z[2])
print sum(N/z[i]-N/lcm[i] for i in xrange(3))+N/lcm_abc
0