結果

問題 No.2259 Gas Station
ユーザー kanenistkanenist
提出日時 2023-04-11 12:03:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 75,252 KB
実行使用メモリ 55,980 KB
最終ジャッジ日時 2024-04-16 10:57:38
合計ジャッジ時間 6,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,676 KB
testcase_01 AC 128 ms
41,360 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 133 ms
40,964 KB
testcase_05 WA -
testcase_06 AC 131 ms
41,480 KB
testcase_07 AC 127 ms
41,516 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 130 ms
41,604 KB
testcase_11 AC 131 ms
41,476 KB
testcase_12 AC 130 ms
41,784 KB
testcase_13 AC 129 ms
41,544 KB
testcase_14 AC 131 ms
41,228 KB
testcase_15 AC 129 ms
41,340 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 127 ms
41,768 KB
testcase_20 AC 129 ms
42,072 KB
testcase_21 AC 131 ms
41,500 KB
testcase_22 AC 130 ms
40,940 KB
testcase_23 AC 132 ms
41,696 KB
権限があれば一括ダウンロードができます

ソースコード

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