# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
994150 | kachim2 | Table Tennis (info1cup20_tabletennis) | C++17 | 3071 ms | 195720 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 <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <vector>
using namespace std;
vector<pair<int, int>> check_balanced(vector<int> in, int val) {
map<int, int> m;
for (int i : in){
m[i]++;
}
vector<pair<int, int>> res;
for (auto &[key, value] : m){
if(value!=0){
m[val-key]--;
value--;
res.emplace_back(key, val-key);
}
}
return res;
}
int main() {
int N, K;
cin >> N >> K;
vector<int> input(N+K);
for(int i = 0; i < N+K; i++){
cin >> input[i];
}
for(int i : input){
for(int j : input){
if(j!=i){
auto a = check_balanced(input, i+j);
if(a.size()>=N/2){
vector<int> out;
for(auto i : a){
out.push_back(i.first);
out.push_back(i.second);
}
sort(out.begin(), out.end());
for(int i : out){
cout << i <<' ';
}
}
}
}
}
}
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... |