結果

問題 No.2984 [Cherry Anniversary 4] 満開の願いを込めた 27 の桜
コンテスト
ユーザー 👑 tails
提出日時 2024-12-09 15:49:18
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 8,421 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 571 ms
コンパイル使用メモリ 77,756 KB
最終ジャッジ日時 2026-02-24 01:21:32
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
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: In function 'main':
main.c:8:32: error: expected ';' before '_'
    8 | #define repeat(e) for(typeof(e)_=e;_--;)
      |                                ^
main.c:46:9: note: in expansion of macro 'repeat'
   46 |         repeat(t){
      |         ^~~~~~
main.c:8:36: error: '_' undeclared (first use in this function)
    8 | #define repeat(e) for(typeof(e)_=e;_--;)
      |                                    ^
main.c:46:9: note: in expansion of macro 'repeat'
   46 |         repeat(t){
      |         ^~~~~~
main.c:8:36: note: each undeclared identifier is reported only once for each function it appears in
    8 | #define repeat(e) for(typeof(e)_=e;_--;)
      |                                    ^
main.c:46:9: note: in expansion of macro 'repeat'
   46 |         repeat(t){
      |         ^~~~~~
main.c:47:17: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   47 |                 for(int i=0;i<3;++i){
      |                 ^~~
main.c:47:17: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
main.c:48:25: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   48 |                         for(int j=0;j<3;++j){
      |                         ^~~
main.c:49:33: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   49 |                                 for(int k=0;k<3;++k){
      |                                 ^~~
main.c:54:25: error: redefinition of 'i'
   54 |                 for(int i=0;i<3;++i){
      |                         ^
main.c:47:25: note: previous definition of 'i' with type 'int'
   47 |                 for(int i=0;i<3;++i){
      |                         ^
main.c:54:17: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   54 |                 for(int i=0;i<3;++i){
      |                 

ソースコード

diff #
raw source code

#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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