結果

問題 No.2259 Gas Station
ユーザー 👑 KazunKazun
提出日時 2023-04-07 21:21:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 296 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,552 KB
実行使用メモリ 82,004 KB
最終ジャッジ日時 2024-04-10 16:28:23
合計ジャッジ時間 4,293 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,700 KB
testcase_01 AC 36 ms
52,948 KB
testcase_02 AC 36 ms
52,636 KB
testcase_03 AC 35 ms
53,684 KB
testcase_04 AC 33 ms
52,656 KB
testcase_05 AC 34 ms
52,396 KB
testcase_06 AC 34 ms
53,164 KB
testcase_07 AC 35 ms
52,796 KB
testcase_08 AC 34 ms
52,688 KB
testcase_09 AC 34 ms
53,196 KB
testcase_10 AC 33 ms
52,952 KB
testcase_11 AC 34 ms
52,732 KB
testcase_12 AC 34 ms
52,620 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    L,R,C=map(int,input().split())

    ans=10**9
    for x in range(L,R+1):
        cost=C*x
        if C*x%1000==0:
            r=0
        else:
            r=1000-cost%1000
        ans=min(ans,r)
    return ans

#==================================================
print(solve())
0