結果

問題 No.16 累乗の加算
ユーザー popketlepopketle
提出日時 2020-02-10 11:45:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 277 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 30,764 KB
最終ジャッジ日時 2024-04-08 12:54:43
合計ジャッジ時間 6,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
9,984 KB
testcase_01 AC 35 ms
9,984 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0