QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#369509#6743. water235xjxWA 0ms3556kbC++11553b2024-03-28 13:08:412024-03-28 13:08:41

Judging History

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

  • [2024-03-28 13:08:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3556kb
  • [2024-03-28 13:08:41]
  • 提交

answer

#include<iostream>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	if (n % 2 ^ 1 && m % 2 ^ 1) {
		cout << (n +m) / 2+1 << endl;
		for (int i = 1;i <= n;i++, cout << endl)
			for (int j = 1;j <= m;j++)
				cout << (i & 1 ^ 1 && j == 1 || i == 1 && j & 1 ^ 1) << " ";
	}
	else {
		cout << n / 2  + m / 2 << endl;
		for (int i = 1;i <= n;i++, cout << endl)
			for (int j = 1;j <= m;j++)
				cout << (i & 1 && j == 1 || i == 1 && j & 1 || i == n&&j==1||i==1&&j==m) << " ";
	}
	//101 01  1011
	//0   10  0
	//1       1

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 1

output:

1
1 
1 

result:

wrong answer The answer is wrong: expected = 2, found = 1