結果

問題 No.1395 Less Sweet Alchemy
ユーザー tentententen
提出日時 2021-02-18 09:36:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 3,662 ms
コンパイル使用メモリ 71,700 KB
実行使用メモリ 57,800 KB
最終ジャッジ日時 2023-10-12 18:32:34
合計ジャッジ時間 7,111 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,728 KB
testcase_01 AC 122 ms
56,048 KB
testcase_02 AC 124 ms
55,484 KB
testcase_03 AC 122 ms
56,172 KB
testcase_04 AC 122 ms
55,904 KB
testcase_05 AC 124 ms
55,964 KB
testcase_06 AC 133 ms
55,772 KB
testcase_07 AC 129 ms
57,800 KB
testcase_08 AC 131 ms
55,608 KB
testcase_09 AC 124 ms
57,768 KB
testcase_10 AC 125 ms
55,660 KB
testcase_11 AC 133 ms
55,600 KB
testcase_12 AC 130 ms
55,384 KB
testcase_13 AC 133 ms
55,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int max = 0;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            int y = sc.nextInt();
            max = Math.max(max, y);
            min = Math.min(min, y);
        }
        if (max >= x && min <= x) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
0