QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#103652#6309. AqreMIT01#WA 1ms24800kbC++171.4kb2023-05-07 06:10:312023-05-07 06:10:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-07 06:10:33]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:24800kb
  • [2023-05-07 06:10:31]
  • 提交

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();
}

详细

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)