結果

問題 No.1013 〇マス進む
ユーザー merom686merom686
提出日時 2020-03-20 22:34:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 758 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 78,168 KB
実行使用メモリ 27,348 KB
最終ジャッジ日時 2023-08-21 17:20:55
合計ジャッジ時間 6,957 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,504 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 36 ms
14,864 KB
testcase_15 AC 60 ms
21,784 KB
testcase_16 AC 53 ms
20,164 KB
testcase_17 AC 33 ms
13,360 KB
testcase_18 AC 41 ms
15,480 KB
testcase_19 AC 24 ms
10,400 KB
testcase_20 AC 72 ms
25,976 KB
testcase_21 AC 29 ms
12,340 KB
testcase_22 AC 41 ms
15,944 KB
testcase_23 AC 13 ms
7,232 KB
testcase_24 AC 72 ms
26,728 KB
testcase_25 AC 71 ms
26,300 KB
testcase_26 AC 15 ms
7,364 KB
testcase_27 AC 27 ms
11,948 KB
testcase_28 AC 14 ms
7,272 KB
testcase_29 AC 68 ms
25,684 KB
testcase_30 AC 27 ms
10,912 KB
testcase_31 AC 47 ms
18,040 KB
testcase_32 AC 33 ms
14,152 KB
testcase_33 AC 41 ms
14,156 KB
testcase_34 AC 67 ms
20,752 KB
testcase_35 AC 75 ms
19,696 KB
testcase_36 AC 6 ms
4,376 KB
testcase_37 AC 6 ms
4,376 KB
testcase_38 AC 73 ms
22,512 KB
testcase_39 AC 28 ms
9,304 KB
testcase_40 AC 85 ms
20,716 KB
testcase_41 AC 20 ms
7,556 KB
testcase_42 AC 46 ms
13,692 KB
testcase_43 AC 28 ms
9,860 KB
testcase_44 AC 44 ms
14,392 KB
testcase_45 AC 42 ms
13,024 KB
testcase_46 AC 22 ms
7,752 KB
testcase_47 AC 41 ms
13,576 KB
testcase_48 AC 46 ms
15,412 KB
testcase_49 AC 84 ms
20,688 KB
testcase_50 AC 60 ms
18,052 KB
testcase_51 AC 55 ms
16,436 KB
testcase_52 AC 13 ms
5,680 KB
testcase_53 AC 17 ms
7,020 KB
testcase_54 AC 64 ms
19,640 KB
testcase_55 AC 24 ms
8,056 KB
testcase_56 AC 95 ms
24,136 KB
testcase_57 AC 70 ms
17,740 KB
testcase_58 AC 115 ms
27,328 KB
testcase_59 AC 108 ms
27,288 KB
testcase_60 AC 100 ms
27,288 KB
testcase_61 AC 72 ms
27,348 KB
testcase_62 AC 68 ms
27,292 KB
testcase_63 AC 2 ms
4,380 KB
testcase_64 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    int n, k;
    cin >> n >> k;

    vector<vector<ll>> p(30, vector<ll>(n));
    for (int i = 0; i < n; i++) {
        cin >> p[0][i];
    }

    for (int j = 0; j < 30 - 1; j++) {
        for (int i = 0; i < n; i++) {
            ll t = p[j][i];
            p[j + 1][i] = t + p[j][(i + t) % n];
        }
    }

    for (int i = 0; i < n; i++) {
        ll s = i;
        for (int j = 30 - 1; j >= 0; j--) {
            if (k & 1 << j) s += p[j][s % n];
        }
        cout << s + 1 << '\n';
    }

    return 0;
}
0