QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#204368 | #6743. water235 | kiwiHM# | WA | 3ms | 27116kb | C++20 | 813b | 2023-10-07 10:37:23 | 2023-10-07 10:37:24 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
vector <int> a[1000500];
int n, m;
int main(){
cin >> n >> m;
for (int i = 1; i <= n; i++)
a[i].resize(m + 2);
if (n == m){
for (int i = 1; i <= n; i++)
a[i][i] = 1;
cout << n << endl;
} else if (n < m){
for (int i = 1; i <= n; i++)
a[i][i] = 1;
for (int i = n + 1; i <= m; i++)
a[n][i] = 1;
cout << m << endl;
} else if (n > m){
for (int i = 1; i <= m; i++)
a[i][i] = 1;
for (int i = m + 1; i <= n; i++)
a[i][m] = 1;
cout << n << endl;
}
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cout << a[i][j] << (j == m ? '\n' : ' ');
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 27032kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 3ms
memory: 27036kb
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: 27116kb
input:
1 4
output:
4 1 1 1 1
result:
wrong answer The answer is wrong: expected = 3, found = 4