This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);
#define ll long long int
#define for_t ll T;cin>>T;while(T--)
#define endl "\n"
#define rep(n) for(int i=0;i<n;i++)
#define F(a,b) for(ll i=a;i<b;i++)
#define FR(i,a,b) for(int i=a;i>=b;i--)
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define pb push_back
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>
ll highestPowerof2(ll n)
{
ll res = (ll)log2(n);
return (ll)pow(2,res);
}
void sol()
{
int n;
cin >> n;
vector<int> x,y;
int tempx,tempy;
for(int i = 0;i < n;i++)
{
cin >> tempx >> tempy;
x.pb(tempx);
y.pb(tempy);
}
sort(all(x));
sort(all(y));
int ansx = (x[ceil(x.size()/2) - 1] + x[floor(x.size()/2) + 1])/2;
int ansy = (y[ceil(y.size()/2) - 1] + y[floor(y.size()/2) + 1])/2;
cout << ansx << " " << ansy;
}
int main()
{
sol();
}
# | 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... |