QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#399189#5533. Tricksichengzhou0 8ms3956kbC++142.2kb2024-04-26 01:26:152024-04-26 01:26:15

Judging History

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

  • [2024-04-26 01:26:15]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:3956kb
  • [2024-04-26 01:26:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=20;
int n,a[N],b[N];
int main()
{
    int T,R;
    scanf("%d%d",&T,&R);
    if(R==1||R==2)
    {
        while(T--)
        {
            scanf("%d",&n);int s=0;
            for(int i=1;i<=n;i++)
            {
                scanf("%d",&a[i]);
                s+=a[i];
                s%=(2*n+1);
            }
            for(int i=0;i<=2*n;i++)
            {
                b[i]=0;
            }
            for(int i=1;i<=n;i++)
            {
                if(b[(s+a[i])%(2*n+1)]==0)
                {
                    b[(s+a[i])%(2*n+1)]=a[i];
                }
            }
            for(int i=1;i<=n;i++)
            {
                if(b[3*a[i]%(2*n+1)])
                {
                    printf("%d %d\n",a[i],b[3*a[i]%(2*n+1)]);
                    break;
                }
            }
        }
    }else{
        int x,y,z,w;
        while(T--)
        {
            scanf("%d%d%d%d%d",&n,&x,&y,&z,&w);
            printf("%d\n",(2*n+1-(3*x-y+3*z-w))%(2*n+1));
        }
    }
    for(int i=0;i<(1<<13);i++)
    {
        int cnt=0,s=0;
        for(int j=0;j<13;j++)
        {
            if(i>>j&1)
            {
                cnt++;
                s+=j;s%=13;
            }else{
                ;
            }
        }
        if(cnt==6)
        {
            bool fl=1;
            for(int j=0;j<13;j++)
            {
                if((i>>j&1)==0)
                {
                    continue;
                }
                for(int k=0;k<13;k++)
                {
                    if(!(i>>k&1))
                    {
                        continue;
                    }
                    if((3*j-k+13)%13==s)
                    {
                        fl=0;break;
                    }
                }
                if(fl==0)break;
            }
            if(fl==0)
            {
                continue;
            }
            for(int j=0;j<13;j++)
            {
                if(i>>j&1)
                {
                    cout<<j<<' ';
                }
            }
            cout<<endl;
            return 0;
        }
    }
    return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 6ms = 0ms + 6ms
memory: 0kb,3956kb

input:

12012
1
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 5
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 4 6
6
0 1 2 3 5 6
6
0 1 2 3 5 6
6
0 1 2 3 5 6
6
0 1 2 3 5 6
6
0 1 2 3 5 6
6
0 1 2 3 5 6
6
0 1 2 3 5 ...

output:

1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
3 3
3 3
3 3
3 3
3 3
3 3
3 3
0 6
0 6
0 6
0 6
0 6
0 6
0 6
3 1
3 1
3 1
3 1
3 1
3 1
3 1
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
0 7
0 7
0 7
0 7
0 7
0 7
0 7
4 5
4 5
4 5
4 5
4 5
...

input:

12012
2
6
7 8 9 10 11 12
6
6 8 9 10 11 12
6
6 7 9 10 11 12
6
6 7 8 10 11 12
6
6 7 8 9 11 12
6
6 7 8 9 10 12
6
6 7 8 9 10 11
6
7 8 9 10 11 12
6
5 8 9 10 11 12
6
5 7 9 10 11 12
6
5 7 8 10 11 12
6
5 7 8 9 11 12
6
5 7 8 9 10 12
6
5 7 8 9 10 11
6
7 8 9 10 11 12
6
4 8 9 10 11 12
6
4 7 9 10 11 12
6
4 7 8 1...

output:

9 9
9 10
9 11
7 6
7 7
7 8
6 6
9 9
5 12
9 12
7 7
7 8
7 9
7 10
9 9
4 10
4 11
4 12
7 9
7 10
7 11
9 9
3 8
3 9
3 10
3 11
3 12
10 8
9 9
8 11
2 7
2 8
2 9
2 10
2 11
9 9
8 12
7 10
7 11
1 7
1 8
1 9
9 9
11 9
7 11
7 12
11 12
9 7
0 7
9 10
5 12
11 6
6 5
6 6
10 6
5 5
9 10
4 10
4 12
6 6
11 9
6 8
6 9
9 10
3 8
3 10
3...

input:

12012
3
6
1 1 9 9
6
1 1 9 10
6
1 1 9 11
6
1 1 7 6
6
1 1 7 7
6
1 1 7 8
6
1 1 6 6
6
2 3 9 9
6
2 3 5 12
6
2 3 9 12
6
2 3 7 7
6
2 3 7 8
6
2 3 7 9
6
2 3 7 10
6
2 2 9 9
6
2 2 4 10
6
2 2 4 11
6
2 2 4 12
6
2 2 7 9
6
2 2 7 10
6
2 2 7 11
6
2 1 9 9
6
2 1 3 8
6
2 1 3 9
6
2 1 3 10
6
2 1 3 11
6
2 1 3 12
6
2 1 10 ...

output:

-7
-6
-5
-4
-3
-2
-1
-8
7
-5
-4
-3
-2
-1
-9
7
8
9
-3
-2
-1
-10
7
8
9
10
11
-1
-11
-6
8
9
10
11
12
1
7
8
9
10
11
12
0
-6
-5
-4
-3
-2
12
-8
6
-5
-4
-3
-2
-1
-9
6
8
-4
-3
-2
-1
3
6
8
9
10
11
12
-11
-7
-5
-4
-3
-2
-1
1
6
8
-4
10
11
12
0
-7
8
9
10
11
12
4
5
-5
9
10
-2
12
3
5
8
9
-3
-2
12
2
-8
8
9
10
11
-...

result:

wrong answer the card you returned is -7, but expected 6 (test case 1)

Subtask #2:

score: 0
Skipped

Subtask #3:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 8ms = 0ms + 8ms
memory: 0kb,3920kb

input:

6525
1
6
10 1 11 3 12 6
6
1 7 10 12 5 6
6
0 10 12 7 9 8
6
12 1 8 4 7 11
6
11 8 9 4 10 6
6
0 7 2 3 4 5
6
0 8 3 10 11 6
6
0 1 2 4 7 6
6
0 1 11 9 5 6
6
7 1 12 8 6 5
7
0 1 13 10 12 5 6
7
0 14 2 3 4 12 6
7
11 1 3 8 12 6 13
7
0 1 2 3 13 5 14
7
11 9 10 8 4 14 7
7
0 8 14 3 4 13 11
7
0 10 2 14 8 5 6
7
0 13 2...

output:

1 12
1 1
10 10
1 12
11 11
0 5
3 10
0 6
11 1
7 8
0 13
0 4
12 12
2 13
9 9
14 4
2 6
0 13
1 2
1 14
13 8
16 12
4 14
0 12
0 2
8 3
1 3
11 16
12 12
2 9
2 2
1 4
17 3
9 17
5 5
9 6
15 17
0 2
2 10
0 12
12 3
0 3
14 1
2 7
15 5
0 16
1 2
1 12
5 6
16 6
3 21
0 2
18 2
12 7
0 4
0 14
20 3
12 8
14 22
20 11
20 5
0 15
17 2...

input:

6525
2
6
0 2 4 5 8 9
6
2 3 4 8 9 11
6
1 2 3 4 5 11
6
0 3 5 6 9 10
6
0 1 3 5 7 12
6
1 6 8 10 11 12
6
2 4 5 7 9 12
6
5 8 9 10 11 12
6
3 4 7 8 10 12
6
0 2 3 4 9 11
7
2 3 4 7 8 9 11
7
1 5 7 8 9 10 13
7
0 4 5 7 9 10 14
7
4 6 7 8 9 10 11
7
0 1 2 3 5 6 13
7
1 2 5 7 9 10 12
7
1 3 4 9 11 12 13
7
1 3 4 6 10 1...

output:

2 4
2 8
1 3
0 6
1 1
10 8
4 12
5 12
3 4
2 3
2 7
1 10
6 8
1 3
1 2
3 1
3 4
8 10
3 13
0 4
0 10
6 15
5 11
5 12
7 7
2 13
2 2
2 16
4 10
0 1
7 7
1 4
0 2
2 3
0 18
2 16
8 8
3 13
5 13
0 16
5 7
0 10
1 17
0 10
3 2
8 18
6 19
3 11
1 20
1 2
5 6
1 13
4 21
1 1
5 5
6 19
14 2
0 9
0 18
1 11
7 18
1 10
2 6
0 2
3 2
5 9
0 9...

input:

6525
3
6
1 12 2 4
6
1 1 2 8
6
10 10 1 3
6
1 12 0 6
6
11 11 1 1
6
0 5 10 8
6
3 10 4 12
6
0 6 5 12
6
11 1 3 4
6
7 8 2 3
7
0 13 2 7
7
0 4 1 10
7
12 12 6 8
7
2 13 1 3
7
9 9 1 2
7
14 4 3 1
7
2 6 3 4
7
0 13 8 10
7
1 2 3 13
7
1 14 0 4
8
13 8 0 10
8
16 12 6 15
8
4 14 5 11
8
0 12 5 12
8
0 2 7 7
8
8 3 2 13
8
...

output:

7
0
-7
2
-11
-4
1
3
-11
-3
14
11
-4
7
-4
-1
10
14
3
0
-4
-5
15
9
5
3
13
10
-9
4
1
2
-8
6
8
8
-6
6
2
9
-20
13
-6
11
-5
10
0
11
8
-1
3
12
-20
-8
17
15
-5
4
21
-18
-12
22
-7
-17
-11
11
9
2
22
18
10
14
7
-6
22
1
-15
14
-18
8
-14
16
3
-2
11
10
4
-5
-3
3
4
20
2
1
-2
-2
-3
3
16
-3
15
18
11
10
9
10
22
-12
2...

result:

wrong answer the card you returned is -7, but expected 6 (test case 3)

Subtask #4:

score: 0
Skipped