結果
| 問題 | No.2212 One XOR Matrix |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2023-02-15 18:23:32 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,384 bytes |
| 記録 | |
| コンパイル時間 | 121 ms |
| コンパイル使用メモリ | 26,292 KB |
| 最終ジャッジ日時 | 2026-02-24 01:12:17 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'mkwd':
main.c:13:20: warning: multi-character character constant [-Wmultichar]
13 | unsigned v='0000';
| ^~~~~~
main.c:5:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:15:9: note: in expansion of macro 'rep'
15 | rep(a,10){
| ^~~
main.c:5:18: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:15:9: note: in expansion of macro 'rep'
15 | rep(a,10){
| ^~~
main.c:5:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:16:17: note: in expansion of macro 'rep'
16 | rep(b,10){
| ^~~
main.c:5:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:17:25: note: in expansion of macro 'rep'
17 | rep(c,10){
| ^~~
main.c:5:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:18:33: note: in expansion of macro 'rep'
18 | rep(d,10){
| ^~~
main.c:5:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
5 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:28:9: note: in expansion of macro 'rep'
28 | rep(j,1000) wdlz[j]=1;
| ^~~
main.c:29:13: error: redefinition of 'j'
29 | rep(j,100) wdlz[j]=2;
| ^
main.c:5:27: note: in definition of macro 'rep'
5 |
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(long v=0;v<e;++v)
#define rep4(v,s,e,t) for(long v=s;v<e;v+=t)
char wbuf[1<<25];
unsigned wd[10000];
char wdlz[10000];
void mkwd(){
unsigned v='0000';
long i=0;
rep(a,10){
rep(b,10){
rep(c,10){
rep(d,10){
wd[i++]=v;
v+=1<<24;
}
v+=(1<<16)-(10<<24);
}
v+=(1<<8)-(10<<16);
}
v+=(1<<0)-(10<<8);
}
rep(j,1000) wdlz[j]=1;
rep(j,100) wdlz[j]=2;
rep(j,10) wdlz[j]=3;
}
const a4x4[4][4]={
{7,14,0,8},
{4,12,2,11},
{15,9,6,1},
{13,10,5,3},
};
int a[4][1024];
int main(){
mkwd();
int n;
{
char rbuf[64];
read(0,rbuf,sizeof rbuf);
char*rp=rbuf;
n=rd();
}
if(n==1){
printf("-1");
exit(0);
}
int w=1<<n;
{
char*wp=wbuf+sizeof wbuf;
int o=0;
rep4(j,0,w,4){
rep4(i,0,w,4){
if(i==j){
rep(y,4){
rep(x,4){
a[y][i+x]=o+a4x4[y][x];
}
}
o+=16;
}else{
rep(y,4){
rep(x,4){
a[y][i+x]=o++;
}
}
}
}
rep(y,4){
*--wp='\n';
rep(x,w){
unsigned v=a[y][x];
if(v>=10000){
wp-=4;
*(unsigned*)wp=wd[v%10000];
v/=10000;
}
wp-=4;
*(unsigned*)wp=wd[v];
wp+=wdlz[v];
*--wp=' ';
}
++wp;
}
}
write(1,wp,wbuf+sizeof wbuf-wp);
}
_exit(0);
}
tails