結果

問題 No.16 累乗の加算
ユーザー Konton7Konton7
提出日時 2019-04-30 19:30:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 391 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 816,920 KB
最終ジャッジ日時 2023-08-29 22:15:54
合計ジャッジ時間 2,136 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,852 KB
testcase_01 AC 15 ms
7,692 KB
testcase_02 MLE -
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 = [ int(v) for v in input().split(" ") ]
nlist = [ int(v) for v in input().split(" ") ]
maxn = max(nlist)
bignum = 1000003

def powermod(x,n):
    powerlist = [1] * (n+1)
    for i in range(n):
        powerlist[i+1] = x * powerlist[i]
        powerlist[i+1] %= bignum
    return(powerlist)


plist = powermod(x,maxn)
anslist = [ plist[nlist[i]] for i in range(n) ]

print(sum(anslist))
0