QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#446434#8474. Matrices and Sums5abWA 0ms3700kbC++20787b2024-06-17 10:26:292024-06-17 10:26:30

Judging History

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

  • [2024-06-17 10:26:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3700kb
  • [2024-06-17 10:26:29]
  • 提交

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"