Submission #600585

#TimeUsernameProblemLanguageResultExecution timeMemory
600585pakhomoveeWiring (IOI17_wiring)C++17
13 / 100
25 ms3748 KiB
#include "wiring.h" #include <algorithm> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { long long ans = 0; int red = r.size(); int blue = b.size(); for (int i = 0; i < red - blue; ++i) { ans += b[0] - r[i]; } int ptr = max(0, red - blue); for (int i = 0; i < blue; ++i) { ans += b[i] - r[min(red - 1, ptr++)]; } return ans; }
#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...