제출 #72851

#제출 시각아이디문제언어결과실행 시간메모리
72851mr_banana전선 연결 (IOI17_wiring)C++17
7 / 100
46 ms4596 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; const int MN=200+10; long long dp[MN][MN]; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n=r.size(),m=b.size(); for(int i=0;i<n;i++){ dp[i+1][0]=1e13; } for(int i=0;i<m;i++){ dp[0][i+1]=1e13; } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ dp[i+1][j+1]=abs(r[i]-b[j])+min(dp[i][j],min(dp[i][j+1],dp[i+1][j])); } } 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...