結果

問題 No.998 Four Integers
ユーザー pacicficdolphinpacicficdolphin
提出日時 2020-03-08 12:32:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 436 bytes
コンパイル時間 2,861 ms
コンパイル使用メモリ 75,140 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-08-20 19:21:40
合計ジャッジ時間 6,673 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,756 KB
testcase_01 AC 111 ms
55,964 KB
testcase_02 AC 105 ms
55,884 KB
testcase_03 AC 107 ms
55,716 KB
testcase_04 AC 106 ms
55,768 KB
testcase_05 AC 107 ms
56,104 KB
testcase_06 AC 109 ms
55,808 KB
testcase_07 AC 111 ms
55,700 KB
testcase_08 AC 109 ms
55,644 KB
testcase_09 AC 110 ms
55,872 KB
testcase_10 AC 112 ms
55,460 KB
testcase_11 AC 112 ms
55,868 KB
testcase_12 AC 112 ms
55,956 KB
testcase_13 AC 109 ms
55,708 KB
testcase_14 AC 111 ms
55,660 KB
testcase_15 AC 111 ms
55,468 KB
testcase_16 AC 110 ms
55,964 KB
testcase_17 AC 113 ms
55,712 KB
testcase_18 AC 118 ms
55,788 KB
testcase_19 AC 113 ms
55,460 KB
testcase_20 AC 114 ms
55,804 KB
testcase_21 AC 113 ms
55,860 KB
testcase_22 AC 111 ms
55,704 KB
testcase_23 AC 114 ms
56,116 KB
testcase_24 AC 108 ms
55,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) {

		int [] Y = new int[4]; 
	
		Scanner scanner= new Scanner(System.in);
		
	
		 
		for(int i=0;i<Y.length;i++) {
			Y[i]=scanner.nextInt();
		}
			
	
		 Arrays.sort(Y);
		
	
		for(int i=0 ; i<Y.length-1 ; i++ ) {
			if(Y[i+1]-Y[i] !=1) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
}
0