Submission #949196

#TimeUsernameProblemLanguageResultExecution timeMemory
949196vjudge1Best Place (NOI17_bestplace)C++17
100 / 100
36 ms2044 KiB
#include <bits/stdc++.h> #define ll long long #define str string #define ins insert #define ld long double #define pb push_back #define pf push_front #define pof pop_front() #define pob pop_back() #define lb lower_bound #define ub upper_bound #define endl "\n" #define fr first #define sc second #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define sz size() #define vll vector<ll> #define bc back() #define arr array #define pll vector<pair<ll,ll>> using namespace std;/* #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>*/ template<class S,class T> bool chmin(S &a,const T &b) { return a>b?(a=b)==b:false; } template<class S,class T> bool chmax(S &a,const T &b) { return a<b?(a=b)==b:false; } void start(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const ll N=1e5+5; const ll M=6e6+5; void solve(){ ll i,j; ll n; cin>>n; vll x(n),y(n); for(i=0;i<n;i++)cin>>x[i]>>y[i]; sort(all(x)); sort(all(y)); cout<<x[(n+1)/2-1]<<' '<<y[(n+1)/2-1]<<endl; } signed main(){ start(); ll t=1; //cin>>t; while(t--) solve(); return 0; } /* */

Compilation message (stderr)

bestplace.cpp: In function 'void solve()':
bestplace.cpp:43:10: warning: unused variable 'j' [-Wunused-variable]
   43 |     ll i,j;
      |          ^
#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...