摘要: 杭电10101.奇偶性剪枝可以把map看成这样:010101101010010101101010010101从为0的格子走一步,必然走向为1的格子从为1的格子走一步,必然走向为0的格子即:0->1或1->0必然是奇数步0->0走1->1必然是偶数步所以当遇到从0走向0但是要求时间是奇数的,或者,从1走向0但是要求时间是偶数的都可以直接判断不可达![cpp]view plaincopy#include#include#includecharmap[9][9];intn,m,t,di,dj;boolescape;intdir[4][2]={{0,-1},{0,1},{1,0 阅读全文
posted @ 2012-08-14 23:01 dancingrain 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Easier Done Than Said?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4246Accepted Submission(s): 2142Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords a 阅读全文
posted @ 2012-08-14 15:50 dancingrain 阅读(197) 评论(0) 推荐(0) 编辑
摘要: EncodingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16699Accepted Submission(s): 7120Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same 阅读全文
posted @ 2012-08-14 14:36 dancingrain 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Digital RootsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30319Accepted Submission(s): 9309Problem 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 tha 阅读全文
posted @ 2012-08-14 14:09 dancingrain 阅读(285) 评论(0) 推荐(0) 编辑
摘要: u Calculate eTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18822Accepted Submission(s): 8211Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e u 阅读全文
posted @ 2012-08-14 13:26 dancingrain 阅读(232) 评论(0) 推荐(0) 编辑
摘要: ElevatorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24941Accepted Submission(s): 13418Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floo 阅读全文
posted @ 2012-08-14 12:56 dancingrain 阅读(275) 评论(0) 推荐(0) 编辑
摘要: Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 62216Accepted Submission(s): 14226Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to 阅读全文
posted @ 2012-08-14 12:38 dancingrain 阅读(156) 评论(0) 推荐(0) 编辑