QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#306296#6309. AqrechebenWA 0ms3904kbC++141.3kb2024-01-16 17:06:242024-01-16 17:06:24

Judging History

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

  • [2024-01-16 17:06:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3904kb
  • [2024-01-16 17:06:24]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int tmp[4][4] = {
        {1, 1, 1, 0},
        {1, 0, 1, 1},
        {1, 1, 0, 1},
        {0, 1, 1, 1},
    };
    int T;
    scanf("%d", &T);
    while (T--) {
        int m, n;
        scanf("%d%d", &m, &n);
        if (m < 4 && n < 4) {
            printf("%d\r\n", m * n);
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    printf("1");
                    if (j != n - 1) {
                        printf(" ");
                    } else if (i != m - 1 || T != 0) {
                        printf("\r\n");
                    }
                }
            }
            continue;
        }
        int cnt = 0;
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                if (tmp[i % 4][j % 4] == 1) {
                    cnt++;
                }
            }
        }
        printf("%d\r\n", cnt);
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                printf("%d", tmp[i % 4][j % 4]);
                if (j != n - 1) {
                    printf(" ");
                } else if (i != m - 1 || T != 0) {
                    printf("\r\n");
                }
            }
        }
    }
    return 0;
}

詳細信息

Test #1:

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

input:

3
2 2
3 4
3 8

output:

4
1 1
1 1
9
1 1 1 0
1 0 1 1
1 1 0 1
18
1 1 1 0 1 1 1 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1

result:

wrong answer Length must be equal to m (test case 1)