Submission #3207166


Source Code Expand

#include<iostream>
#include<set>
#include <bitset>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
#include <limits>
#include <numeric>
#include <type_traits>
#include<bitset>
#define int long long
#define ll long long
#define mod  1000000007
#define inf 1e17
#define rep(i,j,n) for(int i=j;i<n;i++)
#define P pair<int,int>
double pi = 3.141592653589793;
using namespace std;
//ここから始めよう
signed main(){
    int n;cin>>n;
    int x[214514],y[214514];
    int maxi=-1,mini=inf;
    int ymax=-1,xmin=inf;
    rep(i,0,n){
        cin>>x[i]>>y[i];
        if(x[i]<y[i])swap(x[i],y[i]);
        ymax=max(y[i],ymax);xmin=min(xmin,x[i]);
        maxi=max({maxi,x[i],y[i]});mini=min({mini,x[i],y[i]});
    }
    int t=(maxi-xmin)*(ymax-mini);
    P num[214514];
    rep(i,0,n){
        swap(x[i],y[i]);
        num[i]=P(x[i],y[i]);
    }
    sort(num,num+n);
    int di=num[n-1].first-num[0].second;
    int maxrange=num[n-1].first;
    int minrange=num[0].second;
    swap(x[0],y[0]);
    rep(i,0,n-1){
        //cout<<di<<" ";
        maxrange=max(num[i].second,maxrange);
        minrange=min(num[i].first,minrange);
        di=min(di,maxrange-minrange);
    }
    //cout<<t<<" "<<di<<endl;
    if(di<0)cout<<t<<endl;
    else cout<<min(t,di*(maxi-mini))<<endl;return 0;
}

Submission Info

Submission Time
Task E - Ball Coloring
User birdway
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1518 Byte
Status WA
Exec Time 197 ms
Memory 6912 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
AC × 3
AC × 7
WA × 28
Set Name Test Cases
Sample example0, example1, example2
All div20, div21, div22, div23, div24, example0, example1, example2, maxrand0, maxrand1, maxrand2, maxrand20, maxrand21, maxrand210, maxrand211, maxrand22, maxrand23, maxrand24, maxrand25, maxrand26, maxrand27, maxrand28, maxrand29, maxrand3, maxrand4, smallrand0, smallrand1, smallrand2, smallrand3, smallrand4, sparse0, sparse1, sparse2, sparse3, sparse4
Case Name Status Exec Time Memory
div20 WA 174 ms 6912 KB
div21 WA 173 ms 6912 KB
div22 WA 197 ms 6912 KB
div23 WA 174 ms 6912 KB
div24 WA 176 ms 6912 KB
example0 AC 2 ms 5376 KB
example1 AC 2 ms 5120 KB
example2 AC 2 ms 6656 KB
maxrand0 WA 173 ms 6912 KB
maxrand1 WA 172 ms 6912 KB
maxrand2 WA 172 ms 6912 KB
maxrand20 WA 171 ms 6784 KB
maxrand21 WA 175 ms 6912 KB
maxrand210 AC 176 ms 6912 KB
maxrand211 WA 175 ms 6784 KB
maxrand22 WA 176 ms 6912 KB
maxrand23 WA 176 ms 6912 KB
maxrand24 WA 174 ms 6912 KB
maxrand25 AC 175 ms 6912 KB
maxrand26 WA 176 ms 6912 KB
maxrand27 WA 175 ms 6912 KB
maxrand28 WA 176 ms 6912 KB
maxrand29 WA 175 ms 6912 KB
maxrand3 WA 173 ms 6912 KB
maxrand4 WA 172 ms 6912 KB
smallrand0 WA 2 ms 6784 KB
smallrand1 AC 2 ms 5760 KB
smallrand2 WA 2 ms 6144 KB
smallrand3 AC 2 ms 4992 KB
smallrand4 WA 3 ms 5504 KB
sparse0 WA 172 ms 6784 KB
sparse1 WA 172 ms 6912 KB
sparse2 WA 173 ms 6912 KB
sparse3 WA 173 ms 6912 KB
sparse4 WA 174 ms 6912 KB