結果
| 問題 | No.998 Four Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-08 09:48:12 |
| 言語 | Java (openjdk 27.0.1.0.3 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 147 ms / 1,000 ms |
| + 700µs | |
| コード長 | 710 bytes |
| 記録 | |
| コンパイル時間 | 3,200 ms |
| コンパイル使用メモリ | 101,360 KB |
| 実行使用メモリ | 48,428 KB |
| 最終ジャッジ日時 | 2026-11-12 01:50:00 |
| 合計ジャッジ時間 | 9,160 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
// https://yukicoder.me/problems/no/998
public class FourIntegers998 {
public static void main(String[] args) {
// 標準入力から読み込む際に、Scan
Scanner sc = new Scanner(System.in);
List<Integer> forIntegerList = new ArrayList<Integer>();
for (int i = 0; i < 4; i++) {
forIntegerList.add(Integer.parseInt(sc.next()));
}
Collections.sort(forIntegerList);
for (int i = 0; i < 3; i++) {
if (forIntegerList.get(i) + 1 != forIntegerList.get(i + 1)) {
System.out.println("No");
return;
}
}
System.out.println("Yes");
}
}