Submission #630705

#TimeUsernameProblemLanguageResultExecution timeMemory
630705samedWiring (IOI17_wiring)C++17
13 / 100
23 ms3784 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; long long min_total_length(std::vector<int> a, std::vector<int> b) { long long answer = 0; int n = a.size(); int m = b.size(); long long k = b[0]; for(int i=0;i<n;i++) { answer += k - (long long)a[i]; } for(int i=1;i<m;i++) { answer += (long long)b[i] - k; } long long answer2 = 0; k = a[n-1]; for(int i=0;i<m;i++) { answer2 += (long long)b[i] - k; } for(int i=n-1;i>=0;i--) { answer2 += k - (long long)a[i]; } if(n < m)return answer2; return answer; }
#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...