結果

問題 No.1419 Power Moves
ユーザー MisterMister
提出日時 2021-03-05 22:47:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 680 bytes
コンパイル時間 835 ms
コンパイル使用メモリ 77,872 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-07-29 03:06:49
合計ジャッジ時間 4,525 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 64 ms
4,380 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 11 ms
4,376 KB
testcase_12 AC 66 ms
4,380 KB
testcase_13 AC 57 ms
4,380 KB
testcase_14 AC 22 ms
4,380 KB
testcase_15 AC 22 ms
4,380 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 80 ms
4,376 KB
testcase_21 AC 81 ms
4,376 KB
testcase_22 AC 80 ms
4,380 KB
testcase_23 AC 79 ms
4,376 KB
testcase_24 AC 79 ms
4,376 KB
testcase_25 AC 79 ms
4,380 KB
testcase_26 AC 80 ms
4,380 KB
testcase_27 AC 80 ms
4,376 KB
testcase_28 AC 80 ms
4,380 KB
testcase_29 AC 80 ms
4,380 KB
testcase_30 AC 80 ms
4,380 KB
testcase_31 AC 79 ms
4,376 KB
testcase_32 AC 80 ms
4,376 KB
testcase_33 AC 78 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 1 "main.cpp"
#include <atcoder/modint>
#include <iostream>
#include <vector>

using namespace std;
using mint0 = atcoder::modint1000000007;
using mint = atcoder::modint;

void solve() {
    int n, k;
    cin >> n >> k;
    mint::set_mod(n);

    int m = min(n, 1 << min(k, 30));

    int s = (1 - mint(2).pow(k)).val();

    vector<mint0> ans(n, 0);
    for (int d = 0; d < m; ++d) {
        int diff = (d - mint(2).pow(k)).val();
        ans[(s + d * 2) % n] += (mint0(2).pow(k) - d + diff) / n;
    }

    for (auto x : ans) cout << (x / mint0(2).pow(k)).val() << "\n";
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    solve();

    return 0;
}
0