結果
| 問題 | 
                            No.444 旨味の相乗効果
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-04-19 19:54:22 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 434 bytes | 
| コンパイル時間 | 339 ms | 
| コンパイル使用メモリ | 82,536 KB | 
| 実行使用メモリ | 68,644 KB | 
| 最終ジャッジ日時 | 2025-01-02 12:05:37 | 
| 合計ジャッジ時間 | 3,134 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 WA * 2 | 
| other | AC * 22 WA * 1 | 
ソースコード
n,c = map(int,input().split())
a = list(map(int,input().split()))
from collections import defaultdict
d = defaultdict(int)
for i in a:
    d[i] += 1
P = 10 ** 9 + 7
ans = 0
for i in d:
    inv = pow(i,P-2,P)
    u = 1
    for j in d:
        if j == i:continue
        t = (1 - j * inv) % P
        t = pow(t,P-2,P)
        t = pow(t,d[j],P)
        u = u * t % P
    v = pow(i,c,P)
    ans += (u - d[i]) * v
    ans %= P
print(ans)