제출 #587450

#제출 시각아이디문제언어결과실행 시간메모리
587450gg123_peBest Place (NOI17_bestplace)C++14
23 / 100
1090 ms1832 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){ ll res = 0; f(j,1,n+1){ res += abs(a[j]-a[i]) + abs(b[j]-b[i]); } if(res < ans){ x = a[i], y = b[i]; 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...