結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー tailstails
提出日時 2021-02-19 23:09:51
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 3 ms / 3,153 ms
コード長 493 bytes
コンパイル時間 1,560 ms
コンパイル使用メモリ 31,460 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-16 22:29:15
合計ジャッジ時間 24,467 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 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
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 3 ms
4,348 KB
testcase_19 AC 3 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int]
    9 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:9: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   13 |         memset(wbuf,'1',v+2);
      |         ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | #pragma GCC optimize("Ofast")
main.c:13:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
   13 |         memset(wbuf,'1',v+2);
      |         ^~~~~~
main.c:13:9: note: include '<string.h>' or provide a declaration of 'memset'
main.c:27:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   27 |         write(1,wbuf,n);
      |         ^~~~~

ソースコード

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];

main(){
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(v);
	RD(d);
	memset(wbuf,'1',v+2);
	wbuf[v]=10;
	memset(wbuf+(v+2),d==1?'1':'0',v-1);
	wbuf[v*2+1]=10;
	int n=(v+1)*v;
#if 0
	for(int i=v+1;i<n;i+=8){
		*(long*)(wbuf+i+(v+1))=*(long*)(wbuf+i);
	}
#else
	for(int i=v+1;i<n;i+=1){
		*(wbuf+i+(v+1))=*(wbuf+i);
	}
#endif
	write(1,wbuf,n);
}
0