Submission #667548

#TimeUsernameProblemLanguageResultExecution timeMemory
667548Hacv16Table Tennis (info1cup20_tabletennis)C++17
9 / 100
3080 ms1048576 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 2e6 + 50; const int INF = 0x3f3f3f3f; int n, k, tot, ans; vector<ll> v; void bt(int i, int chosen, vector<ll> aux){ if(chosen > n || i > tot) return; if(i == tot){ if(chosen == n){ ll sum = aux[0] + aux[aux.size() - 1]; bool isAns = true; for(int l = 1, r = aux.size() - 2; l < r; l++, r--) if(aux[l] + aux[r] != sum){ isAns = false; break; } if(isAns){ for(auto x : aux) cout << x << ' '; cout << '\n'; exit(0); } } return; } vector<ll> sla = aux; sla.push_back(v[i]); bt(i + 1, chosen + 1, sla); bt(i + 1, chosen, aux); } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; tot = n + k; for(int i = 0; i < tot; i++){ ll x; cin >> x; v.push_back(x); } vector<ll> trash; bt(0, 0, trash); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...