結果

問題 No.1250 汝は倍数なりや?
ユーザー ooooobaoooooba
提出日時 2021-06-28 11:22:20
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 988 ms
コンパイル使用メモリ 113,344 KB
最終ジャッジ日時 2025-01-22 14:47:35
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 24 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t n, h;
    cin >> n >> h;
    int64_t prod = 1;
    for (auto i = 0; i < n; ++i) {
        int32_t a;
        cin >> a;
        a = abs(a);
        prod = prod * a % h;
    }
    cout << (h == 1 ? "YES" : "NO") << endl;
    return 0;
}
0