結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー magurogumamaguroguma
提出日時 2017-08-15 02:33:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 11:30:32
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 27 ms
10,752 KB
testcase_04 AC 28 ms
10,624 KB
testcase_05 WA -
testcase_06 AC 27 ms
10,624 KB
testcase_07 AC 28 ms
10,624 KB
testcase_08 AC 28 ms
10,624 KB
testcase_09 AC 28 ms
10,752 KB
testcase_10 AC 28 ms
10,752 KB
testcase_11 AC 29 ms
10,624 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 27 ms
10,752 KB
testcase_15 AC 28 ms
10,880 KB
testcase_16 AC 29 ms
10,752 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 28 ms
10,752 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 WA -
testcase_26 AC 27 ms
10,624 KB
testcase_27 AC 29 ms
10,752 KB
testcase_28 AC 28 ms
10,752 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 28 ms
10,752 KB
testcase_32 WA -
testcase_33 AC 27 ms
10,752 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N = int(input())
a,b,c = map(int, input().split())

ab = a*b if b%a!=0 else b
bc = b*c if c%b!=0 else c
ca = c*a if c%a!=0 else c

abc = a*b*c
if ab == b or ca == c:
    abc //= a
if bc == c:
    abc //= b

a_num = N//a
b_num = N//b
c_num = N//c
ab_num = N//ab
bc_num = N//bc
ca_num = N//ca
abc_num = N//abc

print(a_num + b_num + c_num - ab_num - bc_num - ca_num + abc_num)

0