QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#353869 | #6189. Full Clue Problem | matongc233 | WA | 0ms | 3780kb | C++17 | 1.6kb | 2024-03-14 18:19:19 | 2024-03-14 18:19:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 22;
typedef long long ll;
typedef pair<int, int> PII;
int g[N][N];
int main()
{
int n;
cin >> n;
int k = 4 * n / (3 +2* (n - 2));
for (int i = 0; i < n;i++){
for (int j = 0; j < n;j++){
if(abs(i-j)<=1){
g[i][j] = k;
}
}
}
g[0][0]++;
g[n - 1][n - 1]++;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if(j!=n-1)printf("%d ", g[i][j]);
else
printf("%d", g[i][j]);
}
puts("");
}
puts("");
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if(i-j==1||i-j==0){
if (j != n - 1)
printf("%d ", 1);
else
printf("%d", 1);
}
else{
if (j != n - 1)
printf("%d ", 0);
else
printf("%d", 0);
}
}
puts("");
}
puts("");
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (j-i == 1 || i - j == 0)
{
if (j != n - 1)
printf("%d ", 1);
else
printf("%d", 1);
}
else
{
if (j != n - 1)
printf("%d ", 0);
else
printf("%d", 0);
}
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3780kb
input:
5
output:
3 2 0 0 0 2 2 2 0 0 0 2 2 2 0 0 0 2 2 2 0 0 0 2 3 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1
result:
wrong answer (2, 0) doesn't satisfy with clues