結果

問題 No.1851 Regular Tiling
ユーザー tailstails
提出日時 2022-03-01 14:06:19
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 29,128 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 03:17:13
合計ジャッジ時間 2,892 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 0 ms
4,376 KB
testcase_12 AC 0 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:31:25: 警告: 関数 ‘memcpy’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   31 |                         memcpy(wp,y%3?x122:x011,xlen);
      |                         ^~~~~~
main.c:1:1: 備考: include ‘<string.h>’ or provide a declaration of ‘memcpy’
  +++ |+#include <string.h>
    1 | #pragma GCC optimize("Ofast")
main.c:31:25: 警告: 組み込み関数 ‘memcpy’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
   31 |                         memcpy(wp,y%3?x122:x011,xlen);
      |                         ^~~~~~
main.c:31:25: 備考: include ‘<string.h>’ or provide a declaration of ‘memcpy’
main.c:35:9: 警告: 関数 ‘write’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   35 |         write(1,wbuf,wp-wbuf);
      |         ^~~~~
main.c:36:9: 警告: implicit declaration of function ‘_exit’; did you mean ‘_Exit’? [-Wimplicit-function-declaration]
   36 |         _exit(0);
      |         ^~~~~
      |         _Exit

ソースコード

diff #

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

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

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

#define A "0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 "
char const a011[]=A A A A A A A;
#undef A
#define A "1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 "
char const a122[]=A A A A A A A;
#undef A

int main(){
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	char*wp=wbuf;

	rd_skip();
	while(*rp){
		rd(h);
		rd(w);
		long hoff=h%3==2;
		long woff=w%3==2;
		char const * x011=a011+2*woff;
		char const * x122=a122+2*woff;
		long xlen=w*2;
		for(long y=h+hoff;--y>=hoff;){
			memcpy(wp,y%3?x122:x011,xlen);
			wp+=xlen;
		}
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0