QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#298840#6309. Aqrec201904#WA 0ms3628kbC++14542b2024-01-06 15:07:322024-01-06 15:07:34

Judging History

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

  • [2024-01-06 15:07:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3628kb
  • [2024-01-06 15:07:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e3+5;
int n,m;
int cases;
char a[N][N];
int vis[4][4];
int main(){
	int cases;
	scanf("%d",&cases);
	while(cases--){
		int ans=0; 
		scanf("%d%d",&n,&m);
		vis[1][1]=vis[0][3]=vis[3][0]=vis[2][2]=1;
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				if(vis[i%4][j%4])a[i][j]='0';
				else a[i][j]='1',ans++;
			}
		}
		printf("%d\n",ans);
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				printf("%c",a[i][j]);
			}
			puts("");
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
2 2
3 4
3 8

output:

3
11
10
9
1110
1011
1101
18
11101110
10111011
11011101

result:

wrong answer ans finds a larger answer (test case 1)