QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#297892 | #6309. Aqre | PlentyOfPenalty# | WA | 0ms | 3736kb | C++20 | 563b | 2024-01-05 12:59:10 | 2024-01-05 12:59:10 |
Judging History
answer
#include<bits/stdc++.h>
#define all(x) begin(x),end(x)
using namespace std;
const int N=1e3+9;
int T,n,m,num[5],mn,mi;
int main(){
#ifndef ONLINE_JUDGE
//freopen(".in","r",stdin);
#endif
cin.tie(0)->sync_with_stdio(0);
cin>>T;
while(T--){
cin>>n>>m;
for(int i=0;i<4;++i)num[i]=0;
for(int i=1;i<=n;++i)for(int j=1;j<=m;++j)++num[i+j&3];
mn=n*m,mi=2;
for(int i=0;i<4;++i)if(num[i]<mn)mn=num[i],mi=i;
printf("%d\n",n*m-mn);
for(int i=1;i<=n;++i){
for(int j=1;j<=m;++j)putchar('0'+((i+j&3)!=mi));
putchar('\n');
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3736kb
input:
3 2 2 3 4 3 8
output:
4 11 11 9 1101 1011 0111 18 11011101 10111011 01110111
result:
wrong answer 1s are not connected. (test case 2)