結果

問題 No.998 Four Integers
ユーザー nogisunnogisun
提出日時 2020-03-23 16:40:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 3,401 ms
コンパイル使用メモリ 72,700 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2023-08-27 03:11:14
合計ジャッジ時間 7,942 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,824 KB
testcase_01 AC 122 ms
55,612 KB
testcase_02 AC 123 ms
55,992 KB
testcase_03 AC 128 ms
55,760 KB
testcase_04 AC 128 ms
55,912 KB
testcase_05 AC 126 ms
56,076 KB
testcase_06 AC 121 ms
56,104 KB
testcase_07 AC 122 ms
55,916 KB
testcase_08 AC 121 ms
55,924 KB
testcase_09 AC 127 ms
55,840 KB
testcase_10 AC 120 ms
53,512 KB
testcase_11 AC 126 ms
55,684 KB
testcase_12 AC 123 ms
56,020 KB
testcase_13 AC 117 ms
56,092 KB
testcase_14 AC 120 ms
56,040 KB
testcase_15 AC 121 ms
55,840 KB
testcase_16 AC 119 ms
56,152 KB
testcase_17 AC 118 ms
55,564 KB
testcase_18 WA -
testcase_19 AC 123 ms
56,288 KB
testcase_20 AC 121 ms
56,144 KB
testcase_21 WA -
testcase_22 AC 120 ms
55,924 KB
testcase_23 WA -
testcase_24 AC 121 ms
55,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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