結果

問題 No.1181 Product Sum for All Subsets
ユーザー chineristACchineristAC
提出日時 2020-08-21 21:29:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 146 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 54,004 KB
最終ジャッジ日時 2024-04-23 05:27:59
合計ジャッジ時間 1,918 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,476 KB
testcase_01 AC 33 ms
52,868 KB
testcase_02 AC 33 ms
52,304 KB
testcase_03 AC 33 ms
53,312 KB
testcase_04 AC 34 ms
52,344 KB
testcase_05 AC 37 ms
53,020 KB
testcase_06 AC 35 ms
53,748 KB
testcase_07 AC 32 ms
53,152 KB
testcase_08 AC 32 ms
52,204 KB
testcase_09 AC 31 ms
52,076 KB
testcase_10 AC 31 ms
53,224 KB
testcase_11 AC 33 ms
52,592 KB
testcase_12 AC 33 ms
53,104 KB
testcase_13 AC 32 ms
52,036 KB
testcase_14 AC 33 ms
52,688 KB
testcase_15 AC 32 ms
51,944 KB
testcase_16 AC 32 ms
52,616 KB
testcase_17 AC 34 ms
53,132 KB
testcase_18 AC 34 ms
53,320 KB
testcase_19 AC 35 ms
52,688 KB
testcase_20 AC 33 ms
52,672 KB
testcase_21 AC 33 ms
52,480 KB
testcase_22 AC 32 ms
52,600 KB
testcase_23 AC 32 ms
52,144 KB
testcase_24 AC 32 ms
52,792 KB
testcase_25 AC 32 ms
54,004 KB
testcase_26 AC 33 ms
52,500 KB
testcase_27 AC 33 ms
52,564 KB
testcase_28 AC 32 ms
53,612 KB
testcase_29 AC 32 ms
52,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
mod=10**9+7
k1=K*(K+3)//2
k1%=mod
ans=pow(k1,N,mod)
k2=K*(K+1)//2
k2%=mod
minus=pow(k2,N,mod)
print((ans-minus)%mod)
0