Submission #1534659


Source Code Expand

#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  long long int INF = 100000000, X[N], Y[N], R_min = INF, B_min = INF, M = 0, R_max, B_max;
  for(int i = 0; i < N; ++i){
    cin >> X[i] >> Y[i];
    if(min(X[i],Y[i]) < B_min){
      B_min = min(X[i],Y[i]);
      R_max = max(X[i],Y[i]);
    }
    if(max(X[i],Y[i]) < R_min){
      R_min = max(X[i],Y[i]);
      B_max = min(X[i],Y[i]);
    }
    M = max(M,max(X[i],Y[i]));
  }
  for(int i = 0; i < N; ++i){
    if(min(X[i],Y[i]) > R_min){
      B_max = max(min(X[i],Y[i]),B_max);
      R_max = max(min(X[i],Y[i]),R_max);
    }else{
      R_max = max(max(X[i],Y[i]),R_max);
      B_max = max(min(X[i],Y[i]),B_max);
    }
  }
  // cout << R_max << " " << R_min << " " << B_max << " " << B_min << " " << M << endl;
  cout << min((R_max-R_min)*(M-B_min),(M-R_min)*(B_max-B_min)) << endl;
  return 0;
}

Submission Info

Submission Time
Task E - Ball Coloring
User TAB
Language C++14 (GCC 5.4.1)
Score 0
Code Size 904 Byte
Status WA
Exec Time 159 ms
Memory 3328 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
AC × 3
AC × 18
WA × 17
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 158 ms 3328 KB
div21 WA 158 ms 3328 KB
div22 AC 157 ms 3328 KB
div23 AC 158 ms 3328 KB
div24 WA 158 ms 3328 KB
example0 AC 1 ms 256 KB
example1 AC 1 ms 256 KB
example2 AC 1 ms 256 KB
maxrand0 AC 157 ms 3328 KB
maxrand1 AC 156 ms 3328 KB
maxrand2 AC 158 ms 3328 KB
maxrand20 WA 152 ms 3328 KB
maxrand21 WA 158 ms 3328 KB
maxrand210 WA 157 ms 3328 KB
maxrand211 WA 157 ms 3328 KB
maxrand22 WA 158 ms 3328 KB
maxrand23 WA 158 ms 3328 KB
maxrand24 WA 157 ms 3328 KB
maxrand25 WA 157 ms 3328 KB
maxrand26 WA 158 ms 3328 KB
maxrand27 WA 157 ms 3328 KB
maxrand28 WA 157 ms 3328 KB
maxrand29 WA 157 ms 3328 KB
maxrand3 AC 159 ms 3328 KB
maxrand4 AC 158 ms 3328 KB
smallrand0 AC 1 ms 256 KB
smallrand1 AC 1 ms 256 KB
smallrand2 WA 1 ms 256 KB
smallrand3 WA 1 ms 256 KB
smallrand4 AC 1 ms 256 KB
sparse0 AC 156 ms 3328 KB
sparse1 AC 156 ms 3328 KB
sparse2 AC 157 ms 3328 KB
sparse3 AC 157 ms 3328 KB
sparse4 AC 157 ms 3328 KB