結果
問題 | No.1181 Product Sum for All Subsets |
ユーザー | roaris |
提出日時 | 2020-08-21 22:22:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 172 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 53,888 KB |
最終ジャッジ日時 | 2024-10-15 05:51:15 |
合計ジャッジ時間 | 2,351 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import sys input = sys.stdin.readline from collections import * N, K = map(int, input().split()) MOD = 10**9+7 print((pow(K*(K+3)//2, N, MOD)-pow(K*(K+1)//2, N, MOD))%MOD)