結果

問題 No.1846 Good Binary Matrix
ユーザー ytftytft
提出日時 2022-02-21 01:22:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 861 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 77,220 KB
最終ジャッジ日時 2023-09-11 21:14:09
合計ジャッジ時間 13,001 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,204 KB
testcase_01 AC 73 ms
71,344 KB
testcase_02 AC 72 ms
71,352 KB
testcase_03 AC 71 ms
71,040 KB
testcase_04 AC 71 ms
71,464 KB
testcase_05 AC 73 ms
71,332 KB
testcase_06 AC 72 ms
70,992 KB
testcase_07 AC 73 ms
71,400 KB
testcase_08 AC 74 ms
71,448 KB
testcase_09 AC 73 ms
71,516 KB
testcase_10 AC 75 ms
71,032 KB
testcase_11 AC 74 ms
71,036 KB
testcase_12 AC 74 ms
71,036 KB
testcase_13 AC 73 ms
71,292 KB
testcase_14 AC 73 ms
71,228 KB
testcase_15 AC 73 ms
71,148 KB
testcase_16 AC 861 ms
76,984 KB
testcase_17 AC 829 ms
76,968 KB
testcase_18 AC 813 ms
77,020 KB
testcase_19 AC 781 ms
76,788 KB
testcase_20 AC 840 ms
76,956 KB
testcase_21 AC 428 ms
76,700 KB
testcase_22 AC 464 ms
76,956 KB
testcase_23 AC 74 ms
71,324 KB
testcase_24 AC 73 ms
71,324 KB
testcase_25 AC 631 ms
76,696 KB
testcase_26 AC 453 ms
77,220 KB
testcase_27 AC 110 ms
77,116 KB
testcase_28 AC 170 ms
77,056 KB
testcase_29 AC 329 ms
76,952 KB
testcase_30 AC 763 ms
77,160 KB
testcase_31 AC 623 ms
76,696 KB
testcase_32 AC 706 ms
76,988 KB
testcase_33 AC 798 ms
77,020 KB
testcase_34 AC 88 ms
76,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
def p(a,b):
	ans=1
	while(b):
		if(b%2):
			ans=(ans*a)%mod
		a=(a*a)%mod
		b//=2
	return ans

H,W=map(int,input().split())
C=1
ans=0
for i in range(H+1):
	ans=(ans+C*(-1)**i*p(p(2,H-i)-1,W))%mod
	C=(C*(H-i)*p(i+1,mod-2))%mod
print(ans)
0