結果
| 問題 | No.16 累乗の加算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-01 22:23:35 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 501 ms |
| コンパイル使用メモリ | 72,024 KB |
| 実行使用メモリ | 79,996 KB |
| 最終ジャッジ日時 | 2026-04-02 17:54:11 |
| 合計ジャッジ時間 | 7,329 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 11 |
ソースコード
#include <iostream>
using namespace std;
#define SIZE 100
int main (void)
{
int i, x, N = 0;
int a[SIZE];
unsigned long ans = 0;
cin >> x >> N;
for ( i = 0; i < N; i++ ) { cin >> a[i]; }
for ( i = 0; i < N; i++ )
{
int k;
unsigned long tmp = 1;
for ( k = 0; k < a[i]; k++ )
{
tmp *= x;
tmp %= 1000003;
}
ans += tmp;
}
cout << ans << endl;
}