QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#671800 | #9415. Matrix | REN_REN# | WA | 0ms | 3532kb | C++20 | 951b | 2024-10-24 14:31:36 | 2024-10-24 14:31:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
using i128 = __int128;
int n, k;
const int N = 1000;
void solve(){
cin >> n;
vector ans(n + 1, vector<int>(n + 1));
ans[1][1] = 1, ans[1][2] = 2;
ans[2][1] = 3, ans[2][2] = 4;
int nex = 5;
for(int i = 3; i <= n; i += 2) {
ans[1][i] = nex ++;
}
for(int i = 4; i <= n; i += 2) {
ans[2][i] = nex ++;
}
for(int i = 3; i <= n; i ++) {
for(int j = 1; j <= n; j ++) {
ans[i][j] = nex;
}
nex ++;
}
for(int i = 1; i <= n; i ++) {
for(int j = 1; j <= n; j ++) {
if(ans[i][j]) cout << ans[i][j] << ' ';
else cout << 1 << ' ';
}
cout << '\n';
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t = 1;
// cin >> t;
while(t --){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3532kb
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)