結果

問題 No.2394 部分和乗総和
ユーザー hitonanode
提出日時 2023-08-05 11:41:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 2,568 ms
コンパイル使用メモリ 81,952 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-15 08:46:42
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

#include <atcoder/modint>
using mint = atcoder::modint;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

    int N, B;
    long long M;
    cin >> N >> M >> B;
    mint::set_mod(B);

    mint m = M, ret = 1;

    while (N--) {
        int a;
        cin >> a;
        ret *= 1 + m.pow(a);
    }
    cout << ret.val() << '\n';
}
0