# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346830 | arnold518 | Table Tennis (info1cup20_tabletennis) | C++14 | 3088 ms | 78304 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 = 20;
int N, K, A[MAXN+10];
vector<pii> M[3000000+10];
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])%3000001].push_back({A[i], A[j]});
if(M[(A[i]+A[j])%3000001].size()>=N/2)
{
vector<pii> &it=M[(A[i]+A[j])%3000001];
vector<int> V;
for(int i=0; i<N/2; i++)
{
V.push_back(it[i].first);
V.push_back(it[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... |