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;
pair<int, pii> a[N];
void solve()
{
int n; cin >> n;
for(int i=1; i<=n; i++){
cin >> a[i].ss.ff >> a[i].ss.ss;
a[i].ff = a[i].ss.ff+a[i].ss.ss;
}
sort(a+1, a+n+1);
if(n%2) cout << a[n/2+1].ss.ff << " " << a[n/2+1].ss.ss << endl;
else cout << a[n/2].ss.ff << " " << a[n/2].ss.ss << 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... |