Submission #1233722

#TimeUsernameProblemLanguageResultExecution timeMemory
1233722cubedBest Place (NOI17_bestplace)C++20
100 / 100
58 ms1864 KiB
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define endl '\n'
#define pb(x) push_back(x)
 
const int MOD = 1e9+7;
const int inf =1e9;
const ll INF = 1e15;
const ll INV2 = 500000004;

class DSU {
    vector<int> parent, size;
public:
    DSU(int n) {
        parent.resize(n+1);
        size.resize(n+1);
        for (int i=0; i<=n; i++) {
            parent[i]=i;
            size[i]=1;
        }
    }

    int find (int node) {
        if (node==parent[node]) return node;
        return parent[node]=find(parent[node]);
    }

    void unite (int u, int v) {
        int pv=find(v);
        int pu=find(u);

        if (pv==pu) return;
        if (size[pu]<size[pv]) swap(pu, pv);

        parent[pv]=pu;
        size[pu]+=size[pv];
    }

    int getsize (int node) {
        return size[find(node)];
    }
};

ll getsqrt(ll x) {
    ll val = sqrtl(x) + 2;
    while (val * val > x) val--;
    return val;
}

bool safe (int i, int j, int n, int m) {
    if (i<0 || j<0 || i>=n || j>=m) return false;
    return true;
}

vector<int> dx={-1, 0, 1, 0};
vector<int> dy={0, 1, 0, -1};

// SOLUTION STARTS FROM HERE //

void solve() {
    ll n;
    cin>>n;

    vector<ll> x(n);
    vector<ll> y(n);

    for (ll i=0; i<n; i++) {
        cin>>x[i]>>y[i];
    }

    sort(x.begin(), x.end());
    sort(y.begin(), y.end());

    ll mid=n/2;

    cout<<x[mid]<<" "<<y[mid];
}

bool multi=false;

int main()
{

    //freopen("snakes.in", "r", stdin);
	//freopen("snakes.out", "w", stdout);

    int t=1;
    if (multi) 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...