답안 #91638

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
91638 2018-12-28T20:16:59 Z nathalie_fouad Cover (COCI18_cover) C++14
0 / 120
5 ms 376 KB
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<pair<ll,ll> > v(n);
    ll maxx=0, maxy=0;
    for(int i=0;i<n;i++)
        cin>>v[i].first>>v[i].second,
        maxx=max(maxx,abs(v[i].first) ),maxy=max(maxy,abs(v[i].second) );

    ll minmx=1e11 , maxmx=-1e11 , minmy=1e11 , maxmy=-1e11 ;
    for(int i=0;i<n;i++)
    {
        if(abs(v[i].first)==maxx)
            minmx=min(minmx,v[i].second ),
            maxmx=max(maxmx,abs(v[i].second));
        if(abs(v[i].second)==maxy)
            minmy=min(minmy,v[i].first),
            maxmy=max(maxmy,abs(v[i].first));
    }
    minmy=abs(minmy);
    minmx=abs(minmx);
    ll barax=-1e11,baray=-1e11;
    for(int i=0;i<n;i++)
    {
        if(abs(v[i].first)>max(minmy,maxmy) && abs(v[i].second)>max(minmx,minmy))
            barax=max(barax,abs(v[i].first)),
            baray=max(baray,abs(v[i].second));
    }
    ll ans=maxx*2*maxy*2;
    if(barax==-1e11 && baray==-1e11)
    {ans=min(ans,max(minmy,maxmy)*2*maxy*2+max(minmx,maxmx)*2*maxx*2);goto go;}
    ans=min(ans,max(minmy,maxmy)*2*maxy*2+max(minmx,maxmx)*2*maxx*2+barax*2*baray*2);
    ans=min(ans,barax*2*maxy*2+baray*2*maxx*2);
    ans=min(ans,max(barax,baray)*2*maxy*2+max(minmx,maxmx)*2*maxx*2);
    ans=min(ans,max(minmy,maxmy)*2*maxy*2+max(barax,baray)*2*maxx*2);
    go:;
    cout<<ans;


    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 1 ms 376 KB Output isn't correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 348 KB Output isn't correct
7 Incorrect 2 ms 376 KB Output isn't correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 4 ms 376 KB Output isn't correct
10 Incorrect 5 ms 376 KB Output isn't correct