이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |