結果

問題 No.1419 Power Moves
ユーザー pluto77pluto77
提出日時 2021-03-19 11:40:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 315 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 20,044 KB
最終ジャッジ日時 2024-04-29 00:40:25
合計ジャッジ時間 7,494 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
16,128 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 29 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 29 ms
10,496 KB
testcase_05 AC 29 ms
10,624 KB
testcase_06 AC 29 ms
10,624 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 31 ms
10,624 KB
testcase_09 AC 1,984 ms
17,656 KB
testcase_10 AC 34 ms
10,880 KB
testcase_11 AC 100 ms
11,904 KB
testcase_12 AC 495 ms
20,044 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

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