首页 > TAG信息列表 > CF796C
CF796C 攻击银行
1 CF796C 攻击银行 题目链接:https://codeforces.com/problemset/problem/796/c 2 题目描述 时间限制 \(2s\) | 空间限制 \(256M\) 给出一个有 \(n\) 个银行和 \(n-1\) 根连接它们的电线的地图,银行从 \(1\) 到 \(n\) 依次编号,地图上的每个银行有一个防火墙强度 \(a_i\) 和两CF796C Bank Hacking
题意:给定一棵树,每个节点上有一个银行,最初所有银行全部在线,有一只狗想要打下所有银行(没错是狗),每个银行都有一个安全值,狗的电脑的值必须大于等于所攻下银行的安全值,且每打下一个银行后和它距离为1和2的点的安全值都会在原来的基础上加1,求如果这只超级赛亚狗想要打下CF796C Bank Hacking 题解
题目描述 Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of which he sadly has none. To deal with the problem, he has decided to hack the banks. There are n banks, numbCF796C Bank Hacking 细节
思路十分简单,答案只有 3 种可能,但是有一些细节需要额外注意一下. code: #include <bits/stdc++.h>#define N 300002 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int val[N],hd[N],to[N<<1],nex[N<<1],d1[N],d2[N],n,edges,maxx,mx,m