結果

問題 No.1250 汝は倍数なりや?
ユーザー kusagame12kusagame12
提出日時 2023-11-06 18:35:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 765 ms / 1,000 ms
コード長 628 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 79,060 KB
実行使用メモリ 70,772 KB
最終ジャッジ日時 2023-11-06 18:35:33
合計ジャッジ時間 20,132 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
57,276 KB
testcase_01 AC 112 ms
56,264 KB
testcase_02 AC 124 ms
55,608 KB
testcase_03 AC 127 ms
57,660 KB
testcase_04 AC 126 ms
57,424 KB
testcase_05 AC 126 ms
57,196 KB
testcase_06 AC 129 ms
57,232 KB
testcase_07 AC 127 ms
57,356 KB
testcase_08 AC 124 ms
57,440 KB
testcase_09 AC 125 ms
55,344 KB
testcase_10 AC 125 ms
57,436 KB
testcase_11 AC 125 ms
57,536 KB
testcase_12 AC 125 ms
57,688 KB
testcase_13 AC 134 ms
57,692 KB
testcase_14 AC 138 ms
57,632 KB
testcase_15 AC 140 ms
55,884 KB
testcase_16 AC 138 ms
57,668 KB
testcase_17 AC 129 ms
57,740 KB
testcase_18 AC 133 ms
57,720 KB
testcase_19 AC 126 ms
57,528 KB
testcase_20 AC 137 ms
55,852 KB
testcase_21 AC 125 ms
57,276 KB
testcase_22 AC 132 ms
57,756 KB
testcase_23 AC 197 ms
58,208 KB
testcase_24 AC 191 ms
57,604 KB
testcase_25 AC 181 ms
57,824 KB
testcase_26 AC 156 ms
57,740 KB
testcase_27 AC 180 ms
57,772 KB
testcase_28 AC 173 ms
57,600 KB
testcase_29 AC 159 ms
57,468 KB
testcase_30 AC 188 ms
58,000 KB
testcase_31 AC 173 ms
57,596 KB
testcase_32 AC 181 ms
57,640 KB
testcase_33 AC 748 ms
70,772 KB
testcase_34 AC 573 ms
60,432 KB
testcase_35 AC 709 ms
67,288 KB
testcase_36 AC 709 ms
67,056 KB
testcase_37 AC 553 ms
63,356 KB
testcase_38 AC 584 ms
63,736 KB
testcase_39 AC 583 ms
62,096 KB
testcase_40 AC 574 ms
62,956 KB
testcase_41 AC 665 ms
66,100 KB
testcase_42 AC 535 ms
62,140 KB
testcase_43 AC 735 ms
67,620 KB
testcase_44 AC 542 ms
62,144 KB
testcase_45 AC 765 ms
68,256 KB
testcase_46 AC 425 ms
60,976 KB
testcase_47 AC 612 ms
63,724 KB
testcase_48 AC 126 ms
57,564 KB
testcase_49 AC 124 ms
57,524 KB
testcase_50 AC 123 ms
57,520 KB
testcase_51 AC 123 ms
57,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int h = sc.nextInt();
        int[] as = new int[n];
       
        long data = 1l;
        if(h == 1){
            System.out.println("YES");
            return;
        }
        for(int i = 0 ; i < n ; i++){
            
            int a = sc.nextInt();
            
            data = (data % h) * (a % h);
            
        }
       
        System.out.println(data % h == 0 ? "YES" : "NO");
        
    }
   
}

0