結果
問題 | No.998 Four Integers |
ユーザー |
|
提出日時 | 2020-02-28 21:26:29 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 119 ms / 1,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 1,891 ms |
コンパイル使用メモリ | 74,772 KB |
実行使用メモリ | 41,608 KB |
最終ジャッジ日時 | 2024-11-30 23:03:07 |
合計ジャッジ時間 | 5,476 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
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)); } }