# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
932481 | andrei_boaca | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 226 ms | 206652 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e17;
map<ll,ll> nrm;
ll nr;
vector<ll> muchii[200005];
ll n,par[200005],v[200005],cost[200005];
ll dp[5005][5005];
void dfs(ll nod)
{
for(ll i:muchii[nod])
{
dfs(i);
for(int j=nr;j>=1;j--)
dp[nod][j]+=dp[i][j];
}
for(int i=1;i<=nr;i++)
if(i!=v[nod])
dp[nod][i]+=cost[nod];
for(int i=nr-1;i>=1;i--)
dp[nod][i]=min(dp[nod][i],dp[nod][i+1]);
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
vector<ll> vals;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |