結果
| 問題 | No.16 累乗の加算 |
| コンテスト | |
| ユーザー |
alexara1123
|
| 提出日時 | 2019-09-23 00:57:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 625 bytes |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 89,088 KB |
| 最終ジャッジ日時 | 2024-09-19 03:50:30 |
| 合計ジャッジ時間 | 2,802 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 14 |
ソースコード
from fractions import gcd
from heapq import*
import math
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
def main():
x, n = map(int, input().split())
a = list(map(int, input().split()))
def modpow(a, n, mod):
res = 1
while n > 0:
if n & 1:
res = res * a % mod
a = a * a % mod
n >>= 1
return res
ans = 0
for i in range(n):
#print(modpow(x, a[i], 1000003))
ans += modpow(x, a[i], 1000003)
print(ans % 1000003)
if __name__ == '__main__':
main()
alexara1123