Submission #525519

#TimeUsernameProblemLanguageResultExecution timeMemory
525519Psiuk_YuriiTable Tennis (info1cup20_tabletennis)C++14
9 / 100
91 ms18572 KiB
#include <bits/stdc++.h> using namespace std; long long n,k,a[150009],m,t,y,p,tl; set<long long> q; vector<long long> A; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>k; for(int i=1;i<=n+k;i++) { cin>>a[i]; q.insert(a[i]); } for(int L=1;L<=k+1;L++){ for(int R=L+n-1;R<=n+k;R++){ t=0; tl=L; while(tl<n/2+k && 2*tl<=a[L]+a[R]){ if(q.count(a[L]+a[R]-a[tl])==1) t++; tl++; } if(t>=n/2){ y=0; for(int i=1;i<=n+k;i++) { if(q.count(a[L]+a[R]-a[i])==1) y+=2; A.push_back(a[i]); //cout<<a[i]<<endl; A.push_back(a[L]+a[R]-a[i]); if(y>=n) { p=1; break; } } } if(p==1) break; } if(p==1) break; } sort(A.begin(),A.end()); for(auto x:A) cout<<x<<" "; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...