제출 #1199859

#제출 시각아이디문제언어결과실행 시간메모리
1199859LolkasMeepWiring (IOI17_wiring)C++20
0 / 100
0 ms580 KiB
#include "bits/stdc++.h" using namespace std; typedef long long int ll; ll min_total_length(vector<int> r, vector<int> b){ int dp[205][205]; int n = r.size(); int m = b.size(); for(int i = 0; i < n+1; i++){ for(int j = 0; j < m+1; j++){ if(i == 0 || j == 0){ dp[i][j] = 0; }else{ dp[i][j] = INT_MAX; dp[i][j] = min(min(dp[i-1][j], dp[i-1][j-1]), dp[i][j-1]) + abs(r[i-1] - b[j-1]); } } } return dp[n][m]; } // int main(){ // int R[] = {1, 2, 3, 7}; // int B[] = {0, 4, 5, 9, 10}; // cout << min_total_length({1, 2, 3, 7}, {0, 4, 5, 9, 10}) << '\n'; // return 0; // }
#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...