# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
538625 | Jarif_Rahman | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 330 ms | 524288 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>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
int n;
vector<vector<int>> v;
vector<vector<ll>> dp;
vector<int> h;
vector<ll> cost;
void dfs(int nd){
for(int x: v[nd]) dfs(x);
for(int x: v[nd]) for(int i = 0; i < n; i++) dp[nd][i]+=dp[x][i];
for(int i = h[nd]+1; i < n; i++){
dp[nd][i]+=cost[nd];
}
for(int i = h[nd]-1; i >= 0; i--){
dp[nd][i] = min(dp[nd][i+1], dp[nd][i]+cost[nd]);
}
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |