結果

問題 No.998 Four Integers
ユーザー 37zigen37zigen
提出日時 2020-02-28 21:26:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 501 bytes
コンパイル時間 2,963 ms
コンパイル使用メモリ 72,756 KB
実行使用メモリ 57,464 KB
最終ジャッジ日時 2023-08-20 19:07:00
合計ジャッジ時間 7,429 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,660 KB
testcase_01 AC 130 ms
55,708 KB
testcase_02 AC 128 ms
55,716 KB
testcase_03 AC 125 ms
56,020 KB
testcase_04 AC 126 ms
55,896 KB
testcase_05 AC 126 ms
55,764 KB
testcase_06 AC 127 ms
56,076 KB
testcase_07 AC 128 ms
55,668 KB
testcase_08 AC 127 ms
55,592 KB
testcase_09 AC 127 ms
56,068 KB
testcase_10 AC 125 ms
55,904 KB
testcase_11 AC 128 ms
55,924 KB
testcase_12 AC 126 ms
55,996 KB
testcase_13 AC 126 ms
57,464 KB
testcase_14 AC 126 ms
55,464 KB
testcase_15 AC 127 ms
55,480 KB
testcase_16 AC 127 ms
55,656 KB
testcase_17 AC 126 ms
55,720 KB
testcase_18 AC 127 ms
55,748 KB
testcase_19 AC 125 ms
55,868 KB
testcase_20 AC 127 ms
55,864 KB
testcase_21 AC 125 ms
53,640 KB
testcase_22 AC 128 ms
56,028 KB
testcase_23 AC 126 ms
55,772 KB
testcase_24 AC 128 ms
56,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	void run() {
		Scanner sc=new Scanner(System.in);
		int[] a=new int[4];
		for(int i=0;i<a.length;++i)a[i]=sc.nextInt();
		Arrays.sort(a);
		boolean flag=true;
		for(int i=0;i+1<a.length;++i)flag&=a[i]+1==a[i+1];
		System.out.println(flag?"Yes":"No");
	}

	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0