# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
33917 | imeimi2000 | Wiring (IOI17_wiring) | C++14 | 53 ms | 10144 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 "wiring.h"
#include <algorithm>
using namespace std;
typedef long long llong;
const int R = 0, B = 1;
int n, m;
struct point {
int x, k;
bool operator<(const point &p) const {
return x < p.x;
}
};
point ps[200001];
int cnt[200001];
llong sum[200001];
llong dp[200001];
long long min_total_length(std::vector<int> r, std::vector<int> b) {
n = r.size();
m = b.size();
int i = 0, j = 0, p = 0;
while (i < n && j < m) {
if (r[i] < b[j]) ps[++p] = { r[i++], R };
else ps[++p] = { b[j++], B };
}
while (i < n) ps[++p] = { r[i++], R };
while (j < m) ps[++p] = { b[j++], B };
llong ret = 0ll;
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... |