結果

問題 No.998 Four Integers
ユーザー konataro15konataro15
提出日時 2020-03-24 20:25:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 353 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 71,832 KB
実行使用メモリ 56,012 KB
最終ジャッジ日時 2023-08-30 05:46:28
合計ジャッジ時間 7,223 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,748 KB
testcase_01 AC 125 ms
55,856 KB
testcase_02 AC 124 ms
56,012 KB
testcase_03 AC 125 ms
55,620 KB
testcase_04 AC 123 ms
55,768 KB
testcase_05 AC 126 ms
55,776 KB
testcase_06 AC 125 ms
55,736 KB
testcase_07 AC 124 ms
56,008 KB
testcase_08 AC 124 ms
55,712 KB
testcase_09 AC 126 ms
55,632 KB
testcase_10 AC 127 ms
55,708 KB
testcase_11 AC 128 ms
55,736 KB
testcase_12 AC 127 ms
55,604 KB
testcase_13 AC 129 ms
55,620 KB
testcase_14 AC 129 ms
55,608 KB
testcase_15 AC 127 ms
55,728 KB
testcase_16 AC 127 ms
55,692 KB
testcase_17 AC 129 ms
55,708 KB
testcase_18 AC 129 ms
55,688 KB
testcase_19 AC 131 ms
55,844 KB
testcase_20 AC 129 ms
53,624 KB
testcase_21 AC 128 ms
55,600 KB
testcase_22 AC 126 ms
55,788 KB
testcase_23 AC 127 ms
55,980 KB
testcase_24 AC 126 ms
55,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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