結果

問題 No.16 累乗の加算
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-06-08 09:08:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 73,240 KB
最終ジャッジ日時 2023-08-29 00:06:28
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
72,892 KB
testcase_01 AC 97 ms
73,008 KB
testcase_02 AC 96 ms
73,240 KB
testcase_03 AC 102 ms
73,068 KB
testcase_04 AC 99 ms
73,028 KB
testcase_05 AC 100 ms
73,180 KB
testcase_06 AC 99 ms
73,140 KB
testcase_07 AC 98 ms
73,208 KB
testcase_08 AC 99 ms
72,836 KB
testcase_09 AC 103 ms
72,984 KB
testcase_10 AC 101 ms
72,952 KB
testcase_11 AC 99 ms
73,064 KB
testcase_12 AC 99 ms
72,916 KB
testcase_13 AC 98 ms
72,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

x,N = map(int,input().split())
A = list(map(int,input().split()))
mod = 10**6 + 3

ans = 0
for a in A:
    ans += pow(x,a,mod)
    ans %= mod
print(ans)
0