QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#369502#6743. water235xjxWA 1ms3688kbC++11433b2024-03-28 12:47:252024-03-28 12:47:26

Judging History

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

  • [2024-03-28 12:47:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3688kb
  • [2024-03-28 12:47:25]
  • 提交

answer

#include<iostream>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	long long s = 0;
	for (int i = 1;i <= n;i++)
		for (int j = 1;j <= m;j++)
			s+=(i & 1 && j == 1 || i == 1 && j & 1 || i == n && j == 1 || j == m && i == 1);
	cout << s << 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 || j == m && i == 1) << " ";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3688kb

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

3 3

output:

3
1 0 1 
0 0 0 
1 0 0 

result:

ok The answer is correct.

Test #3:

score: 0
Accepted
time: 1ms
memory: 3596kb

input:

1 4

output:

3
1 0 1 1 

result:

ok The answer is correct.

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3664kb

input:

2 2

output:

3
1 1 
1 0 

result:

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