結果

問題 No.16 累乗の加算
ユーザー Nobita Gomu
提出日時 2017-09-23 00:35:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 344 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 28,884 KB
最終ジャッジ日時 2024-11-08 14:44:31
合計ジャッジ時間 6,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache

@lru_cache(maxsize=None)
def f(x, n):
    return x ** n

def g():
    x, _ = map(int, input().split())
    l = sorted(map(int, input().split()))
    
    n = f(x, l[0])
    yield n
    
    for i in map(lambda it: it[1]-it[0], zip(l[:-1], l[1:])):
        n *= f(x, i)
        yield n

print(sum(g()) % 1000003)
0