結果
問題 |
No.16 累乗の加算
|
ユーザー |
|
提出日時 | 2015-12-19 20:22:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 377 ms |
コンパイル使用メモリ | 57,784 KB |
実行使用メモリ | 10,012 KB |
最終ジャッジ日時 | 2024-09-17 10:45:22 |
合計ジャッジ時間 | 6,878 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 11 |
ソースコード
#include <iostream> #include <cmath> using namespace std; #define MOD 1000003 int main(){ cin.tie(0); ios::sync_with_stdio(false); int x, n, a, x_t, total=0; cin >> x >> n; for(int i=0; i<n; ++i){ x_t=x; cin >> a; if(a==0){ total+=1; continue; } for(int j=1; j<a; ++j){ x_t*=x; x_t%=MOD; } total+=x_t; } cout << total << "\n"; return 0; }