結果
問題 | No.894 二種類のバス |
ユーザー |
|
提出日時 | 2019-09-27 21:53:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 1,000 ms |
コード長 | 279 bytes |
コンパイル時間 | 135 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-24 22:52:56 |
合計ジャッジ時間 | 1,414 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
import matht, a, b = map(int, input().split())lc = a // math.gcd(a, b) * b# lcまでの出発回数ldept = lc//a + lc//b - 1ans = ldept * (t // lc)t %= lc# print(ldept, t, (t+a-1)//a, (t+b-1)//b)ans += (t+a-1)//aans += (t+b-1)//bif t != 0:ans -= 1print(ans)