結果

問題 No.1419 Power Moves
ユーザー pluto77pluto77
提出日時 2021-03-19 11:46:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 82,432 KB
最終ジャッジ日時 2024-04-29 00:46:15
合計ジャッジ時間 3,975 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,224 KB
testcase_01 AC 39 ms
52,224 KB
testcase_02 AC 40 ms
51,840 KB
testcase_03 AC 40 ms
51,712 KB
testcase_04 AC 40 ms
51,712 KB
testcase_05 AC 38 ms
51,584 KB
testcase_06 AC 39 ms
51,840 KB
testcase_07 AC 38 ms
52,352 KB
testcase_08 AC 39 ms
52,224 KB
testcase_09 AC 71 ms
80,936 KB
testcase_10 AC 52 ms
62,208 KB
testcase_11 AC 54 ms
65,664 KB
testcase_12 AC 70 ms
79,872 KB
testcase_13 AC 68 ms
79,744 KB
testcase_14 AC 68 ms
80,508 KB
testcase_15 AC 68 ms
80,956 KB
testcase_16 AC 69 ms
80,560 KB
testcase_17 AC 38 ms
51,968 KB
testcase_18 AC 38 ms
51,840 KB
testcase_19 AC 38 ms
51,840 KB
testcase_20 AC 72 ms
82,176 KB
testcase_21 AC 72 ms
80,640 KB
testcase_22 AC 73 ms
82,176 KB
testcase_23 AC 74 ms
82,176 KB
testcase_24 AC 74 ms
82,432 KB
testcase_25 AC 74 ms
82,048 KB
testcase_26 AC 74 ms
81,320 KB
testcase_27 AC 73 ms
82,304 KB
testcase_28 AC 73 ms
82,048 KB
testcase_29 AC 74 ms
82,148 KB
testcase_30 AC 76 ms
81,920 KB
testcase_31 AC 73 ms
80,824 KB
testcase_32 AC 73 ms
81,920 KB
testcase_33 AC 72 ms
81,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1419
MOD=10**9+7
n,k=map(int,input().split())
s=(-(pow(2,k,n)-1))%n
x=pow(2,k,MOD*n)%(MOD*n)
q=x//n
r=x%n
d=[q]*n
for i in range(r):
 d[i]+=1
d2=[0]*n
for i in range(n):
 d2[2*i%n]+=d[i]
res=[0]*n
t=pow(pow(2,k,MOD),MOD-2,MOD)
for i in range(n):
 res[(s+i)%n]+=d2[i]*t
 res[(s+i)%n]%=MOD
print(*res,sep='\n')
0