QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#141485#6189. Full Clue Problemrain_sboxWA 1ms3376kbC++141.5kb2023-08-17 15:02:132023-08-17 15:02:15

Judging History

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

  • [2023-08-17 15:02:15]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3376kb
  • [2023-08-17 15:02:13]
  • 提交

answer

/*
Problem: F. Full Clue Problem
Contest: qoj
URL: https://qoj.ac/contest/1195/problem/6189
===================
Memory Limit: 1024.0MB
TimeLimit: 1.0s
*/
#include <iostream>

const int MAXN = 29;
using namespace std;

int hsh[MAXN][MAXN], N;
bool ans1[MAXN][MAXN], ans2[MAXN][MAXN];

int main () {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cerr.tie(0);
	cin >> N;
	if (N == 2) {
		cout << "23\n32\n\n11\n10\n\n01\n11\n";
		return 0;
	}
	if (N == 3) {
		cout << "222\n202\n222\n\n110\n111\n011\n\n011\n111\n110\n";
		return 0;
	}
	for (int i = N-2; i < N+1; i++)
		for (int m = 1; m < 4; m++) hsh[i][m] = 2;
	hsh[N-2][2] = hsh[N][2] = 3;
	for (int i = 1; i < 4; i++) hsh[N-3][i]++;
	for (int i = N-2; i < N+1; i++) hsh[i][4]++;
	for (int i = 1; i < N+1; i++) hsh[1][i]++;
	for (int i = 2; i < N+1; i++) hsh[i][N]++;
	for (int i = 2; i < N-3; i++) hsh[i][1]++, hsh[N][N-i+1]++;
	hsh[1][1] = hsh[1][N] = hsh[N][N] = hsh[N][4] = 2;
	
	for (int i = 1; i < N+1; i++) {
		for (int m = 1; m < N+1; m++) cout << hsh[i][m] << ' ', ans1[i][m] = ans2[i][m] = 1;
		cout << '\n';
	}
	ans1[N][1] = ans1[N][3] = ans1[N-1][3] = ans1[N-2][3] = ans1[N-2][2] = 0;
	ans2[N][3] = ans2[N-1][3] = ans2[N-1][2] = ans2[N-2][2] = 0;
	
	cout << '\n';
	for (int i = 1; i < N+1; i++) {
		for (int m = 1; m < N+1; m++) cout << ans1[i][m] << ' ';
		cout << '\n';
	}
	cout << '\n';
	for (int i = 1; i < N+1; i++) {
		for (int m = 1; m < N+1; m++) cout << ans2[i][m] << ' ';
		cout << '\n';
	}
	
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3376kb

input:

5

output:

2 1 1 1 2 
1 1 1 0 1 
2 3 2 1 1 
2 2 2 1 1 
2 3 2 2 2 

1 1 1 1 1 
1 1 1 1 1 
1 0 0 1 1 
1 1 0 1 1 
0 1 0 1 1 

1 1 1 1 1 
1 1 1 1 1 
1 0 1 1 1 
1 0 0 1 1 
1 1 0 1 1 

result:

wrong answer (1, 2) doesn't satisfy with clues