제출 #525520

#제출 시각아이디문제언어결과실행 시간메모리
525520Psiuk_YuriiTable Tennis (info1cup20_tabletennis)C++14
49 / 100
140 ms17120 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<=R){ if(q.count(a[L]+a[R]-a[tl])==1) t++; tl++; } if(t>=n){ y=0; for(int i=L;i<=R;i++) { if(q.count(a[L]+a[R]-a[i])==1) y++; A.push_back(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...