QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#412781 | #6743. water235 | Guren_ | WA | 1ms | 3428kb | C++20 | 2.8kb | 2024-05-16 19:26:32 | 2024-05-16 19:26:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin >> n >> m;
if(n%2==1)
{
int flag = 1;
for (int i = 1; i <= n;i++)
{
if(i%2==1)
{
if(flag==1)
{
for (int j = 1; j <= m;j++)
{
if(j%2==1)
{
cout << "1 ";
}
else
{
cout << "0 ";
}
}
cout << endl;
}
if(flag==0)
{
for (int j = 1; j <= m; j++)
{
if (j % 2 == 0)
{
cout << "1 ";
}
else
{
cout << "0 ";
}
}
cout << endl;
}
if (flag == 1)
flag = 0;
else
flag = 1;
}
else
{
for (int j = 1; j <= m;j++){
cout << "0 ";
}
cout << endl;
}
}
}
else
{
int flag = 1;
for (int i = 1; i <= n-1; i++)
{
if (i % 2 == 1)
{
if (flag == 1)
{
for (int j = 1; j <= m; j++)
{
if (j % 2 == 1)
{
cout << "1 ";
}
else
{
cout << "0 ";
}
}
cout << endl;
}
if (flag == 0)
{
for (int j = 1; j <= m; j++)
{
if (j % 2 == 0)
{
cout << "1 ";
}
else
{
cout << "0 ";
}
}
cout << endl;
}
if (flag == 1)
flag = 0;
else
flag = 1;
}
else
{
for (int j = 1; j <= m; j++)
{
cout << "0 ";
}
cout << endl;
}
}
cout << "1 ";
for (int i = 1; i <= m - 1;i++)
{
cout << "0 ";
}
cout << endl;
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3428kb
input:
2 1
output:
1 1
result:
wrong output format Unexpected end of file - int32 expected