QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#306290 | #6309. Aqre | cheben | WA | 0ms | 3812kb | C++14 | 1.3kb | 2024-01-16 17:04:07 | 2024-01-16 17:04:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tmp[4][4] = {
{0, 1, 1, 1},
{1, 1, 1, 0},
{1, 0, 1, 1},
{1, 1, 0, 1},
};
int T;
scanf("%d", &T);
while (T--) {
int m, n;
scanf("%d%d", &m, &n);
if (m < 4 && n < 4) {
printf("%d\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("\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\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("\n");
}
}
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3812kb
input:
3 2 2 3 4 3 8
output:
4 1 1 1 1 9 0 1 1 1 1 1 1 0 1 0 1 1 18 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1
result:
wrong answer Length must be equal to m (test case 1)