Submission #50642

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
506422018-06-12 05:30:43gnoorWiring (IOI17_wiring)C++17
100 / 100
113 ms15504 KiB
#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>());
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...