Submission #655099

#TimeUsernameProblemLanguageResultExecution timeMemory
655099true22Best Place (NOI17_bestplace)C++14
100 / 100
50 ms3804 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; // short forms // #define f first #define s second #define nl "\n" #define pb push_back #define all(x) x.begin(), x.end() // debug // #define pv(x) for(auto k : x){cout << k << " ";} cout << nl; #define pp(x) cout << x.f << " " << x.s << nl; #define bv(x) if (x) cout << "true"; else cout << "false"; #define gp(x, y) x << " " << y // loop // #define fur(i, a, b) for(ll i = a; i <= b; i++) #define ruf(i, a, b) for(ll i = a; i >= b; i--) // pair // typedef pair<ll, ll> pl; // vector // typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pl> vp; // constants // const ll INF = 1e17; const ll mod = 1e9 + 7; const ll S = 1e5 + 5; void solve(){ ll n; cin >> n; vl x(n); vl y(n); fur(i, 0, n-1) cin >> x[i] >> y[i]; sort(all(x)); sort(all(y)); ll mx, my; if (n%2 == 0){ mx = (x[(n/2)] + x[(n/2) - 1])/2; my = (y[(n/2)] + y[(n/2) - 1])/2; }else{ mx = x[(n+1)/2 - 1]; my = y[(n+1)/2 - 1]; } cout << mx << ' ' << my << nl; } int main(){ ios::sync_with_stdio(0); cin.tie(0); ll t = 1; //cin >> t; while(t--){ solve(); } 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...