随笔分类 -  数学

摘要:DescriptionMr. O'Cruel is teaching Math to ninth grade students. Students of course are very lazy, so they do not like to do their homework. On the ot... 阅读全文
posted @ 2015-04-02 08:11 TCtower 阅读(439) 评论(0) 推荐(0)
摘要:Description考虑正整数集合,现在有n组人依次来取数,假设第i组来了x人,他们每个取的数一定是x的倍数,并且是还剩下的最小的x个。正整数中有m个数被标成了幸运数,问有哪些人取到了幸运数。Input第一行一个正整数m (m<=1,000,000),下面m行每行一个正整数x (x<=1,000,... 阅读全文
posted @ 2015-04-01 22:44 TCtower 阅读(281) 评论(0) 推荐(0)
摘要:Description硬币购物一共有4种硬币。面值分别为c1,c2,c3,c4。某人去商店买东西,去了tot次。每次带di枚ci硬币,买si的价值的东西。请问每次有多少种付款方法。Input第一行 c1,c2,c3,c4,tot 下面tot行 d1,d2,d3,d4,sOutput每次的方法数Sam... 阅读全文
posted @ 2015-04-01 21:51 TCtower 阅读(226) 评论(0) 推荐(0)
摘要:Vanya decided to walk in the field of size n × n cells. The field contains m apple trees, the i-th apple tree is at the cell with coordinates (xi, yi)... 阅读全文
posted @ 2015-04-01 21:37 TCtower 阅读(267) 评论(0) 推荐(0)
摘要:Vasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function P(x) = a0 + a1x1 ... 阅读全文
posted @ 2015-04-01 21:00 TCtower 阅读(343) 评论(0) 推荐(0)
摘要:Description 有一张N×m的数表,其第i行第j列(1 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include ... 阅读全文
posted @ 2015-04-01 10:35 TCtower 阅读(351) 评论(0) 推荐(0)
摘要:Description 有一天Petya和他的朋友Vasya在进行他们众多旅行中的一次旅行,他们决定去参观一座城堡博物馆。这座博物馆有着特别的样式。它包含由m条走廊连接的n间房间,并且满足可以从任何一间房间到任何一间别的房间。两个人在博物馆里逛了一会儿后两人决定分头行动,去看各自感兴趣的艺术品。他... 阅读全文
posted @ 2015-03-31 22:36 TCtower 阅读(418) 评论(0) 推荐(0)
摘要:All submissions for this problem are available.Read problems statements in Mandarin Chinese and Russian.This problem's statement is really a short on... 阅读全文
posted @ 2015-03-31 21:26 TCtower 阅读(368) 评论(0) 推荐(0)
摘要:Description根据一些书上的记载,上帝的一次失败的创世经历是这样的:第一天, 上帝创造了一个世界的基本元素,称做“元”。第二天, 上帝创造了一个新的元素,称作“α”。“α”被定义为“元”构成的集合。容易发现,一共有两种不同的“α”。第三天, 上帝又创造了一个新的元素,称作“β”。“β”被定义... 阅读全文
posted @ 2015-03-31 20:32 TCtower 阅读(1171) 评论(0) 推荐(1)
摘要:Vasya is sitting on an extremely boring math class. To have fun, he took a piece of paper and wrote out nnumbers on a single line. After that, Vasya b... 阅读全文
posted @ 2015-03-31 20:06 TCtower 阅读(419) 评论(0) 推荐(0)
摘要:DescriptionHH有个一成不变的习惯,喜欢饭后百步走。所谓百步走,就是散步,就是在一定的时间 内,走过一定的距离。 但是同时HH又是个喜欢变化的人,所以他不会立刻沿着刚刚走来的路走回。 又因为HH是个喜欢变化的人,所以他每天走过的路径都不完全一样,他想知道他究竟有多 少种散步的方法。 现在给... 阅读全文
posted @ 2015-03-31 17:16 TCtower 阅读(196) 评论(0) 推荐(0)
摘要:DescriptionA young schoolboy would like to calculate the sum for some fixed natural k and different natural n. He observed that calculating ik for all... 阅读全文
posted @ 2015-03-31 09:07 TCtower 阅读(347) 评论(0) 推荐(0)
摘要:试题来源 2013中国国家集训队第二次作业问题描述 刚刚解决完电力网络的问题, 阿狸又被领导的任务给难住了. 刚才说过, 阿狸的国家有n个城市, 现在国家需要在某些城市对之间建立一些贸易路线, 使得整个国家的任意两个城市都直接或间接的连通. 为了省钱, 每两个城市之间最多只能有一条直接的贸易... 阅读全文
posted @ 2015-03-30 20:09 TCtower 阅读(625) 评论(0) 推荐(0)
摘要:Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not ... 阅读全文
posted @ 2015-03-30 17:51 TCtower 阅读(174) 评论(0) 推荐(0)
摘要:【问题描述】给出n个数qi,给出Fj的定义如下:令Ei=Fi/qi。试求Ei。【输入格式】输入文件force.in包含一个整数n,接下来n行每行输入一个数,第i行表示qi。【输出格式】输出文件force.out有n行,第i行输出Ei。与标准答案误差不超过1e-2即可。【样例输入】54006373.8... 阅读全文
posted @ 2015-03-30 11:46 TCtower 阅读(316) 评论(0) 推荐(1)
摘要:问题描述 给定三次函数f(x)=ax3+bx2+cx+d的4个系数a,b,c,d,以及一个数z,请用牛顿迭代法求出函数f(x)=0在z附近的根,并给出迭代所需要次数。 牛顿迭代法的原理如下(参考下图): 设xk是方程f(x)=0的精确解x*附近的一个猜测解,过点Pk(xk,f(xk))作f(x... 阅读全文
posted @ 2015-03-30 08:36 TCtower 阅读(569) 评论(0) 推荐(0)
摘要:问题描述 离散傅立叶变换在信号处理中扮演者重要的角色。利用傅立叶变换,可以实现信号在时域和频域之间的转换。 对于一个给定的长度为n=2m (m为整数) 的复数序列X0, X1, …, Xn-1,离散傅立叶变换将得到另一个长度为n的复数序列Y0, Y1, …, Yn-1。其中 Yi=X0+X1w... 阅读全文
posted @ 2015-03-30 07:48 TCtower 阅读(304) 评论(0) 推荐(0)
摘要:Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not ... 阅读全文
posted @ 2015-03-29 20:21 TCtower 阅读(208) 评论(0) 推荐(0)
摘要:DescriptionGiven a big integer number, you are required to find out whether it's a prime number.InputThe first line contains the number of test cases ... 阅读全文
posted @ 2015-03-27 19:04 TCtower 阅读(179) 评论(0) 推荐(0)
摘要:转载:http://trinklee.blog.163.com/blog/static/23815806020150155296528/问题描述:众所周知,在国王胖哥的带领下,K国国泰民安,空前繁荣,但今天K国却遇到了空前的危机。在K国境内同时发现了n个未知的病毒,每个病毒会从它被发现的位置开始感染... 阅读全文
posted @ 2015-03-27 15:55 TCtower 阅读(425) 评论(0) 推荐(0)