QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#806505 | #9874. Matrix Construction | k1nsom | WA | 1ms | 5764kb | C++14 | 678b | 2024-12-09 11:11:51 | 2024-12-09 11:11:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int a[5005][5005], vis[5005][5005];
signed main()
{
int t;
cin >> t;
while (t--)
{
int n, m;
cin >> n >> m;
int tot = 0;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
for (int k = 0; i + k >= 1 && i + k <= n && j - k >= 1 && j - k <= m; k++)
if (!vis[i + k][j - k])
a[i + k][j - k] = ++tot, vis[i + k][j - k] = 1;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cout << a[i][j] << " \n"[j == m], vis[i][j] = 0;
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5764kb
input:
2 1 1 2 3
output:
1 1 2 4 3 5 6
result:
wrong answer Token parameter [name=ok] equals to "1", doesn't correspond to pattern "[yY][eE][sS]" (test case 1)