Submission #587449

#TimeUsernameProblemLanguageResultExecution timeMemory
587449gg123_peBest Place (NOI17_bestplace)C++14
16 / 100
1097 ms1812 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define f(i,a,b) for(int i = a; i < b; i++) const int N = 1e5 + 5; const ll inf = 2e18; int n; ll a[N], b[N]; int main(){ cin >> n; f(i,1,n+1) cin >> a[i] >> b[i]; ll ans = inf, x, y; f(i,1,n+1){ f(j,1,n+1){ ll res = 0; f(k,1,n+1){ res += abs(a[k]-a[i]) + abs(b[k]-b[j]); } if(res < ans){ x = a[i], y = b[j]; ans = res; } } } cout << x << " " << y << "\n"; return 0; }
#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...