結果

問題 No.2259 Gas Station
ユーザー ttomo2023ttomo2023
提出日時 2023-05-01 12:24:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-30 15:46:21
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 33 ms
10,752 KB
testcase_02 AC 34 ms
10,752 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 AC 30 ms
10,752 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

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