QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#485834 | #6743. water235 | duckindog | WA | 0ms | 3780kb | C++23 | 601b | 2024-07-21 10:16:52 | 2024-07-21 10:16:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
int n, m; cin >> n >> m;
vector<vector<int>> a(n + 1, vector<int>(m + 1));
for (int i = 5; i <= n; i += 2) a[i][m] = 1;
if (n >= 3) a[3][1] = 1;
if (!(n & 1)) a[n][m] = 1;
for (int j = 1; j <= m; j += 2) a[1][j] = 1;
int answer = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) answer += a[i][j];
}
cout << answer << "\n";
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) cout << a[i][j] << " \n"[j == m];
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3728kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
3 3
output:
3 1 0 1 0 0 0 1 0 0
result:
ok The answer is correct.
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3780kb
input:
1 4
output:
2 1 0 1 0
result:
wrong answer The answer is wrong: expected = 3, found = 2