結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー takakintakakin
提出日時 2020-04-12 21:28:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 10,116 KB
最終ジャッジ日時 2023-10-22 08:20:57
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a

n=int(input())
a,b,c=map(int,input().split())
ab,bc,ca,abc=a*b//gcd(a,b),b*c//gcd(b,c),c*a//gcd(c,a),a*b*c//gcd(a,gcd(b,c))

print(n//a+n//b+n//c-n//ab-n//bc-n//ca+n//abc)
0