結果

問題 No.894 二種類のバス
ユーザー tcltktcltk
提出日時 2021-07-02 01:38:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 1,000 ms
コード長 427 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 89,724 KB
最終ジャッジ日時 2023-09-10 23:17:25
合計ジャッジ時間 7,145 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
89,624 KB
testcase_01 AC 216 ms
89,560 KB
testcase_02 AC 216 ms
89,600 KB
testcase_03 AC 217 ms
89,688 KB
testcase_04 AC 227 ms
89,620 KB
testcase_05 AC 226 ms
89,416 KB
testcase_06 AC 215 ms
89,448 KB
testcase_07 AC 216 ms
89,556 KB
testcase_08 AC 217 ms
89,724 KB
testcase_09 AC 219 ms
89,440 KB
testcase_10 AC 221 ms
89,544 KB
testcase_11 AC 224 ms
89,400 KB
testcase_12 AC 222 ms
89,400 KB
testcase_13 AC 219 ms
89,440 KB
testcase_14 AC 217 ms
89,452 KB
testcase_15 AC 219 ms
89,340 KB
testcase_16 AC 218 ms
89,620 KB
testcase_17 AC 215 ms
89,656 KB
testcase_18 AC 215 ms
89,664 KB
testcase_19 AC 219 ms
89,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

T, A, B = map(int, input().split())
T -= 1
ans = (T//A+1) + (T//B+1) - (T//(A*B//math.gcd(A,B))+1)
print(ans)
0