Racing Car Computer dp
摘要:Racing Car ComputerInput:Standard InputOutput:Standard OutputThe racing cars of today are equipped with so many sophisticated equipment. Introduction of a new visual transducer which is interfaced with the on-board computer can tell you on the fly how many cars are ahead of you while how many are tr
阅读全文
posted @
2014-04-05 09:57
ERKE
阅读(259)
推荐(0)
不要62 hdu2089
摘要:不要62Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16975Accepted Submission(s): 5566Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 8
阅读全文
posted @
2014-04-02 13:04
ERKE
阅读(260)
推荐(0)
Kia's Calculation hdu4726
摘要:Kia's CalculationTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1367Accepted Submission(s): 327Problem DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number w
阅读全文
posted @
2014-04-01 13:17
ERKE
阅读(174)
推荐(0)
The Moving Points hdu4717
摘要:The Moving PointsTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 964Accepted Submission(s): 393Problem DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest d
阅读全文
posted @
2014-03-31 23:13
ERKE
阅读(233)
推荐(0)
Naive and Silly Muggles hdu4720
摘要:Naive and Silly MugglesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 452Accepted Submission(s): 307Problem DescriptionThree wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, whi
阅读全文
posted @
2014-03-31 22:24
ERKE
阅读(183)
推荐(0)
Problem 2144 Shooting Game fzu
摘要:Problem 2144 Shooting GameAccept: 99Submit: 465Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionFat brother and Maze are playing a kind of special (hentai) game in the playground. (Maybe it’s the OOXX game which decrypted in the last problem, who knows.) But as they don’t like using re
阅读全文
posted @
2014-03-31 13:35
ERKE
阅读(266)
推荐(0)
数
摘要:1、本原勾股数:概念:一个三元组(a,b,c),其中a,b,c没有公因数而且满足:a^2+b^2=c^2首先,这种本原勾股数的个数是无限的,而且构造的条件满足:a=s*t,b=(s^2-t^2)/2,c=(s^2+t^2)/2其中s>t>=1是任意没有公因数的奇数!由以上概念就可以导出任意一个本原勾股数组。2、素数计数(素数定理)令π(x)为1到x中素数的个数19世纪最高的数论成就就是以下这个玩意儿:lim(x->∞){π(x)/(x/ln(x))}=1数论最高成就,最高成就!!!有木有!!!3、哥德巴赫猜想(1+1)一个大偶数(>=4)必然可以拆分为两个素数的和,虽然
阅读全文
posted @
2014-03-28 22:49
ERKE
阅读(252)
推荐(0)
数论(转载)
摘要:1.burnside定理,polya计数法 这个大家可以看brudildi的《组合数学》,那本书的这一章写的很详细也很容易理解。最好能完全看懂了,理解了再去做题,不要只记个公式。 *简单题:(直接用套公式就可以了) pku2409 Let it Bead http://acm.pku.edu.cn/JudgeOnline/problem?id=2409 pku2154 Color http://acm.pku.edu.cn/JudgeOnline/problem?id=2409 pku1286 Necklace of Beads ...
阅读全文
posted @
2014-03-28 22:32
ERKE
阅读(204)
推荐(0)
Eddy's爱好 hdu2204
摘要:Eddy's爱好Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1266Accepted Submission(s): 541Problem DescriptionIgnatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。正当他再度沉迷的时候,他发现不知道什么时候才能知道这样
阅读全文
posted @
2014-03-28 20:45
ERKE
阅读(169)
推荐(0)
本原串
摘要:本原串Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 580Accepted Submission(s): 202Problem Description由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n 2 #include 3 #include 4 #include 5 using namespace std; 6 #define mod 2008 7 #define ll int 8 int ...
阅读全文
posted @
2014-03-25 23:12
ERKE
阅读(188)
推荐(0)
错排问题
摘要:错排问题 把n封信装进n个信封里,每封信都装错了,问一共有多少种情况? 为了方便表述,把n个信封编号为1,2,……,k,……,n。把n封信编号为f1,f2,f3,……,fk,……,fn.共有情况f(n)种。 如果n = 1,显然不可能装错,f(1) = 0; 如果n = 2,只有两种情形,一种装对,一种装错,f(2) = 1; 如果n > 2,那么考虑装错的情形,fn可以装的位置有n-1种,先假定把fn装进信封k中,则fk是否装进信封n中,分两种情况:(1)fk装进信封n中,则余下的问题是f(n-2);(2)fk不装进信封n中,这时可以假设信封k和fn消失,把fk看错fn,问题就是f(n
阅读全文
posted @
2014-03-22 19:05
ERKE
阅读(148)
推荐(0)
欧拉四面体公式
摘要:【转载】关于欧拉四面体公式的推导及证明过程1,建议x,y,z直角坐标系。设A、B、C少拿点的坐标分别为(a1,b,1,c1),(a2,b2,c2),(a3,b3,c3),四面体O-ABC的六条棱长分别为l,m,n,p,q,r;2,四面体的体积为,由于现在不知道向量怎么打出来,我就插张图片了,将这个式子平方后得到:3,根据矢量数量积的坐标表达式及数量积的定义得又根据余弦定理得4,将上述的式子带入(1),就得到了传说中的欧拉四面体公式在这里说明一点这里面的推导我也是看的,要是是我自己推出来的,我不就欧拉了,哈哈。poj有一道就是关于这个公式的,说实话出这种题很没意思,如果你不知道公式基本上就做不出
阅读全文
posted @
2014-03-20 13:49
ERKE
阅读(959)
推荐(0)
超级密码 hdu1226 bfs
摘要:超级密码Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2108Accepted Submission(s): 669Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0 2 #include 3 #include 4 #i..
阅读全文
posted @
2014-03-18 23:33
ERKE
阅读(253)
推荐(0)
糖果大战 hdu1204
摘要:糖果大战Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1855Accepted Submission(s): 613Problem Description生日Party结束的那天晚上,剩下了一些糖果,Gandon想把所有的都统统拿走,Speakless于是说:“可以是可以,不过我们来玩24点,你不是已经拿到了一些糖果了吗?这样,如果谁赢一局,就拿走对方一颗糖,直到拿完对方所有的糖为止。”如果谁能算出来而对方算不出来,谁就赢,但是如果双方都能算
阅读全文
posted @
2014-03-18 09:05
ERKE
阅读(349)
推荐(0)
Find The Multiple (poj1426 一个好的做法)
摘要:Find The MultipleTime Limit:1000MSMemory Limit:10000KTotal Submissions:16505Accepted:6732Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than
阅读全文
posted @
2014-03-15 22:27
ERKE
阅读(150)
推荐(0)
Life Forms (poj3294 后缀数组求 不小于k个字符串中的最长子串)
摘要:(累了,这题做了很久!)Life FormsTime Limit:5000MSMemory Limit:65536KTotal Submissions:8683Accepted:2375DescriptionYou may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resem
阅读全文
posted @
2014-03-13 22:29
ERKE
阅读(230)
推荐(0)
Long Long Message (poj2774 后缀数组求最长公共子串)
摘要:Long Long MessageTime Limit:4000MSMemory Limit:131072KTotal Submissions:19206Accepted:7934Case Time Limit:1000MSDescriptionThe little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being worried about spending so much o
阅读全文
posted @
2014-03-13 14:16
ERKE
阅读(395)
推荐(0)
687. Repeats spoj (后缀数组 重复次数最多的连续重复子串)
摘要:687. RepeatsProblem code: REPEATSA string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the strings = abaabaabaabais a (4,3)-repeat with t = aba as its seed string. That is, the seed string t is 3 characters long, and
阅读全文
posted @
2014-03-13 13:37
ERKE
阅读(263)
推荐(0)
Maximum repetition substring (poj3693 后缀数组求重复次数最多的连续重复子串)
摘要:Maximum repetition substringTime Limit:1000MSMemory Limit:65536KTotal Submissions:6328Accepted:1912DescriptionThe repetition number of a string is defined as the maximum numberRsuch that the string can be partitioned intoRsame consecutive substrings. For example, the repetition number of "ababa
阅读全文
posted @
2014-03-13 13:21
ERKE
阅读(282)
推荐(0)
kmp next数组的理解(挺好的一篇文章 ,原来kmp最初的next是这样的啊,很好理解)
摘要:KMP算法的next[]数组通俗解释我们在一个母字符串中查找一个子字符串有很多方法。KMP是一种最常见的改进算法,它可以在匹配过程中失配的情况下,有效地多往后面跳几个字符,加快匹配速度。当然我们可以看到这个算法针对的是子串有对称属性,如果有对称属性,那么就需要向前查找是否有可以再次匹配的内容。在KMP算法中有个数组,叫做前缀数组,也有的叫next数组,每一个子串有一个固定的next数组,它记录着字符串匹配过程中失配情况下可以向前多跳几个字符,当然它描述的也是子串的对称程度,程度越高,值越大,当然之前可能出现再匹配的机会就更大。这个next数组的求法是KMP算法的关键,但不是很好理解,我在这里用
阅读全文
posted @
2014-03-12 22:59
ERKE
阅读(346)
推荐(0)