結果

問題 No.1013 〇マス進む
ユーザー bond_cmprogbond_cmprog
提出日時 2020-03-20 23:30:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,327 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 172,980 KB
実行使用メモリ 30,336 KB
最終ジャッジ日時 2024-05-09 07:47:45
合計ジャッジ時間 11,530 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 4 ms
5,376 KB
testcase_13 AC 10 ms
5,376 KB
testcase_14 AC 105 ms
16,128 KB
testcase_15 AC 178 ms
24,064 KB
testcase_16 AC 172 ms
22,272 KB
testcase_17 AC 90 ms
14,464 KB
testcase_18 AC 116 ms
16,896 KB
testcase_19 AC 68 ms
11,392 KB
testcase_20 AC 217 ms
28,800 KB
testcase_21 AC 83 ms
13,440 KB
testcase_22 AC 122 ms
17,408 KB
testcase_23 AC 37 ms
7,808 KB
testcase_24 AC 223 ms
29,568 KB
testcase_25 AC 235 ms
29,184 KB
testcase_26 AC 39 ms
7,936 KB
testcase_27 AC 78 ms
13,056 KB
testcase_28 AC 38 ms
7,936 KB
testcase_29 AC 213 ms
28,160 KB
testcase_30 AC 74 ms
11,776 KB
testcase_31 AC 134 ms
19,840 KB
testcase_32 AC 97 ms
15,488 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 AC 212 ms
30,208 KB
testcase_62 AC 203 ms
30,208 KB
testcase_63 AC 2 ms
5,376 KB
testcase_64 AC 2 ms
5,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){
        int 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