# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14389 | kriii | Palembang Bridges (APIO15_bridge) | C++14 | 1323 ms | 22008 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 <stdio.h>
#include <functional>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
struct intv{
intv(long long s_, long long e_){
s = s_; e = e_;
}
long long s,e;
};
bool cmpm(const intv &a, const intv &b){return a.s + a.e < b.s + b.e;}
vector<intv> seg;
set<int> xs;
map<int, int, greater<int> > A[2]; long long sza[2],sa[2];
map<int, int> B[2]; long long szb[2],sb[2];
int K,N;
void push(int i, int x)
{
A[i][x]++; sza[i]++; sa[i] += x;
int p = A[i].begin()->first;
B[i][p]++; szb[i]++; sb[i] += p;
if (--A[i][p] == 0) A[i].erase(p); sza[i]--; sa[i] -= p;
if (szb[i] > sza[i]){
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... |