結果

問題 No.998 Four Integers
ユーザー pacicficdolphin
提出日時 2020-03-08 12:32:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 436 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 41,456 KB
最終ジャッジ日時 2024-11-30 23:20:43
合計ジャッジ時間 5,578 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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