結果

問題 No.1419 Power Moves
ユーザー tktk_snsntktk_snsn
提出日時 2023-02-19 09:09:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 13,384 KB
最終ジャッジ日時 2023-09-27 17:05:31
合計ジャッジ時間 6,391 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,752 KB
testcase_01 AC 15 ms
7,840 KB
testcase_02 AC 16 ms
7,732 KB
testcase_03 AC 15 ms
7,972 KB
testcase_04 AC 16 ms
7,988 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 16 ms
7,912 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 87 ms
10,172 KB
testcase_10 AC 17 ms
8,228 KB
testcase_11 AC 27 ms
8,516 KB
testcase_12 AC 106 ms
12,832 KB
testcase_13 AC 91 ms
10,856 KB
testcase_14 AC 89 ms
9,360 KB
testcase_15 AC 89 ms
9,300 KB
testcase_16 AC 91 ms
9,188 KB
testcase_17 AC 16 ms
7,812 KB
testcase_18 AC 16 ms
7,764 KB
testcase_19 AC 15 ms
7,848 KB
testcase_20 AC 131 ms
11,152 KB
testcase_21 AC 132 ms
11,948 KB
testcase_22 AC 126 ms
11,100 KB
testcase_23 AC 121 ms
11,156 KB
testcase_24 AC 121 ms
11,196 KB
testcase_25 AC 128 ms
11,144 KB
testcase_26 AC 120 ms
13,384 KB
testcase_27 AC 106 ms
11,196 KB
testcase_28 AC 114 ms
11,152 KB
testcase_29 AC 111 ms
11,152 KB
testcase_30 AC 111 ms
11,916 KB
testcase_31 AC 121 ms
13,256 KB
testcase_32 AC 125 ms
11,096 KB
testcase_33 AC 117 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10 ** 9 + 7


def main():
    N, K = map(int, input().split())
    two = pow(2, K, mod)
    div2 = pow(two, mod-2, mod)

    m = pow(2, K - 1, N)
    d = (pow(2, K-1, mod) - m) * pow(N, mod-2, mod) % mod

    answer = [0] * N

    for i in range(N):
        j = (2 * i + 1) % N
        answer[j] += d
        answer[-j] += d

    for i in range(m):
        j = (2 * i + 1) % N
        answer[j] += 1
        answer[-j] += 1

    for i in range(N):
        print(answer[i] * div2 % mod)


main()
0