| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365210 | vjudge1 | Table Tennis (info1cup20_tabletennis) | C++20 | 3094 ms | 8780 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pu push_back
int main() {
ios::sync_with_stdio(0); cin.tie(0);
ll n, k;
cin>>n>>k;
ll total = n + k;
vector<ll> b(total + 1);
for(ll i = 1; i <= total; i++) cin >> b[i];
set<ll> sums;
for(ll i = 1; i <= k + 1; i++) {
for(ll j = total; j >= total - k; j--) {
if(i < j) sums.insert(b[i] + b[j]);
}
}
for(ll S : sums) {
vector<ll> res;
ll l = 1, r = total;
while(l < r && res.size() < n) {
if(b[l] + b[r] == S) {
res.pu(b[l]);
res.pu(b[r]);
l++; r--;
}
else if(b[l] + b[r] < S) l++;
else r--;
}
if(res.size() == n) {
sort(res.begin(), res.end());
for(ll i = 0; i < n; i++) {
cout << res[i] << (i == n - 1 ? "" : " ");
}
cout<<endl;
return 0;
}
}
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
