Submission #420301

#TimeUsernameProblemLanguageResultExecution timeMemory
420301temurbek_khujaevWiring (IOI17_wiring)C++17
13 / 100
31 ms3748 KiB
#include <bits/stdc++.h> #include "wiring.h" using namespace std; #define N 402 const long long INF = 1e18; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n = r.size(); int m = b.size(); long long ans = 0; for (int i = 0; i < min(n, m); i++) { ans += abs(r[i] - b[i]); } for (int i = min(n, m); i < max(n, m); i++) { if (n < m) { ans += abs(r[n - 1] - b[i]); } else { ans += abs(b[0] - r[i]); }; } 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...