# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1002914 | pedroslrey | Izvanzemaljci (COI21_izvanzemaljci) | C++14 | 121 ms | 12628 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using lli = long long;
pair<vector<int>, lli> calc(vector<pair<int, int>> points) {
map<int, vector<pair<int, int>>> batch;
for (auto [x, y]: points)
batch[x].emplace_back(x, y);
multiset<int> xs, ys;
for (auto [x, y]: points) {
xs.insert(x);
ys.insert(y);
}
int d = max(*xs.rbegin() - *xs.begin(), *ys.rbegin() - *ys.begin());
d = max(d, 1);
int mx_x = 0, mn_x = 1e9, mx_y = 0, mn_y = 1e9;
vector<int> ans{*xs.begin(), *ys.begin(), d, (int)2e9, (int)2e9, 1}; lli best = 1LL*d*d + 1;
for (auto [k, abas]: batch) {
for (auto [x, y]: abas) {
assert(xs.find(x) != xs.end());
assert(ys.find(y) != ys.end());
if (xs.empty()) break;
mx_x = max(mx_x, x); mn_x = min(mn_x, x);
mx_y = max(mx_y, y); mn_y = min(mn_y, y);
xs.erase(xs.find(x)); ys.erase(ys.find(y));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |