結果

問題 No.1419 Power Moves
ユーザー 👑 potato167potato167
提出日時 2022-02-17 01:41:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 77,600 KB
最終ジャッジ日時 2023-09-11 17:21:29
合計ジャッジ時間 5,762 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,024 KB
testcase_01 AC 74 ms
71,036 KB
testcase_02 AC 70 ms
71,248 KB
testcase_03 AC 72 ms
71,064 KB
testcase_04 AC 70 ms
71,192 KB
testcase_05 WA -
testcase_06 AC 70 ms
71,116 KB
testcase_07 AC 71 ms
71,280 KB
testcase_08 AC 72 ms
71,192 KB
testcase_09 AC 100 ms
77,004 KB
testcase_10 AC 85 ms
76,584 KB
testcase_11 AC 94 ms
76,548 KB
testcase_12 WA -
testcase_13 AC 113 ms
77,080 KB
testcase_14 AC 92 ms
76,876 KB
testcase_15 AC 93 ms
77,080 KB
testcase_16 AC 95 ms
76,744 KB
testcase_17 AC 69 ms
71,340 KB
testcase_18 AC 69 ms
71,052 KB
testcase_19 AC 70 ms
71,200 KB
testcase_20 AC 99 ms
76,964 KB
testcase_21 WA -
testcase_22 AC 102 ms
77,220 KB
testcase_23 AC 103 ms
77,000 KB
testcase_24 AC 102 ms
77,096 KB
testcase_25 AC 103 ms
77,196 KB
testcase_26 AC 115 ms
77,328 KB
testcase_27 AC 102 ms
77,148 KB
testcase_28 AC 104 ms
76,904 KB
testcase_29 AC 104 ms
77,532 KB
testcase_30 AC 115 ms
77,148 KB
testcase_31 AC 119 ms
77,320 KB
testcase_32 AC 103 ms
77,600 KB
testcase_33 AC 102 ms
76,996 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
		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