結果
| 問題 | No.1851 Regular Tiling |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2022-03-01 14:06:19 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 719 bytes |
| 記録 | |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 28,444 KB |
| 最終ジャッジ日時 | 2026-02-22 08:49:59 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:18:17: error: too many arguments to function 'mmap'; expected 0, have 6
18 | char*rp=mmap(0l,1l<<25,1,2,0,0ll);
| ^~~~ ~~
main.c:7:6: note: declared here
7 | char*mmap();
| ^~~~
main.c:31:25: error: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
31 | memcpy(wp,y%3?x122:x011,xlen);
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memcpy'
+++ |+#include <string.h>
1 | #pragma GCC optimize("Ofast")
main.c:31:25: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch]
31 | memcpy(wp,y%3?x122:x011,xlen);
| ^~~~~~
main.c:31:25: note: include '<string.h>' or provide a declaration of 'memcpy'
main.c:35:9: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
35 | write(1,wbuf,wp-wbuf);
| ^~~~~
main.c:36:9: error: implicit declaration of function '_exit' [-Wimplicit-function-declaration]
36 | _exit(0);
| ^~~~~
main.c:36:9: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]
ソースコード
#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);
}
tails