結果

問題 No.16 累乗の加算
ユーザー ゆるくゆるく
提出日時 2015-02-23 01:50:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 10,420 KB
最終ジャッジ日時 2023-09-08 11:35:00
合計ジャッジ時間 1,743 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,160 KB
testcase_01 AC 32 ms
10,144 KB
testcase_02 AC 33 ms
10,348 KB
testcase_03 AC 32 ms
10,360 KB
testcase_04 AC 32 ms
10,188 KB
testcase_05 AC 32 ms
10,180 KB
testcase_06 AC 32 ms
10,140 KB
testcase_07 AC 32 ms
10,184 KB
testcase_08 AC 32 ms
10,164 KB
testcase_09 AC 32 ms
10,420 KB
testcase_10 AC 32 ms
10,196 KB
testcase_11 AC 32 ms
10,404 KB
testcase_12 AC 32 ms
10,320 KB
testcase_13 AC 31 ms
10,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

x, n= map(int, input().split())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
  ans += pow(x, a[i], 1000003)

print(ans % 1000003)
0