QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#347870 | #6743. water235 | wtz2333 | WA | 0ms | 3636kb | C++14 | 1.4kb | 2024-03-09 15:57:49 | 2024-03-09 15:57:50 |
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;
int flag = 0;
if(n > m) swap(n,m),flag = 1;
int cnt = 0;
if(n == 1) {
for(int j = 0;j < m;j ++) {
if(j % 2 == 0) cnt ++,f[0][j] = 1;
else if(j % 2 == 1 && j == m - 1) cnt ++,f[0][j] = 1;
}
}
else {
for(int i = 0;i < n;i ++) {
for(int j = 0;j < n;j ++) {
if(i == j){
f[i][j] = 1;
cnt ++;
}
}
}
for(int i = n + 1;i < m;i += 2) {
cnt ++;
f[0][i] = 1;
}
if(f[0][m - 1] == 0){
cnt ++;
f[0][m - 1] = 1;
}
}
cout << cnt << endl;
if(flag == 0) {
for(int i = 0;i < n;i ++) {
for(int j = 0;j < m;j ++) {
cout << f[i][j] << " ";
}cout << "\n";
}
}else {
for(int i = 0;i < m;i ++) {
for(int j = 0;j < n;j ++) {
cout << f[j][i] << " ";
}cout << "\n";
}
}
// }
}
// 1 0 0 1 0 0
// 0 1 0 0 1 0
// 0 0 0 0 0 0
// 1 0 0 1 0 0
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
3 3
output:
4 1 0 1 0 1 0 0 0 1
result:
wrong answer The answer is wrong: expected = 3, found = 4