QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#204360#6743. water235kiwiHM#WA 3ms27088kbC++20785b2023-10-07 10:29:452023-10-07 10:29:46

Judging History

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

  • [2023-10-07 10:29:46]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:27088kb
  • [2023-10-07 10:29:45]
  • 提交

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;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cout << a[i][j] << (j == m ? '\n' : ' ');
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 27088kb

input:

2 1

output:

1
1

result:

wrong output format Unexpected end of file - int32 expected