結果

問題 No.1013 〇マス進む
ユーザー chocoruskchocorusk
提出日時 2020-03-20 21:52:11
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 944 bytes
コンパイル時間 1,051 ms
コンパイル使用メモリ 108,020 KB
実行使用メモリ 27,352 KB
最終ジャッジ日時 2023-08-21 16:17:02
合計ジャッジ時間 12,679 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
23,848 KB
testcase_01 AC 6 ms
23,816 KB
testcase_02 AC 6 ms
25,912 KB
testcase_03 AC 6 ms
23,952 KB
testcase_04 AC 6 ms
23,848 KB
testcase_05 AC 7 ms
25,972 KB
testcase_06 AC 7 ms
24,000 KB
testcase_07 AC 7 ms
25,980 KB
testcase_08 AC 7 ms
23,892 KB
testcase_09 AC 7 ms
23,848 KB
testcase_10 AC 7 ms
24,148 KB
testcase_11 AC 7 ms
24,144 KB
testcase_12 AC 7 ms
23,884 KB
testcase_13 AC 13 ms
23,980 KB
testcase_14 AC 101 ms
25,372 KB
testcase_15 AC 174 ms
26,840 KB
testcase_16 AC 152 ms
26,348 KB
testcase_17 AC 90 ms
25,172 KB
testcase_18 AC 117 ms
25,568 KB
testcase_19 AC 68 ms
26,224 KB
testcase_20 AC 208 ms
27,096 KB
testcase_21 AC 80 ms
26,424 KB
testcase_22 AC 119 ms
25,968 KB
testcase_23 AC 38 ms
26,048 KB
testcase_24 AC 213 ms
27,140 KB
testcase_25 AC 208 ms
27,144 KB
testcase_26 AC 41 ms
24,376 KB
testcase_27 AC 75 ms
25,152 KB
testcase_28 AC 39 ms
24,596 KB
testcase_29 AC 198 ms
27,072 KB
testcase_30 AC 72 ms
26,348 KB
testcase_31 AC 129 ms
26,012 KB
testcase_32 AC 95 ms
25,396 KB
testcase_33 AC 106 ms
25,304 KB
testcase_34 AC 176 ms
26,772 KB
testcase_35 AC 174 ms
26,088 KB
testcase_36 AC 17 ms
24,152 KB
testcase_37 AC 16 ms
25,944 KB
testcase_38 AC 191 ms
26,788 KB
testcase_39 AC 66 ms
24,596 KB
testcase_40 AC 192 ms
26,768 KB
testcase_41 AC 47 ms
24,724 KB
testcase_42 AC 111 ms
25,292 KB
testcase_43 AC 67 ms
24,860 KB
testcase_44 AC 110 ms
25,376 KB
testcase_45 AC 96 ms
26,364 KB
testcase_46 AC 52 ms
24,540 KB
testcase_47 AC 103 ms
26,532 KB
testcase_48 AC 121 ms
25,604 KB
testcase_49 AC 195 ms
26,328 KB
testcase_50 AC 148 ms
26,576 KB
testcase_51 AC 132 ms
26,644 KB
testcase_52 AC 30 ms
24,232 KB
testcase_53 AC 41 ms
24,480 KB
testcase_54 AC 155 ms
26,196 KB
testcase_55 AC 54 ms
26,164 KB
testcase_56 AC 215 ms
26,996 KB
testcase_57 AC 156 ms
26,036 KB
testcase_58 AC 267 ms
27,352 KB
testcase_59 AC 259 ms
27,160 KB
testcase_60 AC 229 ms
27,176 KB
testcase_61 AC 206 ms
27,176 KB
testcase_62 AC 199 ms
27,256 KB
testcase_63 AC 7 ms
25,944 KB
testcase_64 AC 7 ms
25,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
	int n, k;
	cin>>n>>k;
	int p[100010];
	for(int i=0; i<n; i++) cin>>p[i];
	ll dp[30][100010];
	for(int i=0; i<n; i++) dp[0][i]=p[i];
	for(int i=1; i<30; i++){
		for(int j=0; j<n; j++){
			dp[i][j]=dp[i-1][j]+dp[i-1][(j+dp[i-1][j])%n];
		}
	}
	for(int i=0; i<n; i++){
		ll ans=i;
		for(int j=0; j<30; j++){
			if(k&(1<<j)){
				ans+=dp[j][ans%n];
			}
		}
		cout<<ans+1<<endl;
	}
	return 0;
}
0