結果

問題 No.894 二種類のバス
ユーザー kumatan400kumatan400
提出日時 2022-06-18 01:46:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 204 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 53,672 KB
最終ジャッジ日時 2024-04-17 18:17:37
合計ジャッジ時間 1,462 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,144 KB
testcase_01 AC 33 ms
53,672 KB
testcase_02 AC 30 ms
52,656 KB
testcase_03 AC 30 ms
52,604 KB
testcase_04 AC 30 ms
52,412 KB
testcase_05 AC 29 ms
52,192 KB
testcase_06 AC 31 ms
52,540 KB
testcase_07 AC 31 ms
53,664 KB
testcase_08 AC 32 ms
51,956 KB
testcase_09 AC 30 ms
53,344 KB
testcase_10 AC 29 ms
52,468 KB
testcase_11 AC 29 ms
53,576 KB
testcase_12 AC 30 ms
52,820 KB
testcase_13 AC 30 ms
52,108 KB
testcase_14 AC 30 ms
52,720 KB
testcase_15 AC 30 ms
52,292 KB
testcase_16 AC 30 ms
52,600 KB
testcase_17 AC 31 ms
52,852 KB
testcase_18 AC 30 ms
53,028 KB
testcase_19 AC 30 ms
52,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T, A, B = map(int, input().split())

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

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

ans = ceil(T, A) + ceil(T, B) - ceil(T, lcm(A, B))
print(ans)
0