# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1096100 | 0pt1mus23 | Parkovi (COCI22_parkovi) | C++14 | 2 ms | 604 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;
#define endl '\n'
#define int long long int
#define ins insert
#define pb push_back
#define putr(x) cout<<x<<endl;return;
#define all(x) x.begin(),x.end()
#define _ << " " <<
const int mod = 1e9+7 ,
sze= 500 ,
inf = 1e15,
L = 31 ;
vector<pair<int,int>> graph[sze];
vector<int> alst;
int dp[sze][2];
void dfs(int node,int par,int mid){
for(auto [a,b]:graph[node]){
if(a!=par){
dfs(a,node,mid);
dp[node][0] = min(dp[node][0],dp[a][0] + b);
if(dp[a][1] + b <= mid){
dp[node][1]=max(dp[node][1],dp[a][1] + b);
}
else{
// cout<<mid<<" => "<<a<<endl;
alst.pb(a);
dp[node][0]=min(dp[node][0],b);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |