# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
409750 | shahriarkhan | The Xana coup (BOI21_xanadu) | C++14 | 100 ms | 21568 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 ;
const int INF = 1e9 , mx = 1e5 + 5 ;
vector<int> adj[mx] ;
long long dp[mx][2][2] ;
int col[mx] ;
void calc(int s , int p)
{
long long add1 = INF , add2 = INF , cnt1 = 0 , cnt2 = 0 , tot1 = 0 , tot2 = 0 ;
for(int t : adj[s])
{
if(t==p) continue ;
calc(t,s) ;
if(dp[t][0][1]<dp[t][0][0])
{
++cnt1 ;
tot1 += dp[t][0][1] ;
add1 = min(add1,dp[t][0][0] - dp[t][0][1]) ;
}
else
{
tot1 += dp[t][0][0] ;
add1 = min(add1,dp[t][0][1] - dp[t][0][0]) ;
}
if(dp[t][1][1]<dp[t][1][0])
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |