数学
文章平均质量分 85
知足c
Good afternoon, Good evening and Good night~
展开
-
POJ 2182 Lost Cows (递推)
Description N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering hole' and drank a few too man原创 2014-07-08 20:15:40 · 776 阅读 · 0 评论 -
POJ 1365 Prime Land
觉得这题最难的就是理解题意了原创 2014-08-02 22:39:43 · 1279 阅读 · 0 评论 -
UVa 1583 Digit Generator(数)
For a positive integer N , the digit-sum of N is defined as the sum of N itself and its digits. When M is the digitsum of N , we call N a generator of M . For example, the digit-sum of 245 is 256 (原创 2014-07-29 20:59:28 · 833 阅读 · 0 评论 -
codeforces 17A Noldbach problem
Noldbach problem time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Nick is interested in prime numbers. Once h原创 2014-07-29 22:05:59 · 1009 阅读 · 0 评论 -
POJ 3370 Halloween treats(抽屉原理)
题意 有c个小孩 n个大人万圣节搞活动 当小孩进入第i个大人家里时 这个大人就会给小孩a[i]个糖果 求小孩去哪几个大人家可以保证得到的糖果总数是小孩数c的整数倍 多种方案满足输出任意一种 用s[i]表示前i个打人给糖果数的总和 令s[0]=0 那么s[i]共有n+1种不同值 而s[i]%c最多有c种不同值 题目说了c 这就是抽屉原理了 n个抽屉放大于n个苹果原创 2014-08-19 21:54:16 · 1023 阅读 · 0 评论 -
POJ 1840 Eqs(hash)
题意 输入a1,a2,a3,a4,a5 求有多少种不同的x1,x2,x3,x4,x5序列使得等式成立 a,x取值在-50到50之间 直接暴力的话肯定会超时的 100的五次方 10e了都 然后可以考虑将等式变一下形 把a1*x1^3+a2*x2^3移到右边 也就是-(a1*x1^3+a2^x2^3)=a3*x3^3+a4*x4^3+a5*x5^3 考虑到a1*x1^3原创 2014-08-20 08:40:10 · 1026 阅读 · 0 评论 -
POJ 3292 Semi-prime H-numbers(数)
题意 所有可以表示为4*k+1(k>=0)的数都称为“H数” 而在所有“H数”中只能被1和自身整除的H数称为“H素数“ 能表示成两个”H素数“积的数又称为”Semi-prime H数“ 输入n 求1到n之间有多少个”Semi-prime H数“; 方法 先打个H素数表 再用H素数表中的数依次相乘 得到的数都标记 再用一个数组保存每个数以内的标记数 输入n后直接读数组就行了原创 2014-08-07 21:24:12 · 935 阅读 · 0 评论 -
POJ 3993 Not So Flat After All(质因数)
题意 给你两个数a,b 求a,b所有的质因数个数 和每个质因数个数的差的绝对值的和 被描述得好复杂 理解了就是个水题; 素数问题就先打个素数表吧 然后能被整除的就是质因数了 然后统计a,b分别能被这个数整除多少次原创 2014-08-08 10:58:05 · 896 阅读 · 0 评论 -
POJ 1205 Water Treatment Plants(递推)
题意 建设一条河岸的污水处理系统 河岸有n个城市 每个城市都可以自己处理污水 V 也可以把污水传到相邻的城市处理 >或< 除了你传给我我也传给你这种情况 其它都是合法的 两端的城市不能传到不存在的城市 令d[i]表示有i个城市时的处理方法数 最后一个城市的处理方法有 1.V 自己处理自己的 与前i-1个城市的处理方法无关 有d[i-1]种方法 2.< 给左边的城市去处理 也与前i-1个城市的处理方法无关 把自己的污水给第i-1个城市就行了 有d[i-1]种方法 3.>V原创 2014-08-13 10:47:39 · 1075 阅读 · 0 评论