Submission #686290

#TimeUsernameProblemLanguageResultExecution timeMemory
686290smartmonkyTable Tennis (info1cup20_tabletennis)C++14
87 / 100
3079 ms11584 KiB
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() //#define int long long using namespace std; int a, b, c, d; main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n, k; cin >> n >> k; vector <int> v(n + k); map <int,int> mp; for(int i = 0; i < n + k; i++){ cin >> v[i]; mp[v[i]]++; } for(int l = 0; l <= min(n, k); l++){ for(int r = n + k - 1; r >= (n + k - 1) - (k - l); r--){ int cnt = l + (n + k - 1) - r; vector <int> ans; for(int i = l; i <= r; i++){ if(!mp.count(v[l] + v[r] - v[i])){ cnt++; }else ans.pb(v[i]); } if(cnt == k){ for(auto x : ans) cout << x <<" "; cout << endl; return 0; } } } }

Compilation message (stderr)

tabletennis.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
#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...