Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

qinziao's blog

By qinziao, history, 2 months ago, In English
Your code here...
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dfs(int u)
{
    if(u==1)
    {
		ll minn=LONG_LONG_MAX;
		for(v|u->v)
		{
			minn=min(dfs(v),minn);
		}
		return value[u]+minn;
	}
	if(son[u]==0)
		return value[u];
	if(son[u]==1)
		return (value[u]+dfs(v))>>1;
	if(son[u]>1)
	{
		ll minn=LONG_LONG_MAX;
		for(v|u->v)
		{
			minn=min(dfs(v),minn);
		}
		return minn;
	}
}
int main()
{
	cout<<dfs(1)<<endl;
	return 0;
}

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it