結果

問題 No.1013 〇マス進む
ユーザー sideside
提出日時 2020-03-28 01:39:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 6,001 bytes
コンパイル時間 1,823 ms
コンパイル使用メモリ 174,124 KB
実行使用メモリ 40,064 KB
最終ジャッジ日時 2024-06-10 16:59:00
合計ジャッジ時間 11,159 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 4 ms
6,940 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 3 ms
6,940 KB
testcase_12 AC 4 ms
6,944 KB
testcase_13 AC 10 ms
6,944 KB
testcase_14 AC 110 ms
20,736 KB
testcase_15 AC 188 ms
31,744 KB
testcase_16 AC 166 ms
29,312 KB
testcase_17 AC 88 ms
18,688 KB
testcase_18 AC 118 ms
22,016 KB
testcase_19 AC 69 ms
14,336 KB
testcase_20 AC 230 ms
38,144 KB
testcase_21 AC 84 ms
17,280 KB
testcase_22 AC 118 ms
22,784 KB
testcase_23 AC 38 ms
9,472 KB
testcase_24 AC 223 ms
39,296 KB
testcase_25 AC 214 ms
38,400 KB
testcase_26 AC 39 ms
9,600 KB
testcase_27 AC 79 ms
16,640 KB
testcase_28 AC 39 ms
9,472 KB
testcase_29 AC 211 ms
37,376 KB
testcase_30 AC 73 ms
15,104 KB
testcase_31 AC 138 ms
25,984 KB
testcase_32 AC 100 ms
20,096 KB
testcase_33 AC 110 ms
20,096 KB
testcase_34 AC 185 ms
30,080 KB
testcase_35 AC 182 ms
28,544 KB
testcase_36 AC 14 ms
6,940 KB
testcase_37 AC 13 ms
6,944 KB
testcase_38 AC 191 ms
32,768 KB
testcase_39 AC 71 ms
12,800 KB
testcase_40 AC 198 ms
29,952 KB
testcase_41 AC 45 ms
9,856 KB
testcase_42 AC 107 ms
19,328 KB
testcase_43 AC 66 ms
13,440 KB
testcase_44 AC 112 ms
20,224 KB
testcase_45 AC 100 ms
18,176 KB
testcase_46 AC 53 ms
10,240 KB
testcase_47 AC 103 ms
19,456 KB
testcase_48 AC 126 ms
22,272 KB
testcase_49 AC 199 ms
29,824 KB
testcase_50 AC 148 ms
25,984 KB
testcase_51 AC 140 ms
23,424 KB
testcase_52 AC 29 ms
7,168 KB
testcase_53 AC 40 ms
9,088 KB
testcase_54 AC 166 ms
28,288 KB
testcase_55 AC 54 ms
10,752 KB
testcase_56 AC 232 ms
35,200 KB
testcase_57 AC 156 ms
24,960 KB
testcase_58 AC 281 ms
39,936 KB
testcase_59 AC 268 ms
39,936 KB
testcase_60 AC 248 ms
39,936 KB
testcase_61 AC 215 ms
39,936 KB
testcase_62 AC 215 ms
40,064 KB
testcase_63 AC 2 ms
6,940 KB
testcase_64 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
vrrtll==???>;::::~~~~~~......`.`````````````````````...-?777!_.._?7u,~~~::::;>>??=lllttrrzu
rtll==??>>;::::~~~~......`.`````````````````` ..J77!`````````...`..._T,~~~~:::;;>??==lttrrv
tll=??>>;:::~~~~......``````````````````..J7^ ` ``  ` `` .,```````...._4,.~~~::;;>>?===lttr
l=???>;;::~~~......`````HTSu,.``  `..J7!    `      `` .J"~N```````````..?&.~~~~::;;>>?==llt
=??>;;::~~~~.....``````.@????7SJ.?=     `     ` `` .J=....J;  ``````````..h..~~~~::;;>??=ll
?>>;::~~~~.....````````.D?>>?>?>?8+.``         `.J"_......_b`     ````````.S_.~~~~::;;>??=l
>;;::~~~~....``````````.C>??>>>?>>>?8J.`  ```..Y~..........J;  `  ` ``````` G...~~~~::;>??=
;;::~~~....```````` `..W1>>?>>>>?>>>>>?S,.`.7^.............-N``  `   ``````` 6...~~~~::;>??
;:~~~~....``````` ..7` d??>>?>?>>?>>?>>1udMgggNNNNggJ.......([          `````.L...~~~~::;>?
:~~~.....`````` .7`   `K>?>?>>>>>>+ugNMMMB""7<!~~<?7TWMNNa,..w.`  ` `  ` `````,)....~~:::;>
~~~....``````.J^     ` #>>?>>>?jgMMM9=_................-?TMMa,b` `   `  `  ````(,...~~~~:;;
~~~....``` .7``   `    @?>>?1uMM#=.........................(TMNa......  ` ``````4....~~~::;
~~~...`` .=`` `     ` .b>>jgNH".................`.............?HNmx??17TYY9SA+(..L....~~~::
~....` ,^``     `   ` .b+dN#^............6..-(,-...`............(HMm+>>>>>?>>????zOM_.~~~::
.... .=```  `` `   ...JNMM^..........`..._n.(MMN,....`..`.........?MNe<>>?>??>????d^...~~~:
~...v```` ` ..-Z""!_..(M@_........`........?7MMMMp.................-TNN+?>>>????1d4-..-(Jk9
..(^`...zY"!_........(MD..............`......JMMMMp....`..`..`......./MNx>??>>?1d!.h7=~(??=
(v_`,R_.............(NF..(/..(&,...`..........?MMMM;..................(MMs>>?1&T"!``....(1=
t..`` 4,...........(N@....?,(NMNR_.....`..`....(WMM$..`....`..`..`....._HMe7=```````....~_1
...````.4,........-dM:.....(7MMMNR-.....................`............(.?^ ``  ``````....~~~
...``````,4,....`.(NF........(MMMMb..`....--................`....(.7!        `  ````....~~:
..````` ` `.5J_...JMt.........?NMMM[...`.HH5._(J7[...`...`...--?^`          ` `````....~~~:
...````` `  ` 7a,.dM{....`...../MMMN......(J=`  .>......._(/=             `  ` `````...~~~:
....```` ``     (4MN{..........._7"^...(/^    `.C....-(J=`                  ` ` ```....~~~:
....````` `      JdM[...`...`........`_3..  ..?!..(-7!                  ` ` ``````....~~~::
r...``````  ` ``(CJMb..............`......__..-(?^                     `  `  `````....~~::;
J/...````` `  `,3>+MN-.`..`...`..........._(J=``                     `  ` ```````....~~~::;
_j,..`.```` ``.5>>?dNb...`......`......_-?'`                            `  `````....~~~::;;
~~j,..```````.D??>>>MM/....`........(-=`                          `  ` ` ```````...~~~:::;>
~~~j,...````.E??>??>?MN-.........(J=                            `   ` ` ``````....~~~~::;??
:~~~?,...``.@>?>?>>??dMN_....-(?^                        `  `    ` `  ````````...~~~~:;;>??
::~~~?/....K??????>>?>dMN-_(7!                               `  ` ` ````````....~~~:::>>??l
;:::~~/e.(K==?????????<dM"!                          `    `   ` ` `` ``````...~~~~:::;>??=l
@TT_beginner
*/
#include "bits/stdc++.h"
using namespace std;
#define ok1 cerr<<"ok1\n";
#define ok2 cerr<<"ok2\n";
#define M LLONG_MAX
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,s,n) for(int i=(s);i<(n);++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define REPR(i,s,n) for(int i=(s);i>=(n);--(i))
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb emplace_back //emplace_backの方が速いが使い慣れてないため
#define DOUBLE fixed << setprecision(15)
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define out(x, y) ((x) < 0 || h <= (x) || (y) < 0 || w <= (y))
const double pi = acos(-1.0L);
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> TLL;
typedef vector<P> vP;
typedef vector<TLL> vTLL;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
ll dy[4] = { 1,0,-1,0 };
ll dx[4] = { 0,1,0,-1 };
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 A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{ " << p.first << ", " << p.second << " }";
	return ost;
}
template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{ ";
	for (int i = 0; i<v.size(); i++) {
		if (i)ost << ", ";
		ost << v[i];
	}
	ost << " }";
	return ost;
}
template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{ ";
	for (auto p : v) {
		ost << "{ " << p.first << ", " << p.second << " }";
	}
	ost << " }";
	return ost;
}
bool out_check(ll a, ll b) { return (0 <= a && a < b); }
double pitagoras(ll a, ll b, ll c, ll d) {
	double dx = a - b, dy = c - d;
	return pow(dx * dx + dy * dy, 0.5);
}
ll modpow(ll a, ll b) { ll c = 1; while (b > 0) { if (b & 1) { c = a * c%mod; }a = a * a%mod; b >>= 1; }return c; }
void Yes(bool x) { cout << ((x) ? "Yes\n" : "No\n"); }
void YES(bool x) { cout << ((x) ? "YES\n" : "NO\n"); }
void yes(bool x) { cout << ((x) ? "yes\n" : "no\n"); }
void Yay(bool x) { cout << ((x) ? "Yay!\n" : ":(\n"); }
//*
ll  n, m, d, e, r, l, k, h, w, Q, ans, ret = M;
bool flag = false, flag2 = false, flag3 = false;
string s, t, u;
ll x, y;
/**/



int main() {
	cin.tie(0); ios::sync_with_stdio(false);//not intractive
	cin >> n >> k;
	vll a(n);
	rep(i, n)cin >> a[i];
	vvll dubling(45, vll(n));
	rep(i, n)dubling[0][i] = a[i];
	rep(i, 40)rep(j, n) {
		dubling[i + 1][j] = dubling[i][j] + dubling[i][(j + dubling[i][j]) % n];
	}
	//cerr << dubling << endl;
	rep(i, n) {
		ans = i;
		rep(j, 35) {
			if (k&(1LL << j)) {
				ans += dubling[j][ans%n];
			}
		}
		cout << ans + 1 << endl;
	}
}
0