QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#618414 | #9415. Matrix | syss | WA | 0ms | 3552kb | C++20 | 706b | 2024-10-06 21:54:17 | 2024-10-06 21:54:18 |
Judging History
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';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
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 6 5 5 5
result:
wrong answer The number of quadruples 2 is invalid. (test case 1)