# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
555824 | colossal_pepe | Table Tennis (info1cup20_tabletennis) | C++17 | 2785 ms | 3916 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
vector<int> v;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> m;
v.resize(n + m);
for (int i = 0; i < n + m; i++) {
cin >> v[i];
}
bool done = 0;
for (int i = (n / 2) - 1; i <= (n / 2) - 1 + m; i++) {
int total = v[i] + v[i + 1];
int cnt = 0;
for (int j = 0; j < n + m; j++) {
if (binary_search(v.begin(), v.end(), total - v[j])) cnt++;
}
if (cnt < n) continue;
cnt = n;
for (int j = 0; j < n + m; j++) {
if (cnt == 0) break;
if (binary_search(v.begin(), v.end(), total - v[j])) {
cout << v[j] << ' ';
cnt--;
}
}
break;
}
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... |