# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
60626 | dukati8 | Palembang Bridges (APIO15_bridge) | C++14 | 436 ms | 13420 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;
#define rep(i,a,b) for (int i=a; i<int(b); i++)
#define all(x) x.begin(),x.end()
vector <pair<long long,long long> > travels;
vector <long long> points;
long long cost(long long point){
long long ans=0;
for (auto a:travels) {
long long c,d;
c=a.first;
d=a.second;
ans+=abs(point-c) + abs(point-d);
}
return ans;
}
long long cost (long long point1, long long point2) {
long long ans=0;
for (auto a:travels) {
long long c,d;
c=a.first;
d=a.second;
ans+=min(abs(point1-c) + abs(point1-d),abs(point2-c) + abs(point2-d));
}
return ans;
}
int main() {
unordered_set<long long> unip;
int k,n;
# | 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... |