QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#601735#5275. Joking?ship2077#WA 0ms3960kbC++23441b2024-09-30 11:41:512024-09-30 11:41:52

Judging History

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

  • [2024-09-30 11:41:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3960kb
  • [2024-09-30 11:41:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,num,p[6],ans[6][255];
int main(){
    scanf("%d",&n);
    iota(p+1,p+n+1,1);
    while (1){ ++num;
        for (int i=1;i<=n;i++)
            ans[i][num]=num*n-n+p[i];
        if (!next_permutation(p+1,p+n+1)) break;
    }
    printf("%d\n",num);
    for (int i=1;i<=n;i++)
        for (int j=1;j<=num;j++)
            printf("%d%c",ans[i][j]," \n"[j==num]);
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3960kb

input:

2

output:

2
1 4
2 3

result:

ok n = 2, max_relative_diff = 0.000%

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3872kb

input:

3

output:

6
1 4 8 11 15 18
2 6 7 12 13 17
3 5 9 10 14 16

result:

wrong answer n = 3, max_relative_diff = 33.333%