Balls Rearrangement Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1661 Accepted Submission(s): 627 Problem Description Bob has N balls and A boxes. He numbers the balls from 0 to N-1, and…
http://acm.hdu.edu.cn/showproblem.php?pid=4803 话说C++还卡精度么? G++ AC C++ WA 我自己的贪心策略错了 -- 就是尽量下键,然后上键,最后下键补全,可是例子都过不了..... 题解參考http://www.cnblogs.com/xuesu/p/3967704.html http://www.cnblogs.com/Canon-CSU/p/3451784.html http://blog.csdn.net/keshuai199…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5178 pairs Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3090 Accepted Submission(s): 1085 Problem Description John has n points on the X axi…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6229 参考题解:https://blog.csdn.net/lifelikes/article/details/78452558 https://www.cnblogs.com/cxhscst2/p/8215717.html #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsig…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6233 题意:一个树上有m个人,每个人在某个节点上,每个时刻每个人可以和一个与他距离大于 1 的点进行交流,然后往交流的人的方向走一步,当他一个人没有可以交流的人时就不可以走了,问所有人都不走的期望时间是多少. 题解:假设 t 时刻两个距离最远的人的距离为 x,则在 t + 1 时刻这两个人距离为 x - 2,因为这两个人在这一时刻走的方向是一定的,而在 t 时刻距离为 x - 1 的两个人,因为题目…
Cowl is good at solving math problems. One day a friend asked him such a question: You are given a cube whose edge length is N, it is cut by the planes that was paralleled to its side planes into N * N * N unit cubes. Two unit cubes may have no commo…