結果

問題 No.2836 Comment Out
ユーザー fiblonaria
提出日時 2024-08-15 04:20:37
言語 Java
(openjdk 23)
結果
AC  
実行時間 889 ms / 2,000 ms
コード長 614 bytes
コンパイル時間 3,600 ms
コンパイル使用メモリ 74,708 KB
実行使用メモリ 67,640 KB
最終ジャッジ日時 2024-08-15 04:21:13
合計ジャッジ時間 36,422 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class CheckZeroOrOne {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] A = new int[n];
        boolean containsZeroOrOne = false;
        for (int i = 0; i < n; i++) {
            A[i] = scanner.nextInt();
            if (A[i] == 0 || A[i] == 1) {
                containsZeroOrOne = true;
            }
        }
        if (containsZeroOrOne) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        scanner.close();
    }
}
0