数论
liang_all
这个作者很懒,什么都没留下…
展开
-
HDU 2152 母函数
FruitProblem Description转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。于是,很多人们慕名而来,找Lele买水果。甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,"我要买由M个水果组成的水果拼盘,不过我有原创 2013-08-05 15:25:31 · 476 阅读 · 0 评论 -
HDU 1019 求多个数的最小公倍数
Least Common MultipleProblem DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For exa原创 2013-08-01 18:54:55 · 496 阅读 · 0 评论 -
HDU 1212 求大数余数
Big NumberProblem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make t原创 2013-08-01 19:28:57 · 375 阅读 · 0 评论 -
一元多次方程的解
给出y,求方程y=8*x^4+7*x^3+2*x^2+3*x+6在0-100的解二分法求解!!!#include#includeusing namespace std;double fun(double x){ return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6;}int main(){ int t; double y,原创 2013-08-03 19:13:45 · 2647 阅读 · 0 评论 -
HDU 1398 母函数
Square CoinsProblem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to原创 2013-08-04 08:17:38 · 417 阅读 · 0 评论 -
HDU 1709 母函数
The Balance Problem Description Now you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you should find out the qual原创 2013-08-04 15:31:45 · 393 阅读 · 0 评论 -
HDU 1085 母函数
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12117 Accepted Submission(s): 5420Problem DescriptionWe原创 2013-08-04 16:26:00 · 443 阅读 · 0 评论 -
HDU 2069 母函数
Coin ChangeProblem DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For ex原创 2013-08-05 11:21:31 · 539 阅读 · 0 评论 -
HDU 1171 母函数
Big Event in HDUTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18493 Accepted Submission(s): 6472Problem Description Nowada原创 2013-08-04 10:35:10 · 383 阅读 · 0 评论 -
HDU 2100 a+b类型的题目
LovekeyTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4680 Accepted Submission(s): 1511Problem DescriptionXYZ-26进制数是一个每位都是大写字母的数原创 2013-08-01 18:40:23 · 459 阅读 · 0 评论 -
HDU 1042 N!
N!Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in on原创 2013-08-01 19:55:11 · 442 阅读 · 0 评论 -
HDU 1753 小数的大数相加
大明A+BProblem Description话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。 Input本题目包含多组测试数据,请处理到文件结束。每一组原创 2013-08-02 11:11:35 · 468 阅读 · 0 评论 -
HDU 1002 大数
A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 166238 Accepted Submission(s): 31770Problem DescriptionI have a v原创 2013-08-02 12:42:24 · 417 阅读 · 0 评论 -
用牛顿迭代法求根号2及sqrt(任意数),连续求解,保留小数点后16位
#include#includeint main(){ double a,x0,x1; while(scanf("%lf",&a)!=EOF) { x0=0.5*(1+a); x1=0.5*(x0+a/x0); while(fabs(x1-x0)>=1e-10) {转载 2013-08-03 20:59:11 · 2647 阅读 · 1 评论 -
HDU 1028 母函数
Ignatius and the Princess IIIProblem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given原创 2013-08-04 00:58:13 · 485 阅读 · 0 评论 -
约瑟环夫问题
n个人 从1至N开始顺序循环数数,每数到M时,将该数字退出,继续从下个人开始数,最后一个推出的为胜利者把问题变成0-n-1(编号变了而已),第一个人出列之后,(第一个人编号一定是m%n-1)剩下的是n-1个人,编号从0-(n-2)组成一个新的约瑟环夫问题接下去就是从编号m%n开始计数k k+1 k+2 ... n-2, n-1, 0, 1, 2, ... k-2并原创 2013-08-21 16:35:22 · 983 阅读 · 0 评论