結果

問題 No.894 二種類のバス
ユーザー stng
提出日時 2022-08-07 12:25:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 113 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,208 KB
実行使用メモリ 53,576 KB
最終ジャッジ日時 2024-09-17 06:29:32
合計ジャッジ時間 1,763 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
t,a,b = map(int,input().split())
lcm = a//math.gcd(a,b)*b

t -= 1
ans = t//a+t//b-t//lcm+1
print(ans)
0