# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1118542 | ElayV13 | Table Tennis (info1cup20_tabletennis) | C++17 | 3051 ms | 6336 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld double
const int INF = 1e18;
const int mod = 12345;
const int sz = 1e6 + 5;
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
int n , k;
cin >> n >> k;
n = n + k;
vector < int > a(n);
for(int i = 0;i < n;i++) cin >> a[i];
sort(a.begin() , a.end());
for(int bit = 0;bit <= pow(2 , n) - 1;bit++)
{
vector < int > q1;
vector < int > q2;
for(int i = 0;i < n;i++)
{
if((1 << i) & bit) q1.push_back(a[i]);
else q2.push_back(a[i]);
}
if(q1.size() != k) continue;
set < int > v;
for(int i = 0;i < q2.size() / 2;i++)
{
v.insert(q2[i] + q2[q2.size() - i - 1]);
}
if(v.size() == 1)
{
for(int i : q2)
{
cout << i << ' ';
}
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |