結果
| 問題 | 
                            No.16 累乗の加算
                             | 
                    
| コンテスト | |
| ユーザー | 
                             threepipes_s
                         | 
                    
| 提出日時 | 2015-12-30 01:16:49 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 32 ms / 5,000 ms | 
| コード長 | 276 bytes | 
| コンパイル時間 | 105 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-06-26 05:06:07 | 
| 合計ジャッジ時間 | 1,187 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
def modpow(x, n, m):
    res = 1
    while(n>0):
        if((n&1)==1): res = x*res%m
        x = x*x%m
        n >>= 1
    return res
x, n = map(int, input().split())
m = 1000003
res = 0
for a in list(map(int, input().split())):
    res = (res+modpow(x, a, m))%m
print(res)
            
            
            
        
            
threepipes_s