結果

問題 No.894 二種類のバス
ユーザー kumatan400kumatan400
提出日時 2023-02-07 07:29:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 205 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 71,684 KB
最終ジャッジ日時 2023-09-18 15:57:15
合計ジャッジ時間 3,706 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,392 KB
testcase_01 AC 72 ms
71,440 KB
testcase_02 AC 72 ms
71,652 KB
testcase_03 AC 72 ms
71,672 KB
testcase_04 AC 71 ms
71,684 KB
testcase_05 AC 70 ms
71,372 KB
testcase_06 AC 72 ms
71,336 KB
testcase_07 AC 73 ms
71,476 KB
testcase_08 AC 73 ms
71,396 KB
testcase_09 AC 72 ms
71,340 KB
testcase_10 AC 73 ms
71,480 KB
testcase_11 AC 73 ms
71,468 KB
testcase_12 AC 72 ms
71,192 KB
testcase_13 AC 72 ms
71,580 KB
testcase_14 AC 72 ms
71,440 KB
testcase_15 AC 72 ms
71,656 KB
testcase_16 AC 72 ms
71,368 KB
testcase_17 AC 71 ms
71,328 KB
testcase_18 AC 71 ms
71,660 KB
testcase_19 AC 72 ms
71,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
def lcm(x, y):
    return x * y // gcd(x, y)

def ceil(a, b):
    return (a+b-1) // b

T, A, B = map(int, input().split())
ans = ceil(T, A) + ceil(T, B) - ceil(T, lcm(A, B))
print(ans)
0