結果
問題 | No.16 累乗の加算 |
ユーザー | vwxyz |
提出日時 | 2021-06-19 16:25:28 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 268 ms / 5,000 ms |
コード長 | 758 bytes |
コンパイル時間 | 440 ms |
コンパイル使用メモリ | 87,240 KB |
実行使用メモリ | 91,896 KB |
最終ジャッジ日時 | 2023-09-05 00:58:41 |
合計ジャッジ時間 | 5,054 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 268 ms
91,748 KB |
testcase_01 | AC | 267 ms
91,888 KB |
testcase_02 | AC | 263 ms
91,496 KB |
testcase_03 | AC | 262 ms
91,404 KB |
testcase_04 | AC | 266 ms
91,764 KB |
testcase_05 | AC | 266 ms
91,596 KB |
testcase_06 | AC | 266 ms
91,776 KB |
testcase_07 | AC | 265 ms
91,684 KB |
testcase_08 | AC | 260 ms
91,604 KB |
testcase_09 | AC | 266 ms
91,620 KB |
testcase_10 | AC | 268 ms
91,896 KB |
testcase_11 | AC | 265 ms
91,500 KB |
testcase_12 | AC | 258 ms
91,408 KB |
testcase_13 | AC | 256 ms
91,528 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys from collections import Counter, deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines x,N,*A=map(int,read().split()) ans=0 mod=10**6+3 for a in A: ans+=pow(x,a,mod) ans%=mod print(ans)