結果

問題 No.894 二種類のバス
ユーザー Novi
提出日時 2019-12-01 20:54:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 305 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 73,836 KB
最終ジャッジ日時 2024-11-21 17:49:10
合計ジャッジ時間 14,106 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 2 WA * 14 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import  numpy as np
t,a,b=map(int,input().split())
tmp=np.lcm(a,b)
if t>=tmp:
    cnt=0
    cnt+=tmp//a
    cnt+=tmp//b
    cnt-=1

    b=t//tmp
    cv=t%tmp
    ans=cnt*b
    for i in range(0,cv+1):
        if i%a==0 or i%b==0:
            ans+=1

    print(ans-1)

else:
    ans=t//a+t//b
    print(ans)
0