結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-08 09:48:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 126 ms / 1,000 ms |
| コード長 | 710 bytes |
| コンパイル時間 | 4,183 ms |
| コンパイル使用メモリ | 78,404 KB |
| 実行使用メモリ | 54,164 KB |
| 最終ジャッジ日時 | 2024-07-05 06:06:07 |
| 合計ジャッジ時間 | 8,322 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
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");
}
}