hdu-5744 Keep On Movin(思维)】的更多相关文章

Keep On Movin 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5744 Description Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He…
Keep On Movin 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5744 Description Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He…
Keep On Movin Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 76    Accepted Submission(s): 68 Problem Description Professor Zhang has kinds of characters and the quantity of the i-th character…
Keep On Movin Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 275    Accepted Submission(s): 204 Problem Description Professor Zhang has kinds of characters and the quantity of the i-th characte…
题目:传送门. 如果每个字符出现次数都是偶数, 那么答案显然就是所有数的和. 对于奇数部分, 显然需要把其他字符均匀分配给这写奇数字符. 随便计算下就好了. #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> using namespace std; int main() { int T,n,a; scanf("%d",&T);…
HDU 6187 Destroy Walls (思维,最大生成树) Destroy Walls *Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 1784 Accepted Submission(s): 692 * Problem Description Long times ago, there are beautiful histor…
找出奇数个的数有几个,就分几组. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #define N 100005 using namespace std; int n,a[N],k,t,sum; int main(){ scanf("%d",&t); while(t--){ scanf("%d",&n); s…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6161 题意: 题目是给一棵完全二叉树,从上到下从左到右给每个节点标号,每个点有权值,初始权值为其标号,然后有两种操作: 1.把u点权值改为x 2.查询所有经过u点的路径中,路径上的点权和最大. 节点有n个,修改有m个,n<=1e8 ,m<= 1e5 解法:现场队友过的,orz,来自队友的思路. 我们首先对于一个点,如果没有访问我们不把它建出来,相反访问了就把它建出来,这个题的最小的子问题就是计算一…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5538 Problem Description Have you ever played the video game Minecraft? This game has been one of the world's most popular game in recent years. The world of Minecraft is made up of lots of 1×1×1 blocks…
http://acm.hdu.edu.cn/showproblem.php?pid=4747 题意: 我们定义mex(l,r)表示一个序列a[l]....a[r]中没有出现过得最小的非负整数, 然后我们给出一个长度为n的序列,求他所有的连续的子序列的mex(l,r)的和. 思路: 首先因为n的最大值就是2*10^5 所有我们字需要考虑200000之内的数就好了,然后O(2*n)可以求出(1,1),(1,2), (1,3),(1,4) ... (1,n)来 mex是不减的. 然后我们考虑将第一个数…