結果
| 問題 | No.894 二種類のバス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-11 12:48:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 1,000 ms |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 350 ms |
| コンパイル使用メモリ | 82,652 KB |
| 実行使用メモリ | 54,352 KB |
| 最終ジャッジ日時 | 2025-12-11 12:48:59 |
| 合計ジャッジ時間 | 2,535 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
import sys
from math import gcd
def input(): return sys.stdin.readline().rstrip('\n')
def cdiv(a, b):
return (a + b - 1) // b
def main():
t, a, b = map(int, input().split())
c = a * b // gcd(a, b)
return cdiv(t, a) + cdiv(t, b) - cdiv(t, c)
if __name__ == '__main__':
ret = main()
if ret is not None:
print(ret)