結果
| 問題 | No.2259 Gas Station |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-07 21:27:34 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 54,272 KB |
| 最終ジャッジ日時 | 2026-04-19 02:32:43 |
| 合計ジャッジ時間 | 7,796 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)