QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#585524#6414. Classical Maximization Problemrotcar07WA 0ms3620kbC++20780b2024-09-23 21:07:422024-09-23 21:07:44

Judging History

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

  • [2024-09-23 21:07:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3620kb
  • [2024-09-23 21:07:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
bool a[105][105];
int main(){
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		memset(a,0,sizeof a);n++;
		if(n&1){
			int l=1,sz=n,r=n;
			while(sz>6){
				for(int i=l+3;i<=r;i+=2) a[l][i]=a[l+1][i]=a[i][r-2]=a[i][r-1]=1;
				for(int i=l;i<=r-3;i+=2) a[r-1][i]=a[r-2][i]=a[i][l+1]=a[i][l]=1;
				sz-=6;l+=3,r-=3;
			}
			if(sz==3) a[l][l]=a[l][l+1]=1;
			else if(sz==5)a[l][l]=a[l][l+1]=a[l+2][l]=a[l+2][l+1]=a[l][l+3]=a[l+1][l+3]=1;
		}
		else{
			int r=n%6;
			for(int i=1;i+r<=n;i+=3)
				for(int j=1;j<=n;j+=2) a[i][j]=a[i+1][j]=1;
			for(int i=n;i>n-r;i-=2)
				for(int j=1;j+2<=n;j+=3) a[i-1][j]=a[i-1][j+1]=1;
		}
		for(int i=1;i<n;i++,putchar('\n'))
		for(int j=1;j<n;j++) putchar(".#"[a[i][j]]);
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3620kb

input:

3
2
0 0
0 1
1 0
1 1
2
0 0
0 1
0 2
0 3
2
0 0
1 1
2 2
3 3

output:

##
..

result:

wrong output format Expected integer, but "##" found (test case 1)