結果

問題 No.1181 Product Sum for All Subsets
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-08-21 22:09:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,584 KB
実行使用メモリ 53,500 KB
最終ジャッジ日時 2024-04-23 05:56:16
合計ジャッジ時間 1,885 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,092 KB
testcase_01 AC 37 ms
52,116 KB
testcase_02 AC 35 ms
52,252 KB
testcase_03 AC 35 ms
51,756 KB
testcase_04 AC 33 ms
52,620 KB
testcase_05 AC 31 ms
52,796 KB
testcase_06 AC 32 ms
51,940 KB
testcase_07 AC 32 ms
51,992 KB
testcase_08 AC 32 ms
52,484 KB
testcase_09 AC 32 ms
52,808 KB
testcase_10 AC 32 ms
52,756 KB
testcase_11 AC 32 ms
52,276 KB
testcase_12 AC 32 ms
53,056 KB
testcase_13 AC 32 ms
52,896 KB
testcase_14 AC 33 ms
52,336 KB
testcase_15 AC 34 ms
52,204 KB
testcase_16 AC 33 ms
51,888 KB
testcase_17 AC 33 ms
53,500 KB
testcase_18 AC 32 ms
52,664 KB
testcase_19 AC 33 ms
53,368 KB
testcase_20 AC 32 ms
52,116 KB
testcase_21 AC 33 ms
52,556 KB
testcase_22 AC 34 ms
53,196 KB
testcase_23 AC 34 ms
52,348 KB
testcase_24 AC 33 ms
52,184 KB
testcase_25 AC 32 ms
52,280 KB
testcase_26 AC 33 ms
52,320 KB
testcase_27 AC 32 ms
51,968 KB
testcase_28 AC 32 ms
52,500 KB
testcase_29 AC 32 ms
52,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/1181

それぞれの数字において、選ぶ1~K、選ばない*1があるので

"""

N,K = map(int,input().split())

s = (1+K) * K // 2 + 1*K
t = (1+K) * K // 2
mod = 10**9+7
print ((pow(s,N,mod)-pow(t,N,mod)) % mod)
0