# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1079870 | juicy | Wiring (IOI17_wiring) | C++17 | 42 ms | 13480 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 <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, inf = 1e9;
int c[N], cnt[N];
long long dp[N], pf[N];
long long qry(int l, int r) {
return pf[r] - pf[l];
}
long long min_total_length(vector<int> r, vector<int> b) {
vector<array<int, 2>> cands;
for (int i = 0; i < r.size(); ++i) {
cands.push_back({r[i], 0});
}
for (int i = 0; i < b.size(); ++i) {
cands.push_back({b[i], 1});
}
sort(cands.begin(), cands.end());
int n = cands.size();
for (int i = 0; i < n; ) {
int j = i;
while (j < n && cands[j][1] == cands[i][1]) {
++j;
}
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... |