QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#94755 | #6189. Full Clue Problem | team404# | WA | 2ms | 3384kb | C++14 | 2.7kb | 2023-04-07 17:49:38 | 2023-04-07 17:49:39 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[2][25][25];
int b[25][25];
int f[2][20];
signed main()
{
int n;
cin >> n;
for (int i = 0; i <= n + 1; i++)
{
for (int j = 0; j <= n + 1; j++)
{
a[0][i][j] = a[1][i][j] = 0;
}
}
int m = n - 1;
int k1, k2;
if(n == 2){
cout << "2 3\n3 2\n\n";
cout << "1 1\n1 0\n\n";
cout << "0 1\n1 1\n";
return 0;
}
if(m%2 == 1){
cout << m << endl;
for (int i = 1; i <= (m + 1) / 2; i++)
f[0][i] = 3;
f[0][1] = 2;
for (int i = 1; i <= (m + 1) / 2;i++)
f[1][i] = 3;
f[1][(m + 1) / 2] = 2;
k1 = (m + 1) / 2;
k2 = (m + 1) / 2;
}
else{
for (int i = 1; i <= m / 2 + 1; i++)
f[0][i] = 3;
f[0][1] = 2;
f[0][m / 2 + 1] = 2;
for (int i = 1; i <= m / 2; i++)
f[1][i] = 3;
k1 = m / 2 + 1;
k2 = m / 2;
}
int now = 1;
for (int i = 1; i <= k1; i++){
for (int j = 0; j < f[0][i]; j++){
for (int k = 0; k < f[0][i]; k++){
a[0][now + j][now + k] = 1;
}
}
now += f[0][i] - 1;
}
if(f[0][1] == 3)
a[0][1][1] = 0;
if(f[0][k1] == 3)
a[0][n][n] = 0;
now = 1;
for (int i = 1; i <= k2; i++)
{
for (int j = 0; j < f[1][i]; j++)
{
for (int k = 0; k < f[1][i]; k++)
{
a[1][now + j][now + k] = 1;
}
}
now += f[1][i] - 1;
}
if (f[1][1] == 3)
a[1][1][1] = 0;
if (f[1][k2] == 3)
a[1][n][n] = 0;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
f[i][j] = 0;
if (a[0][i][j] != a[0][i - 1][j])
f[i][j]++;
if (a[0][i][j] != a[0][i + 1][j])
f[i][j]++;
if (a[0][i][j] != a[0][i][j - 1])
f[i][j]++;
if (a[0][i][j] != a[0][i][j + 1])
f[i][j]++;
}
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
cout << f[i][j] << ' ';
}
cout << endl;
}
cout << endl;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
cout << a[0][i][j] << ' ';
}
cout << endl;
}
cout << endl;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
cout << a[1][i][j] << ' ';
}
cout << endl;
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3384kb
input:
5
output:
2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 1 1 0
result:
wrong answer (1, 0) doesn't satisfy with clues