結果

問題 No.894 二種類のバス
ユーザー lie_of_lillie
提出日時 2021-07-08 14:41:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 255 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-07-01 12:31:14
合計ジャッジ時間 1,679 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
T, A, B = map(int,input().split())
m1 = T//A if T%A == 0 else T//A + 1
m2 = T//B if T%B == 0 else T//B + 1
#print(math.gcd(m1, m2))
common = A*B//math.gcd(A, B)
m3 = T//common if T%common == 0 else T//common + 1
#print(m1 + m2)
print(m1+m2-m3)
0