#include <iostream>
using namespace std;
#define MAXN 150000
#define MAXK 400
int v[MAXN+MAXK+1];
int sol[MAXN+1];
int main()
{
int n, k;
cin>>n>>k;
int i;
long long sum;
sum=0;
for(i=1; i<=n+k; i++)
{
cin>>v[i];
sum+=v[i];
}
if(k==1)
{
int p, csum, ok, j;
for(i=1; i<=n+k; i++)
{
if((sum-v[i])%(n/2)==0)
{
p=1;
for(j=1; j<=n+k; j++)
if(j!=i)
sol[p++]=v[j];
p=n;
csum=(sum-v[i]/(n/2));
ok=0;
for(j=1; j<=n/2; j++)
{
if(sol[j]+sol[p]==csum)
ok++;
p--;
}
if(ok==n/2)
break;
}
}
}
for(i=1; i<=n; i++)
cout<<sol[i]<<" ";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
452 KB |
Output does not have symmetry property |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
820 KB |
Output is correct |
2 |
Incorrect |
53 ms |
4528 KB |
Output does not have symmetry property |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
2528 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
444 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output not subsequence of input |
2 |
Halted |
0 ms |
0 KB |
- |