結果
| 問題 | No.16 累乗の加算 |
| コンテスト | |
| ユーザー |
kutsutama
|
| 提出日時 | 2018-03-11 01:22:08 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 352 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 1,308,884 KB |
| 最終ジャッジ日時 | 2026-05-02 09:03:03 |
| 合計ジャッジ時間 | 9,509 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | MLE * 4 -- * 10 |
ソースコード
x, n = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
mod = 1000003
xx = [0] * 100000001
xx[0] = 1
for e in range(1, 1000000 + 1):
xx[e] = xx[e - 1] * x % mod
res = 0
for ai in a:
if xx[ai] == 0:
d = ai // 1000000 * 1000000
for e in range(1, ai // 1000000 + 1):
xx[(e + 1) * 1000000] = xx[e * 1000000] * xx[1000000] % mod
for e in range(1, ai % 1000000 + 1):
xx[d + e] = xx[d + e - 1] * x % mod
res = (res + xx[ai]) % mod
print(res)
kutsutama