Submission #409729

#TimeUsernameProblemLanguageResultExecution timeMemory
409729dreezyWiring (IOI17_wiring)C++17
13 / 100
30 ms3780 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll min_total_length(vector<int> r, vector<int> b){ ll ans = 0; int n = r.size(); int m = b.size(); if(n < m){ for(int i =0; i<n; i++){ ans+= b[i] - r[i]; } for(int i = n; i < m; i++) ans+= b[i] - r[n-1]; } else{ for(int i =0; i<m; i++){ ans+= b[i] - r[i]; } for(int i = m; i < n; i++) ans+= b[0] - r[i]; } return ans; } /* int main(){ //int n, m; cin >> n >> m; int r[5] = {1,2,3,4,5}; int b[5] = {2,3,4,5,6}; cout << min_total_length(r, b)<<endl; }*/
#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...