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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long int ll;
typedef pair<int, int> pii;
#define endl "\n"
#define ff first
#define ss second
const int N = 2e5+20;
const ll INF = 1e18+10;
const int mod = 1e9+7;
int x[N], y[N];
void solve()
{
int n; cin >> n;
for(int i=1; i<=n; i++){
cin >> x[i] >> y[i];
}
sort(x+1, x+n+1); sort(y+1, y+n+1);
if(n%2) cout << x[n/2+1] << " " << y[n/2+1] << endl;
else cout << x[n/2] << " " << y[n/2] << endl;
}
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// cout.precision(10);
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
int t;
// cin >> t;
t=1;
for(int i=1; i<=t; i++){
// cout << "Case #" << i << ": ";
solve();
}
}
# | 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... |