結果

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

ソースコード

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(l + 2001 < r) r = l + 1002;
    	long min = Long.MAX_VALUE;
    	for(long i = l; i <= r; i++){
    		long k = i * c % 1000;
    		min = Math.min(k,min);
    	}
    	System.out.println(min);
    }
}
0