QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#618398#9415. MatrixsyssWA 0ms3648kbC++20679b2024-10-06 21:47:232024-10-06 21:47:24

Judging History

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

  • [2024-10-06 21:47:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-10-06 21:47:23]
  • 提交

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];
        }
    }
    g[1][1] = 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: 3648kb

input:

2

output:

Yes
1 2 
3 4 


result:

ok Correct. (1 test case)

Test #2:

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

input:

3

output:

Yes
1 2 3 
4 6 4 
5 5 5 


result:

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