Submission #955004

#TimeUsernameProblemLanguageResultExecution timeMemory
955004anonym1Best Place (NOI17_bestplace)C++14
100 / 100
28 ms3164 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; 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 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...