結果

問題 No.2259 Gas Station
ユーザー kanenistkanenist
提出日時 2023-04-11 11:59:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 2,624 ms
コンパイル使用メモリ 74,784 KB
実行使用メモリ 41,668 KB
最終ジャッジ日時 2024-04-16 10:54:58
合計ジャッジ時間 6,994 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,420 KB
testcase_01 AC 132 ms
41,092 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 139 ms
40,852 KB
testcase_05 WA -
testcase_06 AC 139 ms
41,564 KB
testcase_07 AC 136 ms
41,392 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 138 ms
41,408 KB
testcase_11 AC 138 ms
41,400 KB
testcase_12 AC 136 ms
41,416 KB
testcase_13 AC 136 ms
41,580 KB
testcase_14 AC 139 ms
41,176 KB
testcase_15 AC 137 ms
41,392 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 144 ms
41,248 KB
testcase_20 AC 137 ms
41,196 KB
testcase_21 AC 140 ms
41,444 KB
testcase_22 AC 142 ms
41,668 KB
testcase_23 AC 140 ms
41,548 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(1000 < r - l)r = l + 1000;
    	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