結果
問題 | No.894 二種類のバス |
ユーザー |
|
提出日時 | 2022-06-18 01:46:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 1,000 ms |
コード長 | 204 bytes |
コンパイル時間 | 553 ms |
コンパイル使用メモリ | 82,100 KB |
実行使用メモリ | 53,880 KB |
最終ジャッジ日時 | 2024-10-09 12:23:59 |
合計ジャッジ時間 | 2,311 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
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)