摘要: Where's Waldorf?Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of letters in the grid. A word can match the letters in the grid regardless of case (i.e. upper and lower case let 阅读全文
posted @ 2013-04-19 09:33 KRisen 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Fire NetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4145 Accepted Submission(s): 2370 Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing 阅读全文
posted @ 2013-03-17 11:52 KRisen 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Oil DepositsTime Limit:2 Seconds Memory Limit:65536 KBThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then ana 阅读全文
posted @ 2013-03-08 14:39 KRisen 阅读(258) 评论(0) 推荐(0) 编辑
摘要: One day, an ant called Alice came to an M*M chessboard. She wanted to go around all the grids. So she began to walk along the chessboard according to this way: (you can assume that her speed is one grid per second) At the first second, Alice was standing at (1,1). Firstly she went up for a grid, the 阅读全文
posted @ 2013-01-27 12:10 KRisen 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 题目即为分饼,但是每个人要分到一样大,切只能是一整块,不能拼凑在一起,求每人分到最大的体积。。。。安神说我没真正理解二分搜索,确实,二分真的很神通广大,在这个题目我就死脑筋没转过弯,。。由于给的饼的数目和类型不确定。。。有些饼是可以舍弃的。。在这个处理上,用f>=V[I]/MID作为二分的条件最好了,即判断能不能切出这么多块MID体积大的饼出来。。。。其实这就是二分的思想,不要死脑筋。。二分可以变换很多形式,控制条件不同,达到不同的效果。。。这才是要去领会二分的精髓。话说代码又是参考某位大神的。#include <iostream>#include <cstdio> 阅读全文
posted @ 2013-01-25 12:55 KRisen 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Mishap in ClubPolycarpus just has been out of luck lately! As soon as he found a job in the "Binary Cat" cafe, the club got burgled. All ice-cream was stolen.On the burglary night Polycarpus kept a careful record of all club visitors. Each time a visitor entered t... 阅读全文
posted @ 2013-01-24 19:00 KRisen 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 三分搜索法 二分法作为分治中最常见的方法,适用于单调函数,逼近求解某点的值。但当函数是凸性函数时,二分法就无法适用,这时三分法就可以“大显身手”~~ 如图,类似二分的定义Left和Right,mid = (Left + Right) / 2,midmid = (mid + Right) / 2; 如果mid靠近极值点,则Right = midmid;否则(即midmid靠近极值点),则Left = mid;程序模版如下:double Calc(Type a){ /* 根据题目的意思计算 */}void Solve(void){ double Left, Right; double mid, m 阅读全文
posted @ 2013-01-24 11:41 KRisen 阅读(341) 评论(2) 推荐(0) 编辑
摘要: Strange fuctionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1612Accepted Submission(s): 1206Problem DescriptionNow, here is a fuction:F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 阅读全文
posted @ 2013-01-24 11:37 KRisen 阅读(333) 评论(0) 推荐(0) 编辑
摘要: Can you solve this equation?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4276Accepted Submission(s): 1989Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try yo 阅读全文
posted @ 2013-01-23 16:20 KRisen 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://hunteagle.iteye.com/blog/118551计算理论中,没有Hash函数的说法,只有单向函数的说法。所谓的单向函数,是一个复杂的定义,大家可以去看计算理论或者密码学方面的数据。用“人类”的语言描述单向函数就是:如果某个函数在给定输入的时候,很容易计算出其结果来;而当给定结果的时候,很难计算出输入来,这就是单项函数。各种加密函数都可以被认为是单向函数的逼近。Hash函数(或者成为散列函数)也可以看成是单向函数的一个逼近。即它接近于满足单向函数的定义。Hash函数还有另外的含义。实际中的Hash函数是指把一个大范围映射到一个小范围。把大范围映射到一个小范围 阅读全文
posted @ 2013-01-23 13:23 KRisen 阅读(199) 评论(0) 推荐(0) 编辑