# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
965926 | detectivebowon | Best Place (NOI17_bestplace) | C++14 | 1055 ms | 6740 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,x[100007],y[1000007],ans=LLONG_MAX,ansx,ansy;
signed main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>x[i]>>y[i];
int dist=0;
for(int i=0;i<=100;i++)
{
for(int j=0;j<=100;j++)
{
int sum=0;
for(int k=1;k<=n;k++)
{
sum+=abs(x[k]-i)+abs(y[k]-j);
}
if(sum<ans)
{
ans=sum;
ansx=i;
ansy=j;
}
}
}
cout<<ansx<<" "<<ansy;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |