結果

問題 No.1395 Less Sweet Alchemy
ユーザー tenten
提出日時 2021-02-18 09:36:04
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 550 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 74,756 KB
実行使用メモリ 41,288 KB
最終ジャッジ日時 2024-09-14 17:00:16
合計ジャッジ時間 4,920 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

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