結果

問題 No.1419 Power Moves
ユーザー 👑 potato167potato167
提出日時 2022-02-17 01:42:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 77,592 KB
最終ジャッジ日時 2023-09-11 17:21:35
合計ジャッジ時間 5,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,244 KB
testcase_01 AC 69 ms
71,152 KB
testcase_02 AC 70 ms
71,196 KB
testcase_03 AC 70 ms
71,100 KB
testcase_04 AC 69 ms
71,200 KB
testcase_05 AC 69 ms
70,884 KB
testcase_06 AC 71 ms
71,100 KB
testcase_07 AC 70 ms
71,052 KB
testcase_08 AC 69 ms
71,116 KB
testcase_09 AC 98 ms
77,156 KB
testcase_10 AC 86 ms
76,640 KB
testcase_11 AC 97 ms
76,440 KB
testcase_12 AC 112 ms
77,528 KB
testcase_13 AC 112 ms
76,896 KB
testcase_14 AC 94 ms
76,876 KB
testcase_15 AC 93 ms
77,120 KB
testcase_16 AC 93 ms
76,920 KB
testcase_17 AC 68 ms
71,036 KB
testcase_18 AC 70 ms
71,236 KB
testcase_19 AC 69 ms
71,036 KB
testcase_20 AC 99 ms
76,996 KB
testcase_21 AC 114 ms
77,388 KB
testcase_22 AC 101 ms
77,512 KB
testcase_23 AC 100 ms
77,236 KB
testcase_24 AC 101 ms
76,820 KB
testcase_25 AC 100 ms
77,224 KB
testcase_26 AC 116 ms
77,304 KB
testcase_27 AC 102 ms
76,772 KB
testcase_28 AC 100 ms
77,028 KB
testcase_29 AC 106 ms
77,592 KB
testcase_30 AC 113 ms
77,280 KB
testcase_31 AC 115 ms
77,324 KB
testcase_32 AC 104 ms
77,360 KB
testcase_33 AC 103 ms
77,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
MOD=10**9+7
R=pow(2,MOD-1-K,MOD)
M=N
if M%2==0:
	M//=2
A=pow(2,K-1,M)+M
A%=M
B=pow(2,K-1,MOD)-A
B*=pow(M,MOD-2,MOD)
B%=MOD
for i in range(N):
	if N%2==0 and i%2==0:
		print(0)
	else:
		D=i+1
		if i==0:
			D=N+1
		E=N-i+1
		if D%2==1:
			D+=N
		if E%2==1:
			E+=N
		D//=2
		E//=2
		#print(M,D,E)
		ans=B*2
		if A>=D:
			ans+=1
		if A>=E:
			ans+=1
		print((ans*R)%MOD)
0