結果
問題 |
No.16 累乗の加算
|
ユーザー |
![]() |
提出日時 | 2020-02-10 11:45:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 277 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 32,420 KB |
最終ジャッジ日時 | 2024-10-01 06:19:59 |
合計ジャッジ時間 | 6,683 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 11 |
ソースコード
x,n=map(int,input().split()) A=list(map(int,input().split())) def pow(x,n): ans=1 while(n>0): if bin(n&1)==bin(1): ans=ans*x x=x*x n=n>>1 return ans mod=1000003 ans=0 for i in range(n): ans+=(pow(x,A[i]))%mod print(ans%mod)