Submission #2667309


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<pair<ll, ll>> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i].first >> a[i].second;
        if (a[i].first > a[i].second) {
            swap(a[i].first, a[i].second);
        }
    }
    sort(a.begin(), a.end());
    ll ans = (a[n - 1].first - a[0].first) * (a[n - 1].second - a[0].second);
    ans = min(ans, (a[n - 1].second - a[0].first) * abs(a[0].second - a[n - 1].first));
    cout << ans;
    return 0;
}

Submission Info

Submission Time
Task E - Ball Coloring
User meatrow
Language C++14 (GCC 5.4.1)
Score 0
Code Size 717 Byte
Status WA
Exec Time 59 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 55 ms 3328 KB
div21 WA 55 ms 3328 KB
div22 WA 56 ms 3328 KB
div23 WA 55 ms 3328 KB
div24 WA 56 ms 3328 KB
example0 AC 1 ms 256 KB
example1 AC 1 ms 256 KB
example2 AC 1 ms 256 KB
maxrand0 WA 56 ms 3328 KB
maxrand1 WA 56 ms 3328 KB
maxrand2 WA 56 ms 3328 KB
maxrand20 WA 59 ms 3328 KB
maxrand21 WA 58 ms 3328 KB
maxrand210 AC 57 ms 3328 KB
maxrand211 WA 57 ms 3328 KB
maxrand22 WA 58 ms 3328 KB
maxrand23 WA 58 ms 3328 KB
maxrand24 WA 57 ms 3328 KB
maxrand25 WA 59 ms 3328 KB
maxrand26 WA 58 ms 3328 KB
maxrand27 WA 58 ms 3328 KB
maxrand28 WA 57 ms 3328 KB
maxrand29 WA 56 ms 3328 KB
maxrand3 WA 55 ms 3328 KB
maxrand4 WA 56 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 56 ms 3328 KB
sparse1 WA 55 ms 3328 KB
sparse2 WA 55 ms 3328 KB
sparse3 WA 55 ms 3328 KB
sparse4 WA 56 ms 3328 KB