QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#129269 | #6743. water235 | SolitaryDream# | WA | 1ms | 3876kb | C++20 | 614b | 2023-07-22 13:19:57 | 2023-07-22 13:19:59 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
scanf("%d%d", &n, &m);
int ans = 0;
for (int i = 0; i < n; ++i) {
if (i == n - 1 || i % 2 == 0) ++ans;
}
for (int i = 1; i < m; ++i) {
if (i == m - 1 || i % 2 == 0) ++ans;
}
printf("%d\n", ans);
for (int i = 0; i < n; puts(""), ++i)
for (int j = 0; j < m; ++j) {
if (j == 0 && (i == n - 1 || i % 2 == 0)) printf("%d ", 1);
else if (i == 0 && (j == m - 1 || j % 2 == 0)) printf("%d ", 1);
else printf("0 ");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3744kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 1ms
memory: 3616kb
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: 3696kb
input:
1 4
output:
3 1 0 1 1
result:
ok The answer is correct.
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3876kb
input:
2 2
output:
3 1 1 1 0
result:
wrong answer The answer is wrong: expected = 2, found = 3