QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#514106#8217. King's Dinnerwallace114514Compile Error//C++141.6kb2024-08-10 21:55:232024-08-10 21:55:23

Judging History

你现在查看的是最新测评结果

  • [2024-08-10 21:55:23]
  • 评测
  • [2024-08-10 21:55:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N=105;
 
int t,n;
char a[N][N];
char m[N][N][N]={
	{{'.'}},{{'#','.'},{'#','.'}},{{'#','.','#'},{'#','.','#'},{'.','.','.'}},
	{{'#','.','#','#'},{'#','.','.','.'},{'.','.','.','#'},{'#','#','.','#'}},
	{{'#','#','.','#','#'},{'.','.','.','.','.'},{'#','#','.','#','#'},{'.','.','.','.','.'},{'#','#','.','#','#'}},
	{{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
	{{'#','.','#','.','#','.','#'},
	{'#','.','#','.','#','.','#'},
	{'.','.','.','.','.','.','.'},
	{'#','.','#','.','#','.','#'},
	{'#','.','#','.','#','.','#'},
	{'.','.','.','.','.','.','.'},
	{'#','#','.','#','#','.','.'}
	}
};
void dfs(int x) {
	if(x>7) {
		if(x%2==0) {
			for(int i=1;i<=x-6;i+=2) a[x-4][i]=a[x-3][i]=a[x-1][i]=a[x][i]='#';
			for(int i=1;i<=x;i+=2) a[i+1][x-4]=a[i+1][x-3]=a[i+1][x-1]=a[i+1][x]='#';
		}else {
			for(int i=1;i<=x-9;i+=2) a[x-4][i]=a[x-3][i]=a[x-1][i]=a[x][i]='#';
			a[x][x-8]=a[x][x-7]=a[x-2][x-8]=a[x-2][x-7]=a[x-4][x-8]=a[x-4][x-7]='#';
			for(int i=1;i<=x-3;i+=2) a[i+1][x-4]=a[i+1][x-3]=a[i+1][x-1]=a[i+1][x]='#';
			a[x][x]=a[x-1][x]=a[x][x-2]=a[x-1][x-2]=a[x][x-4]=a[x-1][x-4]='#';
		}
		dfs(x-6);
		return;
	}
	for(int i=1;i<=x;i++) {
		for(int j=1;j<=x;j++) {
			a[i][j]=m[x-1][i-1][j-1];
		} 
	}
}

int main(){
	cin>>t;
	while(t--) {
		cin>>n;
		for(int i=1;i<=n;i++) {
			for(int j=1;j<=n;j++) {
				a[i][j]='.';
			}
		}
		dfs(n);
		for(int i=1;i<=n;i++) {
			for(int j=1;j<=n;j++) cout<<a[i][j];
			cout<<endl;
		}
	}
	return 0;
}

Details

answer.code:12:31: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                               ^
answer.code:12:33: warning: multi-character character constant [-Wmultichar]
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                 ^~~~~
answer.code:12:50: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                  ^
answer.code:12:58: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                          ^
answer.code:12:59: warning: multi-character character constant [-Wmultichar]
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                           ^~~~~
answer.code:12:64: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                ^
answer.code:12:68: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                    ^
answer.code:12:85: warning: multi-character character constant [-Wmultichar]
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                     ^~~~~
answer.code:12:106: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                          ^
answer.code:12:110: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                              ^
answer.code:12:111: warning: multi-character character constant [-Wmultichar]
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                               ^~~~~
answer.code:12:116: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                                    ^
answer.code:12:124: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                                            ^
answer.code:12:137: warning: multi-character character constant [-Wmultichar]
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                                                         ^~~~~
answer.code:12:142: error: stray ‘#’ in program
   12 |         {{'#','#','.','#','.',#.'},{'.','.','.','#','.','#'},{'#','#','.','.','.','.'},{'.','.','.','.','#','#'},{'#','.','#','.','.','.'},{'#','.','#','.','#','#'}},
      |                                                                                                                                              ^
answer.code:12:150: error: stray ‘#’ in program
   12 |         ...