結果

問題 No.2259 Gas Station
ユーザー lllllll88938494
提出日時 2023-04-13 03:23:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-10-09 04:28:59
合計ジャッジ時間 2,043 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

l,r,c=map(int,input().split())

if r-l < 100000:
    ans = 10**10
    for i in range(l,r+1):
        if i*c < 1000:
            ans=min(i*c,ans)
        else:
            ans=min(i*c%1000,ans)
    print(ans)
    exit()
        

t=l*c // 1000
t1=r*c// 1000

if t1 - t > 0:
    print(0)
else:
    ans = 10**10
    for i in range(l,r+1):
        if i*c < 1000:
            ans=min(i*c,ans)
        else:
            ans=min(i*c%1000,ans)
    print(ans)
        
0