#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define pii pair<int ,int>
#define pll pair<long ,long>
#define mii map<int,int>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define ull unsigned long long
#define fastio ios_base::sync_with_stdio();cin.tie(NULL)
const int mod = 1e9 + 7;
ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}
ll binopow(ll b, ll pow) { if (pow == 0) return 1 ; ll ans; ans = binopow(b, pow / 2); ans = (ans * ans) % mod; if (pow % 2) ans = (ans * b) % mod; return ans; }
ll inv(ll a , ll mod) { return binopow(a, mod - 2); }
//------------------------------------------------------------------------------------------------------------------------------------------//
int main ()
{
fastio;
int n ;
cin >> n;
vector<pll>v;
for (int i = 0; i < n; i++)
{
ll a, b ;
cin >> a >> b;
v.pb({a, b});
}
sort(v.begin(), v.end());
if (n % 2 == 0)
{
cout << v[(n / 2) - 1].first << " " << v[(n / 2) - 1].second << "\n";
}
else
{
cout << (v[(n / 2) - 1].first + v[n / 2].first) / 2 << " " << 0 << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
2444 KB |
Output is correct |
2 |
Correct |
56 ms |
2368 KB |
Output is correct |
3 |
Incorrect |
55 ms |
2456 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
73 ms |
2408 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |