#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define int long long
using namespace std ;
vector <int> v ;
bool check ()
{
set <int> st ;
int n = v.size() ;
for ( int i = 0 ; i < n ; i++ ) st.insert(v[i]+v[n-i-1]) ;
if ( st.size() == 1 ) return 1 ;
return 0 ;
}
signed main ()
{
fastio ;
int n , k ;
cin >> n >> k ;
int a[n+k] ;
for ( auto &it : a ) cin >> it ;
sort ( a , a + n ) ;
for ( int i = 0 ; i < n+k ; i++ )
{
for ( int j = 0 ; j < n+k ; j++ ) if ( j != i ) v.push_back(a[j]) ;
if ( check () )
{
for ( int j = 0 ; j < n+k ; j++ ) if ( j != i ) cout << a[j] << " " ;
return 0 ;
}
v.clear() ;
}
return 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
27 ms |
332 KB |
Output is correct |
3 |
Correct |
29 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1061 ms |
1076 KB |
Output is correct |
2 |
Correct |
30 ms |
5736 KB |
Output is correct |
3 |
Execution timed out |
3052 ms |
5048 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3060 ms |
5032 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
308 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |