제출 #984485

#제출 시각아이디문제언어결과실행 시간메모리
984485Marcus도로 폐쇄 (APIO21_roads)C++17
7 / 100
46 ms6972 KiB
#include "roads.h" #include <vector> #include <bits/stdc++.h> using namespace std; #define ll long long std::vector<long long> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) { vector<ll> dp(N); dp[0] = 0; dp[1] = W[0]; ll total = 0; for (auto u: W) {total += u;} for (int i=2; i<N; i++) { dp[i] = min(dp[i-2], dp[i-1]) + W[i-1]; } vector<ll> answer = {total, min(dp[N-1], dp[N-2])}; for (int i=0; i<N-2; i++) {answer.push_back(0);} return answer; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...