結果

問題 No.893 お客様を誘導せよ
ユーザー tailstails
提出日時 2021-12-23 19:55:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 30,164 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 21:24:01
合計ジャッジ時間 1,452 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:33:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   33 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:34:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
   34 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

#define rd(v) long v=0;{long _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
#define rep(v,e) for(long v=0;v<e;++v)

char*mmap();
char wbuf[1<<25];
char*y[1000];

int main(){
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	rd(n);
	rep(i,n){
		while(*rp++>=48);
		y[i]=rp;
		if(rp[-1]!=10){
			while(*rp++!=10);
		}
	}
	char*wp=wbuf;
	rep(t,100){
		rep(i,n){
			char*p=y[i];
			if(p[-1]!=10){
				for(long c;c=*p++,c>=48;*wp++=c);
				*wp++=32;
				y[i]=p;
			}
		}
	}

	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0