Submission #434229

#TimeUsernameProblemLanguageResultExecution timeMemory
434229OttoTheDinoWiring (IOI17_wiring)C++17
0 / 100
1 ms204 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; #define rep(i,s,e) for (int i = s; i <= e; ++i) #define rrep(i,s,e) for (int i = s; i >= e; --i) #define pb push_back #define pf push_front #define fi first #define se second #define all(a) a.begin(), a.end() typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<double> vd; typedef vector<string> vs; typedef vector<char> vc; typedef vector<ll> vll; ll min_total_length(vi r, vi b) { int n = r.size(), m = b.size(); ll dp[n+1][m+1] = {}; rep (i,1,n) rep (j,1,m) dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]),dp[i-1][j-1])+abs(r[i-1]-b[j-1]); return dp[n][m]; }
#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...