| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 667637 | pedroslrey | Table Tennis (info1cup20_tabletennis) | C++17 | 249 ms | 31336 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>
using namespace std;
map<int, int> vals;
bool test(vector<int> &xs, int n, int k, int x) {
    vector<int> marc(n + k);
    vector<pair<int, int>> pairs;
    for (int i = 0; i < n + k; ++i)
        if (!marc[i+1] && vals[x - xs[i]] != 0) {
            pairs.emplace_back(xs[i], x - xs[i]);
            marc[vals[x - xs[i]]] = true;
        }
    if (pairs.size() >= n/2) {
        for (int i = 0; i < n/2; ++i)
            cout << pairs[i].first << " " << pairs[i].second << " ";
        cout << "\n";
        return true;
    }
    return false;
}
int main() {
    int n, k;
    cin >> n >> k;
    vector<int> xs(n+k);
    for (int &x: xs)
        cin >> x;
    for (int i = 0; i < n + k; ++i)
        vals[xs[i]] = i + 1;
    for (int i = 0; i < k; ++i)
        for (int j = n + i; j < n + k; ++j)
            if (test(xs, n, k, xs[i] + xs[j])) 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... | ||||
