QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#218509 | #6743. water235 | retr0 | WA | 0ms | 3824kb | C++14 | 617b | 2023-10-18 14:18:04 | 2023-10-18 14:18:04 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m; cin >> n >> m;
vector<vector<int>> a(n, vector<int>(m));
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
if(i == j) a[i][j] = 1;
}
}
if(n != m) {
if(n > m) {
a[n - 1][0] = 1;
}
if(n < m) {
a[0][m - 1] = 1;
}
}
cout << max(n, m) << '\n';
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
cout << a[i][j] << " ";
}
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3596kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
3 3
output:
3 1 0 0 0 1 0 0 0 1
result:
ok The answer is correct.
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
1 4
output:
4 1 0 0 1
result:
wrong answer The answer is wrong: expected = 3, found = 4