結果

問題 No.1013 〇マス進む
ユーザー 👑 NachiaNachia
提出日時 2020-12-11 00:39:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 671 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 206,092 KB
実行使用メモリ 5,688 KB
最終ジャッジ日時 2023-10-20 01:09:30
合計ジャッジ時間 13,239 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 3 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 7 ms
4,348 KB
testcase_14 AC 76 ms
4,456 KB
testcase_15 AC 126 ms
5,184 KB
testcase_16 AC 115 ms
5,080 KB
testcase_17 AC 67 ms
4,368 KB
testcase_18 AC 84 ms
4,632 KB
testcase_19 AC 50 ms
4,348 KB
testcase_20 AC 153 ms
5,456 KB
testcase_21 AC 64 ms
4,348 KB
testcase_22 AC 87 ms
4,632 KB
testcase_23 AC 29 ms
4,348 KB
testcase_24 AC 159 ms
5,688 KB
testcase_25 AC 156 ms
5,688 KB
testcase_26 AC 29 ms
4,348 KB
testcase_27 AC 59 ms
4,348 KB
testcase_28 AC 29 ms
4,348 KB
testcase_29 AC 149 ms
5,424 KB
testcase_30 AC 53 ms
4,348 KB
testcase_31 AC 101 ms
4,672 KB
testcase_32 AC 74 ms
4,424 KB
testcase_33 AC 77 ms
4,424 KB
testcase_34 AC 123 ms
5,112 KB
testcase_35 AC 117 ms
5,048 KB
testcase_36 AC 10 ms
4,348 KB
testcase_37 AC 9 ms
4,348 KB
testcase_38 AC 136 ms
5,232 KB
testcase_39 AC 45 ms
4,348 KB
testcase_40 AC 125 ms
5,104 KB
testcase_41 AC 31 ms
4,348 KB
testcase_42 AC 75 ms
4,392 KB
testcase_43 AC 49 ms
4,348 KB
testcase_44 AC 79 ms
4,432 KB
testcase_45 AC 69 ms
4,368 KB
testcase_46 AC 34 ms
4,348 KB
testcase_47 AC 74 ms
4,392 KB
testcase_48 AC 88 ms
4,632 KB
testcase_49 AC 126 ms
5,104 KB
testcase_50 AC 107 ms
4,672 KB
testcase_51 AC 95 ms
4,632 KB
testcase_52 AC 20 ms
4,348 KB
testcase_53 AC 28 ms
4,348 KB
testcase_54 AC 117 ms
5,040 KB
testcase_55 AC 35 ms
4,348 KB
testcase_56 AC 148 ms
5,424 KB
testcase_57 AC 102 ms
4,632 KB
testcase_58 AC 176 ms
5,688 KB
testcase_59 AC 172 ms
5,688 KB
testcase_60 AC 170 ms
5,688 KB
testcase_61 AC 159 ms
5,688 KB
testcase_62 AC 155 ms
5,688 KB
testcase_63 AC 2 ms
4,348 KB
testcase_64 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0;i<(n);i++)

int N,K;

struct F{
  struct Node{ int i,cy; };
  vector<Node> V;
  F(){ V.resize(N); rep(i,N) V[i]={i,0}; }
  F operator*(const F& r)const{ F res; rep(i,N){ res.V[i].i=r.V[V[i].i].i; res.V[i].cy=V[i].cy+r.V[V[i].i].cy; } return res; }
  F pow(int i){ if(i==0) return F(); F res=pow(i/2); res=res*res; if(i%2==1) res=res* *this; return res; }
};

int main(){
  cin>>N>>K;
  F G;
  for(auto& q: G.V){ int a; cin>>a; q.i+=a; if(q.i>=N){ q.i-=N; q.cy++; } }
  G=G.pow(K);
  for(auto& q: G.V) cout<<(LL(q.cy)*N+q.i+1)<<endl;
  return 0;
}
0