結果

問題 No.444 旨味の相乗効果
ユーザー ああいいああいい
提出日時 2022-04-19 19:54:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 77,688 KB
最終ジャッジ日時 2023-08-30 18:08:28
合計ジャッジ時間 4,681 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,432 KB
testcase_01 AC 92 ms
71,820 KB
testcase_02 WA -
testcase_03 AC 89 ms
71,872 KB
testcase_04 WA -
testcase_05 AC 90 ms
71,676 KB
testcase_06 AC 89 ms
71,608 KB
testcase_07 AC 104 ms
77,600 KB
testcase_08 AC 90 ms
71,700 KB
testcase_09 AC 90 ms
71,540 KB
testcase_10 AC 89 ms
71,888 KB
testcase_11 AC 90 ms
71,752 KB
testcase_12 AC 108 ms
77,680 KB
testcase_13 AC 104 ms
77,460 KB
testcase_14 AC 90 ms
71,736 KB
testcase_15 AC 90 ms
71,528 KB
testcase_16 WA -
testcase_17 AC 90 ms
71,748 KB
testcase_18 AC 89 ms
71,688 KB
testcase_19 AC 106 ms
77,640 KB
testcase_20 AC 111 ms
77,668 KB
testcase_21 AC 89 ms
71,840 KB
testcase_22 AC 90 ms
71,880 KB
testcase_23 AC 88 ms
71,640 KB
testcase_24 AC 108 ms
77,688 KB
testcase_25 AC 89 ms
71,432 KB
testcase_26 AC 89 ms
71,748 KB
testcase_27 AC 90 ms
71,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0