結果

問題 No.2259 Gas Station
ユーザー ttomo2023
提出日時 2023-05-01 12:24:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-20 11:56:40
合計ジャッジ時間 1,725 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 15 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a = c%1000
min_cost = []
for i in range(1, 1001):
    x =  1000 - i * a
    if x >= 0:
        min_cost.append(x)
    else:
        min_cost.append(2000 - i * a)

if r - l < 1000:
    l = l%1000
    r = r%1000
    print(min(min_cost[l-1: r]))
else:
    print(min(min_cost))
0