結果
| 問題 |
No.998 Four Integers
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2020-02-28 21:21:41 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 1,000 ms |
| コード長 | 457 bytes |
| コンパイル時間 | 2,156 ms |
| コンパイル使用メモリ | 74,716 KB |
| 実行使用メモリ | 41,876 KB |
| 最終ジャッジ日時 | 2024-11-30 22:57:56 |
| 合計ジャッジ時間 | 6,506 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int[] a = new int[4];
for (int i = 0; i < a.length; i++) {
a[i] = sc.nextInt();
}
sc.close();
Arrays.parallelSort(a);
for (int i = 1; i < a.length; i++) {
if (a[i - 1] + 1 != a[i]) {
System.out.println("No");
return;
}
}
System.out.println("Yes");
}
}
ks2m