# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42422 | TAMREF | Palembang Bridges (APIO15_bridge) | C++11 | 95 ms | 45632 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>
#define sz(x) ((int)x.size())
using namespace std;
typedef long long ll;
const int mx = 100005;
int k, n, m;
ll D[mx], E[mx];
struct People{
int a, b;
bool operator < (People z){
return a + b < z.a + z.b;
}
} P[mx];
void subpr(ll *V){
if(!n) return;
ll dval = abs(P[0].a - P[0].b);
priority_queue<int> lft;
priority_queue<int,vector<int>,greater<int>> rgt;
int brp = P[0].a;
(P[0].b < brp ? lft.push(P[0].b) : rgt.push(P[0].b));
V[0] = dval;
//printf("%lld\n",V[0]);
for(int i = 1; i < n; i++){
//cout << "i = " << i << endl;
dval += abs(brp - P[i].a) + abs(brp - P[i].b);
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... |