結果

問題 No.2259 Gas Station
ユーザー kanenist
提出日時 2023-04-11 11:54:29
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 74,764 KB
実行使用メモリ 56,376 KB
最終ジャッジ日時 2024-10-07 04:06:07
合計ジャッジ時間 6,568 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 1 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
    	int l = sc.nextInt();
    	int r = sc.nextInt();
    	int c = sc.nextInt();
    	if(100000 < r - l)r = l + 100000;
    	long min = Long.MAX_VALUE;
    	for(int i = l; i <= r; i++){
    		long k = i * c % 1000;
    		min = Math.min(k,min);
    	}
    	System.out.println(min);
    }
}
0