# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
691841 | raul2008487 | Table Tennis (info1cup20_tabletennis) | C++17 | 3096 ms | 303368 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>
#define ll long long
#define in insert
#define pb push_back
#define vl vector<ll>
#define endl "\n"
#define all(v) v.begin(),v.end()
#define speed ios_base::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
using namespace std;
const int sz = 2e5+5;
vl dp(sz);
ll n,k,i,j,rx;
void print(vl v){
for(i=0;i<v.size();i++){
cout<<v[i]<<' ';
}
cout<<endl;
}
int main(){
multimap<ll,pair<ll,ll>> mp;
cin>>n>>k;
vl v(n);
ll im=n/2;
vl ans;
for(i=0;i<n;i++){
cin>>v[i];
for(j=i-1;j>=0;j--){
mp.in({v[i]+v[j],{v[i],v[j]}});
if(mp.count(v[i]+v[j])>=im){
rx=v[i]+v[j];
}
}
}
while(im--){
auto f=mp.find(rx);
ll idx1=(f->S).first;
ll idx2=(f->S).second;
ans.pb(idx1);
ans.pb(idx2);
//cout<<idx1<<" "<<idx2<<endl;
mp.erase(f);
}
sort(all(ans));
print(ans);
}
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... |