結果

問題 No.1250 汝は倍数なりや?
ユーザー xRS43BofaUEZ5gc
提出日時 2021-03-11 09:06:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 745 ms / 1,000 ms
コード長 391 bytes
コンパイル時間 4,016 ms
コンパイル使用メモリ 80,344 KB
実行使用メモリ 68,816 KB
最終ジャッジ日時 2025-04-21 23:18:04
合計ジャッジ時間 20,865 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	long n = sc.nextLong();
	    	long h = sc.nextLong();
	    	long ans = 1;
	    	for (int i = 0; i < n; i ++) {
	    		ans = ans * sc.nextLong() % h;
	    	}

	    	System.out.println(ans == 0? "YES" : "NO");
	    	}

	    }
0