QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#353869#6189. Full Clue Problemmatongc233WA 0ms3780kbC++171.6kb2024-03-14 18:19:192024-03-14 18:19:20

Judging History

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

  • [2024-03-14 18:19:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3780kb
  • [2024-03-14 18:19:19]
  • 提交

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;
}

詳細信息

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