結果

問題 No.894 二種類のバス
ユーザー c-yan
提出日時 2020-03-22 02:35:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 1,000 ms
コード長 185 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-24 07:36:14
合計ジャッジ時間 1,750 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd


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


T, A, B = map(int, input().split())

print(((T - 1) // A + 1) + ((T - 1) // B + 1) - ((T - 1) // lcm(A, B) + 1))
0