結果
問題 | No.16 累乗の加算 |
ユーザー |
|
提出日時 | 2024-03-29 23:45:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 494 bytes |
コンパイル時間 | 1,601 ms |
コンパイル使用メモリ | 193,504 KB |
最終ジャッジ日時 | 2025-02-20 15:40:39 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;using lint = int64_t;int main() {int x, n;cin >> x >> n;vector<lint> a(n);for (lint i = 0; i != a.size(); i++) {cin >> a[i];}lint ans = 0;lint mod = 1000003;for (lint i = 0; i != a.size(); i++) {lint tmp = 1;for (lint j = 0; j != a[i]; j++) {tmp = (tmp * x) % mod;}ans = (ans + tmp) % mod;}cout << ans << endl;// system("pause");}