Submission #481770

#TimeUsernameProblemLanguageResultExecution timeMemory
481770sicho_mohitBest Place (NOI17_bestplace)C++14
3 / 100
73 ms2456 KiB
#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 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...