Submission #955003

#TimeUsernameProblemLanguageResultExecution timeMemory
955003anonym1Best Place (NOI17_bestplace)C++14
51 / 100
22 ms4592 KiB
#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 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...