摘要:BaoBao has just found a rooted tree with n vertices and (n-1) weighted edges in his backyard. Among the vertices, of them are red, while the others ar
阅读全文
摘要:Problem Description度度熊参与了喵哈哈村的商业大会,但是这次商业大会遇到了一个难题:喵哈哈村以及周围的村庄可以看做是一共由n个片区,m条公路组成的地区。由于生产能力的区别,第i个片区能够花费a[i]元生产1个商品,但是最多生产b[i]个。同样的,由于每个片区的购买能力的区别,第i个
阅读全文
摘要:描述 A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路。每一条道路对车辆都有重量限制,简称限重。现在有 q 辆货车在运输货物,司机们想知道每辆车在不超过车辆限重的情况下,最多能运多重的货物。 A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路。每一条道路对车辆都
阅读全文
摘要:题意 有三种药丸,白色W>红色R>蓝色B,给你m个约束条件,问你n个药丸的颜色,不能确定颜色输出‘?’ 题解 如果1<2<3,只要找到2就能确定1和3的颜色 如果2=4,只要确定一个就能确定另一个 处理的时候先把=用并查集处理一下 在处理<和>号 代码
阅读全文
摘要:Problem Description There is a rooted tree with n nodes, number from 1-n. Root’s number is 1.Each node has a value ai. Initially all the node’s value
阅读全文
摘要:Given a rooted tree ( the root is node 1 ) of N nodes. Initially, each node has zero point.Then, you need to handle Q operations. There're two types:1
阅读全文
摘要:Description We are supposed to make a budget proposal for this multi-site competition. The budget proposal is a matrix where the rows represent differ
阅读全文
摘要:Problem Description Tom is a commander, his task is destroying his enemy’s transportation system. Let’s represent his enemy’s transportation system as
阅读全文
摘要:"Oh, There is a bipartite graph.""Make it Fantastic."X wants to check whether a bipartite graph is a fantastic graph. He has two fantastic numbers, an
阅读全文
摘要:Problem DescriptionYou are the hero who saved your country. As promised, the king will give you some cities of the country, and you can choose which o
阅读全文
摘要:Problem Description度度熊国王率领着喵哈哈族的勇士,准备进攻哗啦啦族。哗啦啦族是一个强悍的民族,里面有充满智慧的谋士,拥有无穷力量的战士。所以这一场战争,将会十分艰难。为了更好的进攻哗啦啦族,度度熊决定首先应该从内部瓦解哗啦啦族。第一步就是应该使得哗啦啦族内部不能同心齐力,需要内部
阅读全文
摘要:Problem DescriptionYou may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it is threatened by t
阅读全文
摘要:At the start of the matrix game, we have an N x M matrix. Each grid has some balls.The grid in (i,j) (0 ≤ i < N, 0 ≤ j < M) has Aij balls.In each oper
阅读全文
摘要:During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled eni
阅读全文
摘要:There are N cities in the country, and M directional roads from u to v(1≤u,v≤n). Every road has a distance ci. Haze is a Magical Girl that lives in Ci
阅读全文
摘要:描述 有一位使者要游历各国,他每到一个国家,都能学到一种文化,但他不愿意学习任何一种文化超过一次,即如果他学习了某种文化,则他就不能到达其他有这种文化的国家。不同的国家可能有相同的文化。不同文化的国家对其他文化的看法不同,有些文化会排斥外来文化,即如果他学习了某种文化,则他不能到达排斥这种文化的其他
阅读全文