# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420970 | Hegdahl | Aliens (IOI16_aliens) | C++17 | 2073 ms | 204 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>
#include "aliens.h"
#define ar array
using namespace std;
using ll = long long;
using ld = long double;
int n;
vector<ar<ll, 2>> p;
vector<ll> ul, dr;
pair<ld, int> go(ld penalty) {
ld total_cost = 0;
int total_used = 1;
ll cur_ul = ul[0], cur_dr = dr[0];
ll cur_w = cur_dr-cur_ul+1;
ld cur_cost = cur_w*cur_w;
for (int i = 1; i < n; ++i) {
ll extend_ul = min(cur_ul, ul[i]);
ll extend_dr = max(cur_dr, dr[i]);
ll extend_w = extend_dr - extend_ul + 1;
ld extend_cost = extend_w*extend_w - cur_cost;
ll new_w = dr[i]-ul[i]+1;
ld new_cost = new_w*new_w + penalty;
if (extend_cost < new_cost + i/1e7) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |