結果

問題 No.1013 〇マス進む
ユーザー bond_cmprogbond_cmprog
提出日時 2020-03-20 23:30:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 1,326 bytes
コンパイル時間 1,733 ms
コンパイル使用メモリ 169,788 KB
実行使用メモリ 30,260 KB
最終ジャッジ日時 2023-08-22 02:00:55
合計ジャッジ時間 11,703 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 9 ms
4,380 KB
testcase_14 AC 100 ms
16,004 KB
testcase_15 AC 173 ms
24,320 KB
testcase_16 AC 152 ms
22,256 KB
testcase_17 AC 88 ms
14,316 KB
testcase_18 AC 114 ms
16,700 KB
testcase_19 AC 66 ms
11,220 KB
testcase_20 AC 210 ms
28,660 KB
testcase_21 AC 80 ms
13,332 KB
testcase_22 AC 115 ms
17,416 KB
testcase_23 AC 36 ms
7,816 KB
testcase_24 AC 213 ms
29,432 KB
testcase_25 AC 206 ms
28,884 KB
testcase_26 AC 38 ms
7,784 KB
testcase_27 AC 73 ms
13,016 KB
testcase_28 AC 37 ms
7,772 KB
testcase_29 AC 202 ms
28,052 KB
testcase_30 AC 72 ms
11,736 KB
testcase_31 AC 132 ms
19,672 KB
testcase_32 AC 92 ms
15,464 KB
testcase_33 AC 103 ms
15,456 KB
testcase_34 AC 177 ms
22,832 KB
testcase_35 AC 177 ms
21,780 KB
testcase_36 AC 12 ms
4,376 KB
testcase_37 AC 11 ms
4,380 KB
testcase_38 AC 190 ms
24,964 KB
testcase_39 AC 63 ms
10,364 KB
testcase_40 AC 199 ms
22,588 KB
testcase_41 AC 43 ms
7,960 KB
testcase_42 AC 106 ms
15,000 KB
testcase_43 AC 66 ms
10,800 KB
testcase_44 AC 108 ms
15,744 KB
testcase_45 AC 95 ms
14,136 KB
testcase_46 AC 47 ms
8,244 KB
testcase_47 AC 100 ms
14,896 KB
testcase_48 AC 120 ms
17,116 KB
testcase_49 AC 198 ms
22,600 KB
testcase_50 AC 148 ms
19,640 KB
testcase_51 AC 129 ms
17,840 KB
testcase_52 AC 27 ms
5,964 KB
testcase_53 AC 37 ms
7,284 KB
testcase_54 AC 153 ms
21,468 KB
testcase_55 AC 51 ms
8,516 KB
testcase_56 AC 224 ms
26,552 KB
testcase_57 AC 160 ms
19,096 KB
testcase_58 AC 274 ms
29,948 KB
testcase_59 AC 269 ms
29,896 KB
testcase_60 AC 233 ms
30,260 KB
testcase_61 AC 206 ms
30,232 KB
testcase_62 AC 199 ms
30,240 KB
testcase_63 AC 2 ms
4,380 KB
testcase_64 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    vector<int> P(N);
    REP(i,N){
        cin >> P[i];
    }
    vector<vector<ll>> to(33, vector<ll>(N));
    REP(i,N) to[0][i] = P[i];
    REP(i,32) REP(j,N) to[i+1][j] = to[i][j] + to[i][(j+to[i][j])%N];

    REP(i,N){
        ll cur = i;
        REP(j,32){
            if((K >> j) & 1){
                cur += to[j][cur%N];
                //cout << i << " " << to[j][cur%N] << endl;
            }
        }
        cout << cur + 1 << endl;
    }
}
0