結果

問題 No.1013 〇マス進む
ユーザー tailstails
提出日時 2021-02-12 09:56:25
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 878 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 31,288 KB
実行使用メモリ 6,176 KB
最終ジャッジ日時 2023-09-26 09:26:20
合計ジャッジ時間 11,767 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 11 ms
4,884 KB
testcase_15 AC 17 ms
5,636 KB
testcase_16 AC 16 ms
5,504 KB
testcase_17 AC 9 ms
4,740 KB
testcase_18 AC 13 ms
5,020 KB
testcase_19 AC 6 ms
4,380 KB
testcase_20 AC 17 ms
5,948 KB
testcase_21 AC 9 ms
4,552 KB
testcase_22 AC 12 ms
4,996 KB
testcase_23 AC 4 ms
4,380 KB
testcase_24 AC 21 ms
5,976 KB
testcase_25 AC 20 ms
6,012 KB
testcase_26 AC 5 ms
4,380 KB
testcase_27 AC 7 ms
4,580 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 17 ms
5,976 KB
testcase_30 AC 8 ms
4,540 KB
testcase_31 AC 14 ms
5,188 KB
testcase_32 AC 9 ms
4,772 KB
testcase_33 AC 23 ms
4,756 KB
testcase_34 AC 34 ms
5,464 KB
testcase_35 AC 36 ms
5,508 KB
testcase_36 AC 3 ms
4,380 KB
testcase_37 AC 4 ms
4,376 KB
testcase_38 AC 39 ms
5,724 KB
testcase_39 AC 15 ms
4,380 KB
testcase_40 AC 39 ms
5,484 KB
testcase_41 AC 10 ms
4,376 KB
testcase_42 AC 23 ms
4,796 KB
testcase_43 AC 14 ms
4,380 KB
testcase_44 AC 24 ms
4,864 KB
testcase_45 AC 22 ms
4,692 KB
testcase_46 AC 12 ms
4,376 KB
testcase_47 AC 20 ms
4,804 KB
testcase_48 AC 24 ms
5,040 KB
testcase_49 AC 39 ms
5,548 KB
testcase_50 AC 33 ms
5,252 KB
testcase_51 AC 27 ms
5,108 KB
testcase_52 AC 7 ms
4,376 KB
testcase_53 AC 9 ms
4,380 KB
testcase_54 AC 35 ms
5,436 KB
testcase_55 AC 13 ms
4,376 KB
testcase_56 AC 51 ms
5,856 KB
testcase_57 AC 34 ms
5,240 KB
testcase_58 AC 54 ms
6,176 KB
testcase_59 AC 56 ms
6,112 KB
testcase_60 AC 52 ms
6,040 KB
testcase_61 AC 17 ms
6,124 KB
testcase_62 AC 7 ms
6,048 KB
testcase_63 AC 1 ms
4,380 KB
testcase_64 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:14:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
   14 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:42:9: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   42 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:43:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   43 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

char*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}

char wbuf[1<<28];
#define WTHI(v) {long _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;}
#define WTLO(v) {long _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(long*)wp=_d;wp+=8;}
#define WT(v) if(v>=100000000){WTHI(v/100000000);WTLO(v);}else{WTHI(v);}

long a[100000],p[100000],q[100000];

main(){
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(n);
	RD(k);
	for(int i=0;i<n;++i){
		RD(t);
		p[i]=t;
		a[i]=i;
	}
	for(;k;k>>=1){
		if(k&1){
			for(int i=0;i<n;++i){
				a[i]+=p[a[i]%n];
			}
		}
		for(int i=0;i<n;++i){
			q[i]=p[i]+p[(i+p[i])%n];
		}
		for(int i=0;i<n;++i){
			p[i]=q[i];
		}
	}
	char*wp=wbuf;
	for(int i=0;i<n;++i){
		long t=a[i]+1;
		WT(t);
		*wp++=10;
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0