| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1215805 | loom | 도로 폐쇄 (APIO21_roads) | C++20 | 24 ms | 3400 KiB |
#include "roads.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 5e18
#define nl '\n'
vector<ll> minimum_closure_costs(int n, vector<int> a, vector<int> b, vector<int> w){
vector<ll> ans(n);
ans[0] = accumulate(w.begin(), w.end(), 0ll);
for(ll i=2; i<n; i++) ans[i] = 0;
ll dp[2];
dp[0] = 0;
dp[1] = w[0];
for(ll i=1; i<n-1; i++){
ll x = dp[0];
dp[0] = max(dp[0], dp[1]);
dp[1] = x + w[i];
}
ans[1] = ans[0] - max(dp[0], dp[1]);
return ans;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
