結果

問題 No.998 Four Integers
ユーザー nogisunnogisun
提出日時 2020-03-23 16:41:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 72,100 KB
実行使用メモリ 57,952 KB
最終ジャッジ日時 2023-08-27 03:13:32
合計ジャッジ時間 7,975 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,928 KB
testcase_01 AC 127 ms
55,984 KB
testcase_02 AC 126 ms
55,636 KB
testcase_03 AC 126 ms
55,812 KB
testcase_04 AC 125 ms
55,912 KB
testcase_05 AC 127 ms
56,348 KB
testcase_06 AC 126 ms
56,056 KB
testcase_07 AC 127 ms
56,096 KB
testcase_08 AC 126 ms
55,796 KB
testcase_09 AC 126 ms
55,864 KB
testcase_10 AC 125 ms
55,576 KB
testcase_11 AC 128 ms
55,748 KB
testcase_12 AC 125 ms
55,972 KB
testcase_13 AC 126 ms
55,596 KB
testcase_14 AC 128 ms
56,216 KB
testcase_15 AC 127 ms
55,860 KB
testcase_16 AC 126 ms
56,212 KB
testcase_17 AC 129 ms
55,644 KB
testcase_18 WA -
testcase_19 AC 129 ms
55,552 KB
testcase_20 AC 129 ms
55,824 KB
testcase_21 WA -
testcase_22 AC 129 ms
55,916 KB
testcase_23 WA -
testcase_24 AC 127 ms
55,800 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