QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#272207#6743. water235mobbb#WA 0ms3816kbC++17673b2023-12-02 16:28:092023-12-02 16:28:09

Judging History

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

  • [2023-12-02 16:28:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3816kb
  • [2023-12-02 16:28:09]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define ll long long

int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n,m;cin >> n >> m;
	vector<vector<int>> vis(n + 5,vector<int>(m + 5));
	auto r = vis;
	int cnt = 0;
	for (int i = 1;i <= n;i+=2){
		if (!r[i][1])
			cnt++;
		r[i][1] = 1;
	}
	if (n % 2 == 0) r[n][1] = 1,cnt++;
	for (int i = 1;i <= m;i+=2){
		if (!r[1][i])
			cnt++;
		r[1][i] = 1;
	}
	if (m % 2 == 0) r[1][m] = 1,cnt++;
	cout << cnt << endl;
	for (int i = 1;i <= n;i++){
		for (int j = 1;j <= m;j++)
			cout << r[i][j] << " \n"[j == m];
	}

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3504kb

input:

2 1

output:

2
1
1

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3816kb

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: 0ms
memory: 3588kb

input:

1 4

output:

3
1 0 1 1

result:

ok The answer is correct.

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3624kb

input:

2 2

output:

3
1 1
1 0

result:

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