QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#618407#9415. MatrixsyssWA 0ms3612kbC++20725b2024-10-06 21:49:552024-10-06 21:49:56

Judging History

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

  • [2024-10-06 21:49:56]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-10-06 21:49:55]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    cout << "Yes\n";
    vector g(n, vector<int>(n));
    for (int i = 0; i < n; i++) {
        g[0][i] = i + 1;
    }
    for (int i = 1; i < n; i++) {
        g[i][0] = i + n;
    }
    for (int i = 1; i < n; i++) {
        for (int j = 1; j < n; j++) {
            g[i][j] = g[i][0];
        }
    }
    for (int i = 1; i < n; i++) {
        g[1][i] = 2 * n;
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << g[i][j] << ' ';
        }
        cout << '\n';
    }
    cout << '\n';

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

2

output:

Yes
1 2 
3 4 


result:

ok Correct. (1 test case)

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3504kb

input:

3

output:

Yes
1 2 3 
4 6 6 
5 5 5 


result:

wrong answer The number of quadruples 2 is invalid. (test case 1)