QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#204368#6743. water235kiwiHM#WA 3ms27116kbC++20813b2023-10-07 10:37:232023-10-07 10:37:24

Judging History

你现在查看的是最新测评结果

  • [2023-10-07 10:37:24]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:27116kb
  • [2023-10-07 10:37:23]
  • 提交

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