結果
| 問題 | No.2259 Gas Station |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-22 16:09:24 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 64 ms / 2,000 ms |
| + 850µs | |
| コード長 | 705 bytes |
| 記録 | |
| コンパイル時間 | 1,499 ms |
| コンパイル使用メモリ | 83,804 KB |
| 実行使用メモリ | 43,076 KB |
| 最終ジャッジ日時 | 2026-09-04 16:51:21 |
| 合計ジャッジ時間 | 4,890 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import java.util.*;
public class Main {
static int[] dy = {0,1,0,1};
static int[] dx = {1,0,1,0};
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int l = sc.nextInt();
int r = sc.nextInt();
int c = sc.nextInt();
int ans = 999;
for(int i = l ; i <= r ; i++){
int x = ((i % 1000) * (c % 1000)) % 1000;
if(x == 0){
ans = 0;
break;
}
ans = Math.min(ans , 1000 - x);
}
System.out.println(ans);
}
}