結果
問題 |
No.2394 部分和乗総和
|
ユーザー |
|
提出日時 | 2023-07-26 12:22:51 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 103 ms / 2,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 927 ms |
コンパイル使用メモリ | 82,444 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 22:43:46 |
合計ジャッジ時間 | 2,447 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <iostream> #include <atcoder/modint> using namespace std; using mint = atcoder::modint; int main() { long long n, m, b, a; cin >> n >> m >> b; mint::set_mod(b); mint ans = 1; while (cin >> a) { ans *= 1 + mint(m).pow(a); } cout << ans.val() << '\n'; }