QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#633141 | #9415. Matrix | retired_midlights | WA | 0ms | 3844kb | C++14 | 811b | 2024-10-12 14:37:51 | 2024-10-12 14:37:56 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (int)a; i <= (int)b; i ++)
#define per(i, a, b) for(int i = (int)a; i >= (int)b; i --)
#define ll long long
using namespace std;
void solve() {
int n;
cin >> n;
vector < vector < int > > a(n + 5, vector < int > (n + 5));
rep(i, 1, n - 2) rep(j, 1, n) a[i][j] = i;
rep(i, 1, n - 2) a[n - 1][i] = a[n][i] = i + n - 2;
a[n - 1][n - 1] = 2 * n - 3;
a[n - 1][n] = 2 * n - 2;
a[n][n - 1] = 2 * n - 1;
a[n][n] = 2 * n;
rep(i, 1, n) rep(j, 1, n) cout << a[i][j] << " \n"[j == n];
}
int main() {
// #define LOCAL
#ifdef LOCAL
freopen("data.in", "r", stdin);
#endif
ios :: sync_with_stdio(false);
cin.tie(0);
int T = 1;
// cin >> T;
while(T --) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3844kb
input:
2
output:
1 2 3 4
result:
wrong answer Line [name=yesno] equals to "1 2", doesn't correspond to pattern "Yes|No" (test case 1)