# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
50642 | gnoor | Wiring (IOI17_wiring) | C++17 | 113 ms | 15504 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 <cstdio>
#include <algorithm>
#ifdef debug
#include "grader.cpp"
#endif
using namespace std;
long long min_total_length(std::vector<int> r, std::vector<int> b) {
vector<pair<int,bool>> tbl;
tbl.reserve(r.size()+b.size());
for (auto i:r) {
tbl.push_back({i,false});
}
for (auto i:b) {
tbl.push_back({i,true});
}
sort(tbl.begin(),tbl.end());
vector<vector<int>> block;
block.push_back(vector<int>());
block[0].push_back(tbl[0].first);
vector<vector<long long>> pref;
pref.push_back(vector<long long>());
pref[0].push_back(tbl[0].first);
for (int i=1;i<(int)tbl.size();i++) {
if (tbl[i].second!=tbl[i-1].second) {
block.push_back(vector<int>());
# | 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... |