結果

問題 No.894 二種類のバス
ユーザー aaaaaaaaaa2230
提出日時 2022-05-04 23:31:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 131 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-07-04 02:10:14
合計ジャッジ時間 1,717 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

t,a,b = map(int,input().split())

ans = (t+a-1)//a+(t+b-1)//b

l = a*b//gcd(a,b)
ans -= (t+l-1)//l
print(ans)
0