题意是一只虫子在深度为 n 的井中,每分钟向上爬 u 单位,下一分钟会下滑 d 单位,问几分钟能爬出井. 本人是直接模拟的,这篇博客的分析比较好一些,应当学习这种分析问题的思路:http://www.cnblogs.com/A--Q/p/5719353.html 代码如下: #include <bits/stdc++.h> using namespace std; int main() { int n,u,d,pos,ans; while(~scanf("%d%d%d",&…
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsum 贪心 HDU 1004 Let the Balloon Rise 字典树,map HDU 1005 Number Sequence 求数列循环节 HDU 1007 Quoit Design 最近点对 HDU 1008 Elevator 模拟 HDU 1010 Tempter of th…
The King’s Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2947 Accepted Submission(s): 1049 Problem Description In the Kingdom of Silence, the king has a new problem. There are N cit…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…