제출 #391909

#제출 시각아이디문제언어결과실행 시간메모리
391909MilosMilutinovic전선 연결 (IOI17_wiring)C++14
7 / 100
162 ms262148 KiB
/** * author: milos * created: 20.04.2021 07:58:08 **/ #include <bits/stdc++.h> #include "wiring.h" using namespace std; long long min_total_length(vector<int> r, vector<int> b) { int n = (int) r.size(), m = (int) b.size(); if (n <= 200 && m <= 200) { const long long inf = 1e18; vector<vector<long long>> dp(n + 1, vector<long long>(m + 1, inf)); dp[0][0] = 0LL; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { dp[i][j] = min({dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]}) + abs(r[i - 1] - b[j - 1]); } } return dp[n][m]; } }

컴파일 시 표준 에러 (stderr) 메시지

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
#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...