QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#446434 | #8474. Matrices and Sums | 5ab | WA | 0ms | 3700kb | C++20 | 787b | 2024-06-17 10:26:29 | 2024-06-17 10:26:30 |
Judging History
answer
/* name: H
* author: 5ab
* created at: 2024-06-17
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ssz(x) (int((x).size()))
auto chmax = [](auto& x, auto y) { if (x < y) x = y; };
auto chmin = [](auto& x, auto y) { if (y < x) x = y; };
using ll = long long;
const int s[2][2] = { {-1, 1}, { 0, 1 } };
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
if (n & 1)
{
cout << "-1\n";
return 0;
}
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{
if (i / 2 == j / 2)
cout << s[i % 2][j % 2];
else
cout << (max(i, j) & 1 ? 1 : -1);
cout << " \n"[j == n - 1];
}
return 0;
}
// started coding at: 06-17 10:22:53
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3700kb
input:
2
output:
-1 1 0 1
result:
wrong answer Line "-1 1" doesn't correspond to pattern "No|Yes"