結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー lllllll88938494lllllll88938494
提出日時 2023-06-15 18:12:27
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 465 bytes
コンパイル時間 1,765 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 79,228 KB
最終ジャッジ日時 2023-09-05 21:41:35
合計ジャッジ時間 5,337 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,308 KB
testcase_01 AC 68 ms
71,116 KB
testcase_02 AC 67 ms
71,212 KB
testcase_03 AC 66 ms
71,660 KB
testcase_04 AC 66 ms
71,372 KB
testcase_05 RE -
testcase_06 AC 64 ms
71,328 KB
testcase_07 RE -
testcase_08 AC 65 ms
71,524 KB
testcase_09 AC 66 ms
71,444 KB
testcase_10 AC 67 ms
71,416 KB
testcase_11 RE -
testcase_12 AC 67 ms
71,664 KB
testcase_13 AC 65 ms
71,296 KB
testcase_14 AC 66 ms
71,312 KB
testcase_15 AC 68 ms
71,336 KB
testcase_16 AC 67 ms
71,448 KB
testcase_17 AC 67 ms
71,288 KB
testcase_18 AC 67 ms
71,432 KB
testcase_19 AC 68 ms
71,368 KB
testcase_20 AC 66 ms
71,392 KB
testcase_21 AC 68 ms
71,384 KB
testcase_22 AC 68 ms
71,104 KB
testcase_23 AC 67 ms
71,492 KB
testcase_24 AC 66 ms
71,508 KB
testcase_25 AC 66 ms
71,380 KB
testcase_26 AC 68 ms
71,384 KB
testcase_27 RE -
testcase_28 AC 66 ms
71,272 KB
testcase_29 AC 66 ms
71,276 KB
testcase_30 AC 67 ms
71,100 KB
testcase_31 RE -
testcase_32 AC 65 ms
71,112 KB
testcase_33 RE -
testcase_34 AC 65 ms
71,584 KB
testcase_35 AC 64 ms
71,428 KB
testcase_36 AC 66 ms
71,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil,floor,sqrt,gcd,factorial 
def  lcm(a,b):
    return a*b // gcd(a,b)

n=int(input())
a,b,c = map(int,input().split())
z = [a]
if b%a:
    z.append(b)
if c%a and c%b:
    z.append(c)

if len(z) == 1:
    print(n//z[0])
elif len(z) == 2:
    a=z[0]
    b=z[1]
    print(n//a + n//b  - n//(lcm(a*b)))
else:
    a=z[0]
    b=z[1]
    c=z[2]
    print(n//a + n//b + n//c - n//(lcm(a,b)) - n//(lcm(a,c)) - n//(lcm(b,c)) + n//(lcm(lcm(a,b),c)))
    

0