結果

問題 No.894 二種類のバス
ユーザー kumatan400kumatan400
提出日時 2023-02-26 07:35:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 1,000 ms
コード長 190 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 71,752 KB
最終ジャッジ日時 2023-10-12 00:43:46
合計ジャッジ時間 3,350 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,700 KB
testcase_01 AC 66 ms
71,184 KB
testcase_02 AC 68 ms
71,348 KB
testcase_03 AC 66 ms
71,752 KB
testcase_04 AC 65 ms
71,680 KB
testcase_05 AC 69 ms
71,336 KB
testcase_06 AC 64 ms
71,560 KB
testcase_07 AC 65 ms
71,524 KB
testcase_08 AC 65 ms
71,196 KB
testcase_09 AC 64 ms
71,304 KB
testcase_10 AC 65 ms
71,328 KB
testcase_11 AC 64 ms
71,468 KB
testcase_12 AC 65 ms
71,676 KB
testcase_13 AC 66 ms
71,520 KB
testcase_14 AC 64 ms
71,340 KB
testcase_15 AC 65 ms
71,332 KB
testcase_16 AC 64 ms
71,700 KB
testcase_17 AC 64 ms
71,468 KB
testcase_18 AC 64 ms
71,324 KB
testcase_19 AC 65 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

a = (T-1) // A
b = (T-1) // B

l = lcm(A, B)
c = (T-1)//l
ans = a + b - c + 1
print(ans)
0