제출 #738423

#제출 시각아이디문제언어결과실행 시간메모리
738423Toxtaq전선 연결 (IOI17_wiring)C++17
13 / 100
24 ms3788 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[0] - r[i]; } } 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...