# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
686290 | smartmonky | Table Tennis (info1cup20_tabletennis) | C++14 | 3079 ms | 11584 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 ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
//#define int long long
using namespace std;
int a, b, c, d;
main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
vector <int> v(n + k);
map <int,int> mp;
for(int i = 0; i < n + k; i++){
cin >> v[i];
mp[v[i]]++;
}
for(int l = 0; l <= min(n, k); l++){
for(int r = n + k - 1; r >= (n + k - 1) - (k - l); r--){
int cnt = l + (n + k - 1) - r;
vector <int> ans;
for(int i = l; i <= r; i++){
if(!mp.count(v[l] + v[r] - v[i])){
cnt++;
}else
ans.pb(v[i]);
}
if(cnt == k){
for(auto x : ans)
cout << x <<" ";
cout << endl;
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... |