# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
844989 | samekkk | Table Tennis (info1cup20_tabletennis) | C++14 | 3028 ms | 2556 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;
typedef long long ll;
#define rep(a,b) for (int a = 0; a < (b); ++a)
#define pb push_back
#define all(t) t.begin(), t.end()
const int max_N = 160005;
int n = 0, k = 0;
int A[max_N];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> k;
rep(i,n+k) cin >> A[i];
for (int i = 1; i < (1 << (n+k)); ++i)
{
vector<int> V;
rep(j,n+k)
{
auto b = (1 << j) & i;
if (b) V.pb(A[j]);
}
if (V.size() != n) continue;
int S = V[0] + V.back();
bool czy_OK = true;
for (int j = 1; j < n/2; ++j) if (V[j] + V[n-j-1] != S) czy_OK = false;
if (czy_OK == true)
{
rep(j,n+k)
{
auto b = (1 << j) & i;
if (b) cout << A[j] << ' ';
}
cout << '\n';
return 0;
}
}
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... |