Submission #738422

#TimeUsernameProblemLanguageResultExecution timeMemory
738422ToxtaqWiring (IOI17_wiring)C++17
0 / 100
1 ms300 KiB
#include<bits/stdc++.h> using namespace std; /// Sub 2 long long min_total_length(vector<int>r, vector<int>b){ int p1 = r.size() - 1, p2 = b.size() - 1; long long sum = 0; while(p1 >= 0 && p2 >= 0){ sum += b[p2] - r[p1]; p2--; p1--; } if(p1 < 0){ for(int i = p2;i >= 0;--i){ sum += b[i] - r.back(); } } else{ for(int i = p1;i >= 0;--i){ sum += b[i] - r.back(); } } return sum; } //int main() //{ // int n, m; // cin >> n >> m; // vector<int>v(n), l(m); // for(int i = 0;i < n;++i){ // cin >> v[i]; // } // for(int i = 0;i < m;++i){ // cin >> l[i]; // } // cout << min_total_length(v, l); //}
#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...