QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#103652 | #6309. Aqre | MIT01# | WA | 1ms | 24800kb | C++17 | 1.4kb | 2023-05-07 06:10:31 | 2023-05-07 06:10:33 |
Judging History
answer
#pragma GCC optimize("-Ofast","-ffast-math","-funroll-all-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pl pair<ll, ll>
#define db double
#define vi vector<int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int f[2333][2333],n,m,T;
string g[4]={
" . ",
" .",
" . ",
". "};
string s[4]={
" . ",
" .",
" . ",
". "};
void sol() {
cin>>n>>m;
if(min(n,m)<=3) {
for(int i=0;i<n;++i)
for(int j=0;j<m;++j) f[i][j]=(i%4!=3)&&(j%4!=3);
}
else if(n%4==2&&m%4==2){
for(int i=0;i<n;++i) {
for(int j=0;j<m;++j) {
f[i][j]=s[i%4][j%4]!='.';
}
}
}
else if(n%4<m%4) {
for(int i=0;i<n;++i) {
for(int j=0;j<m;++j) {
f[i][j]=g[3-i%4][3-j%4]!='.';
}
}
}
else {
for(int i=0;i<n;++i) {
for(int j=0;j<m;++j) {
f[i][j]=g[3-j%4][3-i%4]!='.';
}
}
}
int su=0;
for(int i=0;i<n;++i)
for(int j=0;j<m;++j) su+=f[i][j];
printf("%d\n",su);
for(int i=0;i<n;++i,puts(""))
for(int j=0;j<m;++j) {
putchar(f[i][j]+48);
}
}
int main() {
memset(f,-1,sizeof f);
cin>>T;
while(T--) sol();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 24800kb
input:
3 2 2 3 4 3 8
output:
4 11 11 9 1110 1110 1110 18 11101110 11101110 11101110
result:
wrong answer 1s are not connected. (test case 3)