# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346801 | arnold518 | Table Tennis (info1cup20_tabletennis) | C++14 | 3075 ms | 9824 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;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 15e4;
const int MAXK = 400;
int N, K, A[MAXN+10];
unordered_map<int, vector<pii>> M;
int main()
{
scanf("%d%d", &N, &K);
for(int i=1; i<=N+K; i++) scanf("%d", &A[i]);
for(int i=1; i<=N+K; i++)
{
int t=N+K-i+1;
for(int j=max(i+1, t-K); j<=min(N+K, t+K); j++)
{
M[A[i]+A[j]].push_back({A[i], A[j]});
}
}
for(auto it : M)
{
if(it.second.size()>=N/2)
{
vector<int> V;
for(int i=0; i<N/2; i++)
{
V.push_back(it.second[i].first);
V.push_back(it.second[i].second);
}
sort(V.begin(), V.end());
for(auto it : V) printf("%d ", it);
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... |