# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
329171 | ant101 | Wiring (IOI17_wiring) | C++14 | 781 ms | 7300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "wiring.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
long long dp[200002];
long long dp1[202][202];
long long inf = 1e15;
long long fun(vector <int> x, vector <int> y){
long long ans = 0;
if(x.size() == 0 || y.size()==0)
return inf;
for(int i = 0 ; i <= x.size() ;i++){
for(int j = 0 ; j <= y.size() ; j++){
dp1[i][j]=inf;
}
}
dp1[0][0]=0;
for(int i = 0 ; i < x.size() ;i++){
for(int j = 0 ; j < y.size() ; j++){
dp1[i+1][j+1] = min(dp1[i][j] , min(dp1[i][j+1] , dp1[i+1][j] ) ) + + abs(x[i] - y[j]);
}
}
return dp1[x.size()][y.size()];
}
long long min_total_length(std::vector<int> r, std::vector<int> b) {
deque < pair <int, int> > pr;
//sort(r.begin(), r.end());
//sort(b.begin(), b.end());
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |