結果
| 問題 |
No.1395 Less Sweet Alchemy
|
| コンテスト | |
| ユーザー |
xRS43BofaUEZ5gc
|
| 提出日時 | 2021-03-05 09:19:47 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 135 ms / 2,000 ms |
| コード長 | 804 bytes |
| コンパイル時間 | 3,086 ms |
| コンパイル使用メモリ | 74,608 KB |
| 実行使用メモリ | 54,240 KB |
| 最終ジャッジ日時 | 2024-10-06 04:36:08 |
| 合計ジャッジ時間 | 5,600 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int x = sc.nextInt();
int[] ci = new int[n];
boolean flag_equal = false;
boolean flag_smaller = false;
boolean flag_bigger = false;
for (int i=0; i < n; i ++) {
ci[i] = sc.nextInt();
if (ci[i] == x) {flag_equal = true;}
if (ci[i] > x) {flag_bigger = true;}
if (ci[i] < x) {flag_smaller = true;}
}
sc.close();
if (flag_equal == true) {
System.out.println("Yes");
}else if (flag_bigger ==true && flag_smaller == true) {
System.out.println("Yes");
}else {
System.out.println("No");
}
}
}
xRS43BofaUEZ5gc