結果

問題 No.894 二種類のバス
ユーザー satama123
提出日時 2023-11-30 20:52:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 205 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-09-26 14:52:52
合計ジャッジ時間 1,789 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

T, A, B = map(int, input().split())
if T % A == 0 or  T % B == 0: T -= 1
def gcd(a, b):
    if b == 0 : return a
    else : return gcd(b, a % b)

L = A * B // gcd(A, B)

print(T // A + T // B - T // L + 1)
0