結果

問題 No.894 二種類のバス
ユーザー rlangevinrlangevin
提出日時 2023-01-14 01:26:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 1,000 ms
コード長 171 bytes
コンパイル時間 1,106 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 71,500 KB
最終ジャッジ日時 2023-08-26 06:15:22
合計ジャッジ時間 3,076 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,360 KB
testcase_01 AC 65 ms
71,360 KB
testcase_02 AC 64 ms
71,472 KB
testcase_03 AC 64 ms
71,304 KB
testcase_04 AC 65 ms
71,160 KB
testcase_05 AC 65 ms
71,356 KB
testcase_06 AC 62 ms
71,332 KB
testcase_07 AC 66 ms
71,004 KB
testcase_08 AC 63 ms
71,424 KB
testcase_09 AC 61 ms
71,404 KB
testcase_10 AC 65 ms
71,276 KB
testcase_11 AC 66 ms
71,160 KB
testcase_12 AC 64 ms
71,412 KB
testcase_13 AC 65 ms
71,500 KB
testcase_14 AC 63 ms
71,208 KB
testcase_15 AC 64 ms
71,016 KB
testcase_16 AC 68 ms
71,320 KB
testcase_17 AC 64 ms
71,324 KB
testcase_18 AC 63 ms
71,160 KB
testcase_19 AC 64 ms
71,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

def ceil(x, y):
    return (x + y - 1)//y

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