이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "roads.h"
#include<bits/stdc++.h>
#define pii pair<int,int>
#define f first
#define s second
using namespace std;
using ll = long long;
bool done[100005];
int ct[100005];
vector<int> deg[100005];
vector<long long> minimum_closure_costs(int n, vector<int> U, vector<int> V, vector<int> W) {
for(int i=0;i<n-1;i++) {
ct[U[i]]++;
ct[V[i]]++;
}
for(int i=0;i<n;i++) {
deg[ct[i]].push_back(i);
}
vector<long long> ans(n);
for(int i=2;i<n;i++) ans[i] = 0;
long long even = 0, odd = 0;
for(int i=0;i<n;i++) {
if(i%2) odd += W[i];
else even += W[i];
}
ans[1] = min(even, odd);
ans[0] = even+odd;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |