結果
問題 |
No.16 累乗の加算
|
ユーザー |
![]() |
提出日時 | 2017-01-30 18:50:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 1,891 ms |
コンパイル使用メモリ | 165,800 KB |
実行使用メモリ | 784,896 KB |
最終ジャッジ日時 | 2024-12-23 23:59:36 |
合計ジャッジ時間 | 20,611 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | MLE * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int x,N; cin>>x>>N; int a[N]; long long int dp[100000004],sum=0; dp[0]=1; for(int i=1;i<=100000000;i++){ dp[i]=(dp[i-1]*x)%1000003; } for(int i=0;i<N;i++){ cin>>a[i]; } for(int i=0;i<N;i++){ sum+=dp[a[i]]; sum%=1000003; } cout<<sum<<endl; return 0; }