結果

問題 No.2394 部分和乗総和
ユーザー hato336hato336
提出日時 2023-07-28 22:24:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 335 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 107,264 KB
最終ジャッジ日時 2024-04-16 06:22:56
合計ジャッジ時間 5,532 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
85,888 KB
testcase_01 AC 143 ms
86,016 KB
testcase_02 AC 146 ms
86,016 KB
testcase_03 AC 142 ms
85,760 KB
testcase_04 AC 142 ms
86,016 KB
testcase_05 AC 143 ms
85,760 KB
testcase_06 AC 143 ms
85,632 KB
testcase_07 AC 146 ms
85,888 KB
testcase_08 AC 144 ms
85,888 KB
testcase_09 AC 143 ms
85,760 KB
testcase_10 AC 143 ms
85,632 KB
testcase_11 AC 141 ms
85,888 KB
testcase_12 AC 143 ms
85,632 KB
testcase_13 AC 174 ms
90,112 KB
testcase_14 AC 220 ms
93,952 KB
testcase_15 AC 225 ms
94,720 KB
testcase_16 AC 252 ms
97,664 KB
testcase_17 AC 335 ms
106,880 KB
testcase_18 AC 334 ms
106,880 KB
testcase_19 AC 333 ms
106,624 KB
testcase_20 AC 334 ms
107,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
n,m,b = map(int,input().split())
alist = list(map(int,input().split()))
ans = 0
ans += 1
for i in alist:
    ans += ans * pow(m,i,b)
    ans %= b
print(ans)
0