[HDU - 5408] CRB and Farm】的更多相关文章

题意: 给出一个由n个点组成的凸包,以及凸包内的k个点,问是否能够在凸包上选择最多2k个点构造一个新的 凸包,使得新的凸包覆盖原来的k个点. 要求2k个点覆盖原本的k个点,只要对原k个点构造凸包,然后选择该凸包内一点O与该凸包的顶点连一条射线,其 与大凸包相交的边的两端点即为要保留的点,小凸包的顶点个数<=k,所有结果最后一定存在. #include<cstdio> #include<iostream> #include<cstring> #include<…
题目链接: Hdu 5416 CRB and Tree 题目描述: 给一棵树有n个节点,树上的每条边都有一个权值.f(u,v)代表从u到v路径上所有边权的异或值,问满足f(u,v)==m的(u, v)有多少中情况(u, v有可能相同)? 解题思路: 由于xor的特殊性质.x^x=0,对于求f(u, v) == f(u, 1) ^ f(1, u). 又因为x^y == z可以推出x^z == y,对于f(u, 1) ^ f(1, v) == m可以转化为m ^ f(1, v) == f(u, 1)…
题目链接: Hdu 5407 CRB and Candies 题目描述: 给出一个数n,求lcm(C(n,0),C[n,1],C[n-2]......C[n][n-2],C[n][n-1],C[n][n])%(1e9+7)是多少? 解题思路: 刚开始的时候各种开脑洞,然后卡题卡的风生水起.最后就上了数列查询这个神奇的网站,竟然被我找到了!!!!就是把题目上给的问题转化为求lcm(1, 2, 3, 4 ...... n-2, n-1, n, n-1) / (n+1),扎扎就打了两个表一个lcm[n…
CRB and Tree Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2112    Accepted Submission(s): 635 Problem Description CRB has a tree, whose vertices are labeled by 1, 2, …, N. They are connected…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5412 CRB and Queries Description There are $N$ boys in CodeLand. Boy i has his coding skill $A_{i}$. CRB wants to know who has the suitable coding skill. So you should treat the following two types of qu…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5412 Problem Description There are N boys in CodeLand. Boy i has his coding skill Ai. CRB wants to know who has the suitable coding skill. So you should treat the following two types of queries. Query 1…
CRB and His Birthday Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 430    Accepted Submission(s): 237 Problem Description Today is CRB's birthday. His mom decided to buy many presents for her…
Problem Description Today is CRB's birthday. His mom decided to buy many presents for her lovely son. She went to the nearest shop with M Won(currency unit). At the shop, there are N kinds of presents. It costs Wi Won to buy one present of i-th kind.…
Problem Description There are N boys in CodeLand.Boy i has his coding skill Ai.CRB wants to know who has the suitable coding skill.So you should treat the following two types of queries.Query 1: 1 l vThe coding skill of Boy l has changed to v.Query 2…
CRB and Roads Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 495    Accepted Submission(s): 225 Problem Description There are N cities in Codeland.The President of Codeland has a plan to con…