数学
文章平均质量分 67
明天--会更好
规划努力总结
展开
-
HDU 1418 抱歉(欧拉公式)
如果平面上有n个点,并且每个点至少有2条曲线段和它相连,就是说,每条曲线都是封闭的,同时,我们规定:1)所有的曲线段都不相交;2)但是任意两点之间可以有多条曲线段。如果我们知道这些线段把平面分割成了m份,你能知道一共有多少条曲线段吗?Input输入数据包含n和m,n=0,m=0表示输入的结束,不做处理。所有输入数据都在32位整数范围内。Outpu原创 2013-08-15 15:32:16 · 558 阅读 · 0 评论 -
HDU 1335 Basically Speaking(进制转换问题)
The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company that it would be neato原创 2013-08-15 08:58:00 · 508 阅读 · 0 评论 -
HDU 1194 Beat the Spread!
Problem DescriptionSuperbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the原创 2013-08-13 14:46:50 · 733 阅读 · 0 评论 -
杭电1163--Eddy's digital Roots (九余数定理)
Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result原创 2013-08-13 13:02:02 · 550 阅读 · 0 评论 -
HDU 1395 2^x mod n = 1
题目中给出输入一个整数n,要求一个最小整数的x,使得2^x mod n=1;根据模P乘法逆元:对于整数a、p如果存在整数b,满足a*b mod p=1则称b是a的模P乘法逆元。a存在模P的乘法逆元的充要条件是gcd(a,p)=1,令a=2^x,b=1,p=n则若存在x使用2^x mod n=1则gcd(2^x,n)=1(1)因为要求x的值大于0。则2^x的因子中只有原创 2013-08-15 10:37:14 · 973 阅读 · 0 评论 -
HDU 2056 Rectangles (求两个相交矩形面积)
Problem DescriptionGiven two rectangles and the coordinates of two points on the diagonals of each rectangle,you have to calculate the area of the intersected part of two rectangles. its sides are p原创 2013-08-19 11:37:41 · 1604 阅读 · 0 评论 -
HDU 2050 直线相交问题(参考大牛总结)
(1) n条直线最多分平面问题 题目大致如:n条直线,最多可以把平面分为多少个区域。 析:可能你以前就见过这题目,这充其量是一道初中的思考题。但一个类型的题目还是从简单的入手,才容易发现规律。当有n-1条直线时,平面最多被分成了f(n-1)个区域。则第n条直线要是切成的区域数最多,就必须与每条直线相交且不能有同一交点。这样就会得到n-1个交点。这些交点将原创 2013-08-19 13:03:49 · 543 阅读 · 0 评论 -
HDU 2114 Calculate S(n) (公式)
Problem DescriptionCalculate S(n).S(n)=13+23 +33 +......+n3 .InputEach line will contain one integer N(1 OutputFor each case, output the last four dights of S(N) in one line.原创 2013-08-22 09:01:50 · 832 阅读 · 0 评论 -
HDU 2139 Calculate the formula公式 1^2+3^2+5^2+...+(2n-1)^2 ==n*(n+1)*(n+2)/6
Problem DescriptionYou just need to calculate the sum of the formula: 1^2+3^2+5^2+……+ n ^2.InputIn each case, there is an odd positive integer n.OutputPrint the sum. Make sure the su原创 2013-08-24 10:08:45 · 974 阅读 · 0 评论