結果

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

ソースコード

diff #

T, A, B = map(int, input().split())
if T % A == 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