QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#375818 | #5533. Trick | sichengzhou# | 0 | 5ms | 3960kb | C++14 | 864b | 2024-04-03 16:11:03 | 2024-07-04 03:33:29 |
answer
#include<bits/stdc++.h>
using namespace std;
const int N=10;
int n,R,a[N];
int main()
{
int T;
scanf("%d%d",&T,&R);
while(T--)
{
scanf("%d",&n);
if(R<=2)
{
int x=0;
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);x+=a[i];x%=(2*n+1);
}
bool fl=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
if(i!=j&&(a[i]-a[j]+2*n+1)%(2*n+1)==x)
{
printf("%d %d\n",a[i],a[j]);
fl=0;break;
}
}
if(fl==0)break;
}
}else{
for(int i=1;i<=4;i++)
{
scanf("%d",&a[i]);
}
printf("%d\n",((-(a[1]-a[2]+a[3]-a[4]))%(2*n+1)+2*n+1)%(2*n+1));
}
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 5ms = 0ms + 5ms
memory: 0kb,3916kb
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:
2 0 2 0 2 0 2 0 2 0 2 0 2 0 3 0 3 0 3 0 3 0 3 0 3 0 3 0 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 0 5 0 5 0 5 0 5 0 5 0 5 0 6 0 6 0 6 0 6 0 6 0 6 0 6 0 0 6 0 6 0 6 0 6 0 6 0 6 0 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 4 0 4 0 4 0 4 0 4 0 4 0 4 0 5 0 5 0 5 0 5 0 5 0 5 0 5 0 0 7 0 7 0 7 0 7 0 7 0 7 0 7 1 7 1 7 1 7 1 7 1 7 ...
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:
12 7 10 6 9 6 8 6 7 6 6 7 12 7 8 5 7 5 8 7 7 8 5 7 12 7 10 8 10 9 7 8 7 9 4 7 12 7 9 8 7 8 7 9 7 10 3 7 12 7 9 10 8 10 8 11 8 12 2 7 12 7 8 9 7 9 7 10 7 11 7 12 1 7 12 7 8 10 7 10 7 11 7 12 7 0 0 7 10 6 8 5 6 5 5 6 6 8 5 8 10 6 10 8 10 11 4 6 6 9 4 8 10 6 9 8 9 10 6 8 3 6 6 10 3 8 10 6 9 11 8 11 2 6...
input:
12012 3 6 2 0 12 7 6 2 0 10 6 6 2 0 9 6 6 2 0 8 6 6 2 0 7 6 6 2 0 6 7 6 2 0 12 7 6 3 0 8 5 6 3 0 7 5 6 3 0 8 7 6 3 0 7 8 6 3 0 5 7 6 3 0 12 7 6 3 0 10 8 6 5 1 10 9 6 5 1 7 8 6 5 1 7 9 6 5 1 4 7 6 5 1 12 7 6 5 1 9 8 6 5 1 7 8 6 5 0 7 9 6 5 0 7 10 6 5 0 3 7 6 5 0 12 7 6 5 0 9 10 6 5 0 8 10 6 5 0 8 11 ...
output:
6 7 8 9 10 12 6 7 8 9 11 12 5 8 8 10 11 12 4 8 10 10 11 12 3 9 10 11 11 12 2 8 9 10 11 11 12 1 8 9 10 11 11 12 1 2 4 6 7 12 5 7 10 11 12 0 4 7 9 10 11 12 0 3 9 10 11 12 0 3 7 9 10 11 12 0 2 7 9 10 11 12 0 2 2 5 6 7 8 9 1 6 9 10 11 12 0 4 9 10 12 0 3 7 10 10 11 12 0 2 7 10 10 11 12 0 2 3 7 7 8 9 10 1...
result:
wrong answer the card you returned is 12, but expected 11 (test case 6)
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 3ms = 0ms + 3ms
memory: 0kb,3960kb
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:
10 6 1 12 7 0 12 8 4 8 0 5 10 11 0 6 11 5 0 13 0 4 12 3 13 5 11 8 8 0 0 13 2 1 5 1 10 13 1 16 1 3 0 12 0 2 8 4 15 8 9 12 12 8 10 11 17 7 17 7 18 8 9 7 15 6 0 2 12 16 0 12 2 11 2 4 16 37 5 1 13 0 2 0 32 6 9 2 23 40 13 11 2 3 0 36 13 4 0 21 28 20 1 15 3 6 0 0 31 2 41 21 6 2 2 33 2 11 20 4 8 3 2 2 23 6...
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 0 2 4 0 6 1 12 6 10 8 5 4 12 3 0 2 3 1 8 4 0 4 9 2 1 4 11 4 14 4 5 3 7 0 4 0 10 5 2 1 14 4 1 7 10 4 11 1 14 7 0 5 3 0 1 2 7 4 5 0 2 1 17 0 18 2 12 8 11 1 5 6 4 0 16 2 4 32 2 28 7 28 2 22 0 3 5 3 36 3 27 2 26 1 19 0 4 37 4 27 1 5 4 5 35 5 24 2 3 37 4 30 5 4 2 3 24 3 23 0 2 32 6 28 4 6 4 2 28 5 23 3...
input:
6525 3 6 10 6 2 0 6 1 12 2 4 6 7 0 0 6 6 12 8 1 12 6 4 8 6 10 6 0 5 8 5 6 10 11 4 12 6 0 6 3 0 6 11 5 2 3 6 0 13 1 8 7 0 4 4 0 7 12 3 4 9 7 13 5 2 1 7 11 8 4 11 7 8 0 4 14 7 0 13 4 5 7 2 1 3 7 7 5 1 0 4 7 10 13 0 10 7 1 16 5 2 8 1 3 1 14 8 0 12 4 1 8 0 2 7 10 8 8 4 4 11 8 15 8 1 14 8 9 12 7 0 8 12 8...
output:
7 0 12 7 8 2 9 3 8 7 0 11 6 4 2 14 3 0 13 12 15 9 5 3 6 13 11 2 12 8 11 14 9 12 7 16 7 18 4 4 8 14 15 16 8 1 4 12 16 9 12 13 10 19 18 16 17 6 7 4 20 20 5 9 20 0 4 17 16 10 16 0 8 22 3 4 7 5 19 8 13 21 0 0 1 1 21 0 12 3 21 11 15 3 8 6 3 2 18 3 12 1 9 8 12 17 9 1 20 6 20 7 9 0 3 6 1 22 7 15 3 5 0 14 1...
result:
wrong answer the card you returned is 12, but expected 6 (test case 3)
Subtask #4:
score: 0
Skipped