結果
| 問題 |
No.2984 [Cherry Anniversary 4] 満開の願いを込めた 27 の桜
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2024-12-09 15:49:18 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 4,000 ms |
| コード長 | 8,421 bytes |
| コンパイル時間 | 5,152 ms |
| コンパイル使用メモリ | 178,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-09 15:49:26 |
| 合計ジャッジ時間 | 6,830 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.c:11:1: warning: data definition has no type or storage class
11 | a[3][3][3],x[3][3],y[3][3],z[3][3];
| ^
main.c:11:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:11:12: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
11 | a[3][3][3],x[3][3],y[3][3],z[3][3];
| ^
main.c:11:20: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int]
11 | a[3][3][3],x[3][3],y[3][3],z[3][3];
| ^
main.c:11:28: warning: type defaults to ‘int’ in declaration of ‘z’ [-Wimplicit-int]
11 | a[3][3][3],x[3][3],y[3][3],z[3][3];
| ^
main.c: In function ‘main’:
main.c:290:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
290 | write(1,wbuf,wp-wbuf);
| ^~~~~
main.c:291:9: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
291 | _exit(0);
| ^~~~~
main.c:291:9: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rd_signed() ({int _s=*rp=='-'&&++rp,_v=rd();_s?-_v:_v;})
#define rep(v,e) for(typeof(e)v=0;v<e;++v)
#define repeat(e) for(typeof(e)_=e;_--;)
char wbuf[1<<25],*wp=wbuf;
a[3][3][3],x[3][3],y[3][3],z[3][3];
#define f(b,p0,p1,p2,q0,q1,q2,r0,r1,r2)\
a[0][q0][r0]+a[1][q0][r0]+a[2][q0][r0]==x[0][0]&&\
a[0][q0][r1]+a[1][q0][r1]+a[2][q0][r1]==x[0][1]&&\
a[0][q0][r2]+a[1][q0][r2]+a[2][q0][r2]==x[0][2]&&\
a[0][q1][r0]+a[1][q1][r0]+a[2][q1][r0]==x[1][0]&&\
a[0][q1][r1]+a[1][q1][r1]+a[2][q1][r1]==x[1][1]&&\
a[0][q1][r2]+a[1][q1][r2]+a[2][q1][r2]==x[1][2]&&\
a[0][q2][r0]+a[1][q2][r0]+a[2][q2][r0]==x[2][0]&&\
a[0][q2][r1]+a[1][q2][r1]+a[2][q2][r1]==x[2][1]&&\
a[0][q2][r2]+a[1][q2][r2]+a[2][q2][r2]==x[2][2]&&\
a[p0][0][r0]+a[p0][1][r0]+a[p0][2][r0]==y[0][0]&&\
a[p0][0][r1]+a[p0][1][r1]+a[p0][2][r1]==y[0][1]&&\
a[p0][0][r2]+a[p0][1][r2]+a[p0][2][r2]==y[0][2]&&\
a[p1][0][r0]+a[p1][1][r0]+a[p1][2][r0]==y[1][0]&&\
a[p1][0][r1]+a[p1][1][r1]+a[p1][2][r1]==y[1][1]&&\
a[p1][0][r2]+a[p1][1][r2]+a[p1][2][r2]==y[1][2]&&\
a[p2][0][r0]+a[p2][1][r0]+a[p2][2][r0]==y[2][0]&&\
a[p2][0][r1]+a[p2][1][r1]+a[p2][2][r1]==y[2][1]&&\
a[p2][0][r2]+a[p2][1][r2]+a[p2][2][r2]==y[2][2]&&\
a[p0][q0][0]+a[p0][q0][1]+a[p0][q0][2]==z[0][0]&&\
a[p0][q1][0]+a[p0][q1][1]+a[p0][q1][2]==z[0][1]&&\
a[p0][q2][0]+a[p0][q2][1]+a[p0][q2][2]==z[0][2]&&\
a[p1][q0][0]+a[p1][q0][1]+a[p1][q0][2]==z[1][0]&&\
a[p1][q1][0]+a[p1][q1][1]+a[p1][q1][2]==z[1][1]&&\
a[p1][q2][0]+a[p1][q2][1]+a[p1][q2][2]==z[1][2]&&\
a[p2][q0][0]+a[p2][q0][1]+a[p2][q0][2]==z[2][0]&&\
a[p2][q1][0]+a[p2][q1][1]+a[p2][q1][2]==z[2][1]&&\
a[p2][q2][0]+a[p2][q2][1]+a[p2][q2][2]==z[2][2]&&\
1?b:
int main(){
rd_init();
int t=rd();
repeat(t){
for(int i=0;i<3;++i){
for(int j=0;j<3;++j){
for(int k=0;k<3;++k){
a[i][j][k]=rd_signed();
}
}
}
for(int i=0;i<3;++i){
for(int j=0;j<3;++j){
x[i][j]=rd_signed();
}
}
for(int i=0;i<3;++i){
for(int j=0;j<3;++j){
y[i][j]=rd_signed();
}
}
for(int i=0;i<3;++i){
for(int j=0;j<3;++j){
z[i][j]=rd_signed();
}
}
int b=
f(0, 0,1,2, 0,1,2, 0,1,2)
f(1, 0,1,2, 0,1,2, 0,2,1)
f(1, 0,1,2, 0,1,2, 1,0,2)
f(1, 0,1,2, 0,1,2, 2,1,0)
f(1, 0,1,2, 0,2,1, 0,1,2)
f(1, 0,1,2, 1,0,2, 0,1,2)
f(1, 0,1,2, 2,1,0, 0,1,2)
f(1, 0,2,1, 0,1,2, 0,1,2)
f(1, 1,0,2, 0,1,2, 0,1,2)
f(1, 2,1,0, 0,1,2, 0,1,2)
f(2, 0,1,2, 0,1,2, 1,2,0)
f(2, 0,1,2, 0,1,2, 2,0,1)
f(2, 0,1,2, 0,2,1, 0,2,1)
f(2, 0,1,2, 0,2,1, 1,0,2)
f(2, 0,1,2, 0,2,1, 2,1,0)
f(2, 0,1,2, 1,0,2, 0,2,1)
f(2, 0,1,2, 1,0,2, 1,0,2)
f(2, 0,1,2, 1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