結果
| 問題 | No.1250 汝は倍数なりや? | 
| コンテスト | |
| ユーザー |  _umbrella_kasa | 
| 提出日時 | 2021-07-03 10:06:12 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 492 bytes | 
| コンパイル時間 | 1,512 ms | 
| コンパイル使用メモリ | 166,592 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-30 02:59:40 | 
| 合計ジャッジ時間 | 3,751 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 49 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    long int H;
    cin >> N >> H;
    long int A[N];
    for (int i=0; i<N; i++) {
        cin >> A[i];
        if (A[i]>=0) {
            A[i]=A[i]%H;
        }
        else {
            A[i]=(1000000000*H-A[i])%H;
        }
    }
    long int a=1;
    for (int i=0; i<N; i++) {
        a*=A[i];
        a=a%H;
    }
    if (a==0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
            
            
            
        