結果
| 問題 | No.965 門松列が嫌い |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2020-01-13 20:38:22 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 600 bytes |
| 記録 | |
| コンパイル時間 | 1,587 ms |
| コンパイル使用メモリ | 81,736 KB |
| 実行使用メモリ | 39,296 KB |
| 最終ジャッジ日時 | 2026-05-28 07:57:57 |
| 合計ジャッジ時間 | 2,583 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 WA * 4 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] sa = br.readLine().split(" ");
int a = Integer.parseInt(sa[0]);
int b = Integer.parseInt(sa[1]);
int c = Integer.parseInt(sa[2]);
br.close();
if (a <= b && b <= c || c <= b && b <= a) {
System.out.println(0);
return;
}
if (a <= b) {
System.out.println(Math.min(b - a, b - c));
} else {
System.out.println(Math.min(a - b, c - b));
}
}
}
ks2m