結果

問題 No.16 累乗の加算
ユーザー foumi
提出日時 2019-05-02 11:06:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,888 KB
最終ジャッジ日時 2024-12-31 13:14:44
合計ジャッジ時間 67,055 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 1 TLE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

x, n = map(int,input().split())
power_list = list(map(int, input().split()))
power_list.append(0)
power_list.sort()
power = x
ans = 0
for i in range(1, n+1):
    step = power_list[i] - power_list[i - 1]
    if step == 0:
        ans += 1
    else:
        power = power**step
        ans += power
print(ans % 1000003)
0