結果

問題 No.1013 〇マス進む
ユーザー kotatsugamekotatsugame
提出日時 2020-03-24 20:38:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 65,452 KB
実行使用メモリ 34,600 KB
最終ジャッジ日時 2023-08-30 06:03:31
合計ジャッジ時間 10,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
32,052 KB
testcase_01 AC 7 ms
32,000 KB
testcase_02 AC 8 ms
31,992 KB
testcase_03 AC 8 ms
32,020 KB
testcase_04 AC 8 ms
32,096 KB
testcase_05 AC 8 ms
32,004 KB
testcase_06 AC 8 ms
32,000 KB
testcase_07 AC 8 ms
32,092 KB
testcase_08 AC 8 ms
32,104 KB
testcase_09 AC 9 ms
32,264 KB
testcase_10 AC 9 ms
32,132 KB
testcase_11 AC 8 ms
32,052 KB
testcase_12 AC 9 ms
32,012 KB
testcase_13 AC 14 ms
32,112 KB
testcase_14 AC 101 ms
33,196 KB
testcase_15 AC 160 ms
33,896 KB
testcase_16 AC 148 ms
33,944 KB
testcase_17 AC 85 ms
33,020 KB
testcase_18 AC 108 ms
33,228 KB
testcase_19 AC 67 ms
32,792 KB
testcase_20 AC 191 ms
34,304 KB
testcase_21 AC 80 ms
33,008 KB
testcase_22 AC 110 ms
33,320 KB
testcase_23 AC 39 ms
32,432 KB
testcase_24 AC 199 ms
34,600 KB
testcase_25 AC 192 ms
34,428 KB
testcase_26 AC 40 ms
32,424 KB
testcase_27 AC 74 ms
33,128 KB
testcase_28 AC 41 ms
32,432 KB
testcase_29 AC 186 ms
34,324 KB
testcase_30 AC 71 ms
32,780 KB
testcase_31 AC 127 ms
33,752 KB
testcase_32 AC 95 ms
33,060 KB
testcase_33 AC 99 ms
33,252 KB
testcase_34 AC 157 ms
33,996 KB
testcase_35 AC 149 ms
33,660 KB
testcase_36 AC 17 ms
32,160 KB
testcase_37 AC 17 ms
32,144 KB
testcase_38 AC 173 ms
33,980 KB
testcase_39 AC 62 ms
32,640 KB
testcase_40 AC 160 ms
33,756 KB
testcase_41 AC 44 ms
32,408 KB
testcase_42 AC 99 ms
33,048 KB
testcase_43 AC 64 ms
32,676 KB
testcase_44 AC 101 ms
33,128 KB
testcase_45 AC 92 ms
32,936 KB
testcase_46 AC 50 ms
32,492 KB
testcase_47 AC 97 ms
33,056 KB
testcase_48 AC 113 ms
33,196 KB
testcase_49 AC 161 ms
33,840 KB
testcase_50 AC 134 ms
33,424 KB
testcase_51 AC 119 ms
33,272 KB
testcase_52 AC 30 ms
32,296 KB
testcase_53 AC 39 ms
32,408 KB
testcase_54 AC 144 ms
33,668 KB
testcase_55 AC 50 ms
32,564 KB
testcase_56 AC 192 ms
34,068 KB
testcase_57 AC 133 ms
33,456 KB
testcase_58 AC 213 ms
34,376 KB
testcase_59 AC 218 ms
34,424 KB
testcase_60 AC 212 ms
34,424 KB
testcase_61 AC 201 ms
34,416 KB
testcase_62 AC 197 ms
34,428 KB
testcase_63 AC 7 ms
31,988 KB
testcase_64 AC 7 ms
31,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N,K;
long tb[30][1<<17];
long ans[1<<17];
main()
{
	cin>>N>>K;
	for(int i=0;i<N;i++)
	{
		cin>>tb[0][i];
		ans[i]=i;
	}
	for(int k=1;k<30;k++)
	{
		for(int i=0;i<N;i++)
		{
			tb[k][i]=tb[k-1][i]+tb[k-1][(i+tb[k-1][i])%N];
		}
	}
	for(int k=0;k<30;k++)
	{
		if(K>>k&1)
		{
			for(int i=0;i<N;i++)ans[i]+=tb[k][ans[i]%N];
		}
	}
	for(int i=0;i<N;i++)cout<<ans[i]+1<<endl;
}
0