Submission #72938

#TimeUsernameProblemLanguageResultExecution timeMemory
72938NavickWiring (IOI17_wiring)C++17
13 / 100
43 ms2144 KiB
#include <bits/stdc++.h> #include "wiring.h" #define F first #define S second #define pii pair <int, int> #define pb push_back using namespace std; typedef long long ll; const int maxN = 210; const ll oo = 1e16; ll dp[maxN][maxN]; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n = r.size(), m = b.size(); ll ans = 0; for (int i=0; i<m; i++) ans += b[i]; for (int i=0; i<n; i++) ans -= r[i]; if(n > m) ans += (ll)b[0] * (n - m); else ans -= (ll)r[n - 1] * (m - n); 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...