結果

問題 No.1395 Less Sweet Alchemy
ユーザー ks2mks2m
提出日時 2021-02-14 21:22:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 2,847 ms
コンパイル使用メモリ 71,700 KB
実行使用メモリ 56,680 KB
最終ジャッジ日時 2023-09-29 14:22:42
合計ジャッジ時間 5,461 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,132 KB
testcase_01 AC 121 ms
56,264 KB
testcase_02 AC 119 ms
55,912 KB
testcase_03 AC 119 ms
55,792 KB
testcase_04 AC 120 ms
55,700 KB
testcase_05 AC 120 ms
56,164 KB
testcase_06 AC 129 ms
56,176 KB
testcase_07 AC 125 ms
56,212 KB
testcase_08 AC 126 ms
56,136 KB
testcase_09 AC 116 ms
56,116 KB
testcase_10 AC 117 ms
56,020 KB
testcase_11 AC 127 ms
56,680 KB
testcase_12 AC 127 ms
55,980 KB
testcase_13 AC 127 ms
56,380 KB
権限があれば一括ダウンロードができます

ソースコード

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