Submission #1533207


Source Code Expand

#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	int n;
	cin >> n;
	vector<pll> v(n);
	rep(i, n) {
		cin >> v[i].fi >> v[i].se;
		if(v[i].fi > v[i].se) swap(v[i].fi, v[i].se);
	}
	sort(all(v));
	ll m = v[0].se, M = v[0].se;
	REP(i, 1, n) {
		m = min(m, v[i].se);
		M = max(m, v[i].se);
	}
	cout << min(abs((M - m) * (v.back().fi - v[0].fi)), abs((M - v[0].fi) * (v.back().fi - m))) << endl;
	return 0;
}

Submission Info

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

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 700
Status
AC × 3
AC × 6
WA × 29
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 172 ms 3328 KB
div21 WA 197 ms 3328 KB
div22 WA 172 ms 3328 KB
div23 WA 197 ms 3328 KB
div24 WA 174 ms 3328 KB
example0 AC 1 ms 256 KB
example1 AC 1 ms 256 KB
example2 AC 1 ms 256 KB
maxrand0 WA 171 ms 3328 KB
maxrand1 WA 174 ms 3328 KB
maxrand2 WA 171 ms 3328 KB
maxrand20 WA 180 ms 3328 KB
maxrand21 WA 175 ms 3328 KB
maxrand210 AC 174 ms 3328 KB
maxrand211 WA 175 ms 3328 KB
maxrand22 WA 199 ms 3328 KB
maxrand23 WA 175 ms 3328 KB
maxrand24 WA 173 ms 3328 KB
maxrand25 WA 175 ms 3328 KB
maxrand26 WA 175 ms 3328 KB
maxrand27 WA 175 ms 3328 KB
maxrand28 WA 175 ms 3328 KB
maxrand29 WA 173 ms 3328 KB
maxrand3 WA 173 ms 3328 KB
maxrand4 WA 171 ms 3328 KB
smallrand0 WA 1 ms 256 KB
smallrand1 AC 1 ms 256 KB
smallrand2 WA 1 ms 256 KB
smallrand3 AC 1 ms 256 KB
smallrand4 WA 1 ms 256 KB
sparse0 WA 171 ms 3328 KB
sparse1 WA 171 ms 3328 KB
sparse2 WA 172 ms 3328 KB
sparse3 WA 172 ms 3328 KB
sparse4 WA 175 ms 3328 KB