結果

問題 No.16 累乗の加算
ユーザー tktk_snsn
提出日時 2020-12-26 23:37:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 165 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 53,480 KB
最終ジャッジ日時 2024-09-25 03:35:44
合計ジャッジ時間 1,401 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000003
x, N = map(int,input().split())
ans = 0

for a in map(int, input().split()):
    ans += pow(x, a, mod)
    if ans >= mod:
        ans -= mod
print(ans)
0