| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367824 | sukritp5 | 도로 폐쇄 (APIO21_roads) | C++20 | 17 ms | 4892 KiB |
#include "roads.h"
#include <bits/stdc++.h>
using namespace std;
const int MXN=1e5+7;
int dp[MXN][2];
vector<long long> minimum_closure_costs(int n, vector<int> u,
vector<int> v,vector<int> w) {
vector<long long> ret(n);
long long sum=0;
for(auto x:w)sum+=x;
ret[0]=sum;
// 1 is here 0 is not
for(int i=1;i<n;i++){
dp[i][1]=dp[i-1][0]+w[i-1];
dp[i][0]=max(dp[i-1][0],dp[i-1][1]);
}
ret.emplace_back(sum-max(dp[n-1][0],dp[n-1][1]));
for(int k=2;k<n;k++)ret.emplace_back(0LL);
return ret;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
