| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 390783 | alishahali1382 | Wiring (IOI17_wiring) | C++14 | 30 ms | 6184 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>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define debug(x) {cerr<<#x<<"="<<x<<"\n";}
#define debug2(x, y) {cerr<<#x<<", "<<#y<<" = "<<x<<", "<<y<<"\n";}
#define pb push_back
#define all(x) x.begin(), x.end()
const int inf=1000000100;
const int MAXN=5010;
int n, m, k;
ll dp[205][205];
ll min_total_length(vector<int> R, vector<int> B){
memset(dp, 63, sizeof(dp));
dp[0][0]=0;
for (int i=1; i<=R.size(); i++) for (int j=1; j<=B.size(); j++){
int d=abs(R[i-1]-B[j-1]);
dp[i][j]=min({dp[i-1][j], dp[i][j-1], dp[i-1][j-1]}) + d;
}
return dp[R.size()][B.size()];
}
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... | ||||
