結果
| 問題 |
No.2259 Gas Station
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-07 21:27:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 448 bytes |
| コンパイル時間 | 545 ms |
| コンパイル使用メモリ | 82,312 KB |
| 実行使用メモリ | 54,912 KB |
| 最終ジャッジ日時 | 2024-10-02 19:00:31 |
| 合計ジャッジ時間 | 2,288 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd
l,r,c = map(int,input().split())
ans = float("inf")
for i in range(l, min(r, l+1000)+1):
if c * i % 1000 == 0:
print(0)
break
tmp = 1000 - c * i % 1000
ans = min(ans, tmp)
else:
print(ans)