結果

問題 No.998 Four Integers
ユーザー ika__siika__si
提出日時 2020-04-25 14:34:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 1,478 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 74,612 KB
実行使用メモリ 41,704 KB
最終ジャッジ日時 2024-04-24 17:00:27
合計ジャッジ時間 5,693 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
40,036 KB
testcase_01 AC 110 ms
40,088 KB
testcase_02 AC 114 ms
41,048 KB
testcase_03 AC 112 ms
41,048 KB
testcase_04 AC 116 ms
40,760 KB
testcase_05 AC 117 ms
41,276 KB
testcase_06 AC 118 ms
41,496 KB
testcase_07 AC 121 ms
40,120 KB
testcase_08 AC 113 ms
40,992 KB
testcase_09 AC 107 ms
40,012 KB
testcase_10 AC 118 ms
41,520 KB
testcase_11 AC 120 ms
41,704 KB
testcase_12 AC 112 ms
41,336 KB
testcase_13 AC 111 ms
41,188 KB
testcase_14 AC 116 ms
41,444 KB
testcase_15 AC 116 ms
41,052 KB
testcase_16 AC 106 ms
40,064 KB
testcase_17 AC 115 ms
41,392 KB
testcase_18 AC 119 ms
40,312 KB
testcase_19 AC 113 ms
40,092 KB
testcase_20 AC 117 ms
40,940 KB
testcase_21 AC 116 ms
41,544 KB
testcase_22 AC 114 ms
41,508 KB
testcase_23 AC 102 ms
40,400 KB
testcase_24 AC 116 ms
41,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {

  // int n = sc.nextInt();
  // long m = sc.nextLong();
  // String s = sc.next();
  // double d = sc.nextDouble();

  // // 最大公約数
  // public static long gcd (long m,long n) {
  //   if (m < n) return gcd(n,m);
  //   if (n == 0) return m;
  //   return gcd(n,m%n);
  // }
  //
  // // 最小公倍数
  // public static long lcm (long m,long n) {
  //   return m*n/gcd(m,n);
  // }
  //
  // // 素数判定
  // public static boolean isPrime (long n) {
  //   if (n == 2) return true;
  //   if (n < 2 || n%2 == 0) return false;
  //   double d = Math.sqrt(n);
  //   for (int i = 3; i <= d; i+=2) {
  //     if (n%i == 0) {
  //       return false;
  //     }
  //   }
  //   return true;
  // }
  //
  // public static final long gcd3(long[] param) {
  //   int len = param.length;
  //   long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
  //   for (int i = 1; i < len - 1; i++) {
  //       g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
  //   }
  //   return g;
  // }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[] data = new int[4];

    for (int i = 0; i < 4; i++) {
      data[i] = sc.nextInt();
    }

    Arrays.sort(data);

    for (int i = 0; i < 4; i++) {
      if (data[0]+i != data[i]) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");

  }

}
0