QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#347777 | #6743. water235 | wtz2333 | WA | 1ms | 3656kb | C++14 | 1.2kb | 2024-03-09 15:22:44 | 2024-03-09 15:22:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mo = 998244353;
const int P = 1e9 + 7;
const int maxn = 2010;
int f[maxn][maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n,m;
cin >> n >> m;
if(n == 2 && m == 2) {
cout << 2 << "\n";
cout << "1 0\n0 1\n";
return 0;
}
int cnt = 0;
int nn,mm;
if(n % 2 == 0) nn = n - 1;
else nn = n;
if(m % 2 == 0) mm = m - 1;
else mm = m;
for(int i = 0;i < nn;i ++) {
for(int j = 0;j < mm;j ++) {
if(i % 3 == 0) {
if(j % 2 == 0){
cnt ++;
f[i][j] = 1;
}
}else if(i % 3 == 2) {
if(j % 2 == 1) {
cnt ++;
f[i][j] = 1;
}
}
}
}
if(n % 2 == 0) {
f[n - 1][0] = 1;
cnt ++;
}
if(m % 2 == 0){
f[0][m - 1] = 1;
cnt ++;
}
cout << cnt << endl;
for(int i = 0;i < n;i ++) {
for(int j = 0;j < m;j ++) {
cout << f[i][j] << " ";
}cout << "\n";
}
// }
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3656kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
3 3
output:
3 1 0 1 0 0 0 0 1 0
result:
ok The answer is correct.
Test #3:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
1 4
output:
3 1 0 1 1
result:
ok The answer is correct.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
2 2
output:
2 1 0 0 1
result:
ok The answer is correct.
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
2 4
output:
4 1 0 1 1 1 0 0 0
result:
wrong answer The answer is wrong: expected = 3, found = 4