結果

問題 No.894 二種類のバス
ユーザー ntuda
提出日時 2024-01-21 19:47:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 183 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 53,420 KB
最終ジャッジ日時 2024-09-28 06:15:09
合計ジャッジ時間 1,752 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import lcm

T, A, B = map(int, input().split())
C = lcm(A, B)
a = T // C
ans = a * (C // A + C // B - 1)
if T % C > 0:
    ans += (T % C) // A + (T % C) // B + 1
print(ans)
0