結果

問題 No.1395 Less Sweet Alchemy
ユーザー ks2m
提出日時 2021-02-14 21:22:14
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 4,202 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 41,544 KB
最終ジャッジ日時 2024-07-22 08:34:53
合計ジャッジ時間 6,510 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int[] c = new int[n];
		for (int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
		}
		sc.close();

		int min = 100;
		int max = 0;
		for (int i = 0; i < n; i++) {
			min = Math.min(min, c[i]);
			max = Math.max(max, c[i]);
		}
		if (min <= x && x <= max) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
0