結果

問題 No.998 Four Integers
ユーザー tentententen
提出日時 2020-08-24 17:19:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 467 bytes
コンパイル時間 1,848 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-04-24 03:36:40
合計ジャッジ時間 5,570 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
41,500 KB
testcase_01 AC 109 ms
41,308 KB
testcase_02 AC 109 ms
41,464 KB
testcase_03 AC 110 ms
41,484 KB
testcase_04 AC 110 ms
41,124 KB
testcase_05 AC 101 ms
40,236 KB
testcase_06 AC 112 ms
41,272 KB
testcase_07 AC 108 ms
41,268 KB
testcase_08 AC 110 ms
40,264 KB
testcase_09 AC 114 ms
41,288 KB
testcase_10 AC 115 ms
41,268 KB
testcase_11 AC 116 ms
41,368 KB
testcase_12 AC 118 ms
41,368 KB
testcase_13 AC 109 ms
40,136 KB
testcase_14 AC 106 ms
40,136 KB
testcase_15 AC 111 ms
41,368 KB
testcase_16 AC 103 ms
40,192 KB
testcase_17 AC 112 ms
40,928 KB
testcase_18 AC 113 ms
41,020 KB
testcase_19 AC 109 ms
40,628 KB
testcase_20 AC 120 ms
41,112 KB
testcase_21 AC 113 ms
41,284 KB
testcase_22 AC 112 ms
41,108 KB
testcase_23 AC 111 ms
41,308 KB
testcase_24 AC 111 ms
41,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[4];
        for (int i = 0; i < 4; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        if (arr[0] + 1 == arr[1] && arr[1] + 1 == arr[2] && arr[2] + 1 == arr[3]) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
0