제출 #812545

#제출 시각아이디문제언어결과실행 시간메모리
812545Dan4Life전선 연결 (IOI17_wiring)C++17
13 / 100
27 ms3796 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; #define sz(a) (int)a.size() #define all(a) begin(a),end(a) using ll = long long; ll min_total_length(vector<int> a, vector<int> b) { int n = sz(a), m = sz(b); ll tot = 0; for(int i = 0; i < m; i++) tot+=b[i]; for(int i = 0; i < n; i++) tot-=a[i]; if(n<m){ for(int i = 0; i < m-n; i++) tot-=a.back(); } else if(n>m){ for(int i = 0; i < n-m; i++) tot+=b[0]; } return tot; }
#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...