제출 #1245342

#제출 시각아이디문제언어결과실행 시간메모리
1245342vidux전선 연결 (IOI17_wiring)C++17
0 / 100
12 ms1348 KiB
#include "wiring.h" #include "bits/stdc++.h" using namespace std; #define ALL(x) (x.begin()), (x.end()) #define RALL(x) (x.rbegin()), (x.rend()) #define SZ(x) ((int)x.size()) #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<vl> vvl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n = SZ(r), m = SZ(b); sort(ALL(r)); sort(ALL(b)); ll ans = 0; for (int i : r) ans += r[n-1]-i; for (int i : b) ans += i-b[0]; ans += max(n, m)*(b[0]-r[n-1]); return ans; }
#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...