結果
| 問題 | No.894 二種類のバス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-26 21:19:59 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 1,000 ms |
| コード長 | 247 bytes |
| 記録 | |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 20,692 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-04-04 14:13:55 |
| 合計ジャッジ時間 | 3,154 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
def Gcd(m,n) :
while m % n != 0 :
temp = n
n = m % n
m = temp
return n
T,A,B=map(int, input().split())
T -= 1
a = T // A
b = T // B
commonNum = A * B // Gcd(A,B)
aAndB = T // commonNum
print(a + b - aAndB + 1)