QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#298819#6309. Aqrec201904#WA 0ms3784kbC++14542b2024-01-06 14:57:292024-01-06 14:57:29

Judging History

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

  • [2024-01-06 14:57:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3784kb
  • [2024-01-06 14:57:29]
  • 提交

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[0][3]=vis[1][2]=vis[2][1]=vis[3][0]=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: 3784kb

input:

3
2 2
3 4
3 8

output:

4
11
11
9
1110
1101
1011
18
11101110
11011101
10111011

result:

wrong answer 1s are not connected. (test case 2)