10 2013 档案
Flesch Reading Ease(模拟)
摘要:http://poj.org/problem?id=3371终于遇到简单一点的模拟题了。不过本人真心没有耐心读题目。。。它的大致意思就是给一段合法的文章,求出这段文章的单词数,句子数,音节数,按照题目给出的公式带入就出结果。>因为输入是按空格作为字符串结束标志的,因此每输入一个字符串就是一个单词,>句子结束的标志是 . ? : ; !五种,每输入一个字符串只须判断其最后一个字符是否是. ? : ; !的一种,若是,句子数加1.>对于音节数,单词长度 2 #include 3 #include 4 #include 5 using namespace std; 6 7 bool 阅读全文
posted @ 2013-10-30 20:19 straw_berry 阅读(833) 评论(0) 推荐(0)
Instant Complexity(模拟,递归)
摘要:Time Limit:1000MSMemory Limit:10000KTotal Submissions:1535Accepted:529DescriptionAnalyzing the run-time complexity of algorithms is an important tool for designing efficient programs that solve a problem. An algorithm that runs in linear time is usually much faster than an algorithm that takes quadr 阅读全文
posted @ 2013-10-29 21:39 straw_berry 阅读(776) 评论(0) 推荐(0)
Lucky and Good Months by Gregorian Calendar(模拟)
摘要:http://poj.org/problem?id=3393好大的一道模拟题,直接当阅读理解看了。下面是大神写的题意,解释的好详细。定义:Goog month : 该月第一个工作日为星期一的月份Luckly month: 该月最后一个工作日为星期五的月份问: 给定一个Gregorian Calendar格里高公历的时间闭区间(就是包括端点的年月了)【开始年、月】~【结束年、月】 在这个时间区间内,有多少个Goog month,有多少个Luckly month文章要点:Gregorian Calendar格里高公历 就是现在广泛使用公历(西历),下面简称GCGC的起始日期为 1年1月1号,该日为 阅读全文
posted @ 2013-10-28 21:05 straw_berry 阅读(342) 评论(0) 推荐(0)
Wall(Graham算法)
摘要:Time Limit:1000MSMemory Limit:10000KTotal Submissions:27110Accepted:9045DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's proposals to build a beaut 阅读全文
posted @ 2013-10-26 16:18 straw_berry 阅读(317) 评论(0) 推荐(0)
Beauty Contest(graham求凸包算法)
摘要:Time Limit:3000MSMemory Limit:65536KTotal Submissions:25256Accepted:7756DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 2 #include 3 #include 4 #include 5 usi 阅读全文
posted @ 2013-10-25 20:53 straw_berry 阅读(183) 评论(0) 推荐(0)
A Round Peg in a Ground Hole(判断是否是凸包,点是否在凸包内,圆与多边形的关系)
摘要:Time Limit:1000MSMemory Limit:10000KTotal Submissions:4628Accepted:1434DescriptionThe DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes in each piece to be attached. The 阅读全文
posted @ 2013-10-25 17:35 straw_berry 阅读(377) 评论(0) 推荐(0)
Pie(二分)
摘要:ime Limit:1000MSMemory Limit:65536KTotal Submissions:8930Accepted:3235Special JudgeDescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of th 阅读全文
posted @ 2013-10-24 19:19 straw_berry 阅读(288) 评论(0) 推荐(0)
Expanding Rods(二分)
摘要:Time Limit:1000MSMemory Limit:30000KTotal Submissions:10287Accepted:2615DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls and then heated, it expands and 阅读全文
posted @ 2013-10-24 17:52 straw_berry 阅读(217) 评论(0) 推荐(0)
Fishnet(计算几何)
摘要:Time Limit:1000MSMemory Limit:10000KTotal Submissions:1642Accepted:1051DescriptionA fisherman named Etadokah awoke in a very small island. He could see calm, beautiful and blue sea around the island. The previous night he had encountered a terrible storm and had reached this uninhabited island. Some 阅读全文
posted @ 2013-10-24 16:33 straw_berry 阅读(364) 评论(0) 推荐(0)
Building a Space Station(kruskal,说好的数论呢)
摘要:Time Limit:1000MSMemory Limit:30000KTotal Submissions:3820Accepted:1950DescriptionYou are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.The space station is made up 阅读全文
posted @ 2013-10-23 00:03 straw_berry 阅读(375) 评论(0) 推荐(0)
n数码问题, 全排列哈希
摘要:转载了一篇关于全排列的哈希函数,Poj1077就是应用了全排列的哈希;我们经常使用的数的进制为“常数进制”,即始终逢p进1。例如,p进制数K可表示为K = a0*p^0 + a1*p^1 + a2*p^2 + ... + an*p^n (其中0 pi,那么,如果在排列Q中qi之前的元素x与qi构成逆序对,即有x > qi,则在排列P中pi之前也有相同元素x > pi(因为x > qi且qi > pi),即在排列P中pi之前的元素x也与pi构成逆序对,所以pi的逆序数大于等于qi的逆序数。又qi与pi在排列P中构成pi的逆序对,所以pi的逆序数大于qi的逆序数。(2)同理 阅读全文
posted @ 2013-10-22 20:38 straw_berry 阅读(710) 评论(0) 推荐(0)
Eight(bfs+全排列的哈希函数)
摘要:Time Limit:1000MSMemory Limit:65536KTotal Submissions:22207Accepted:9846Special JudgeDescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all pa 阅读全文
posted @ 2013-10-22 20:36 straw_berry 阅读(520) 评论(0) 推荐(0)
Pick-up sticks(判断两条线段是否相交)
摘要:Time Limit:3000MSMemory Limit:65536KTotal Submissions:8351Accepted:3068DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no stick on top of th 阅读全文
posted @ 2013-10-20 20:06 straw_berry 阅读(263) 评论(0) 推荐(0)
poj 1265 Area(pick定理)
摘要:AreaTime Limit:1000MSMemory Limit:10000KTotal Submissions:4373Accepted:1983DescriptionBeing well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new research and development facility the company has installed the latest 阅读全文
posted @ 2013-10-20 14:57 straw_berry 阅读(192) 评论(0) 推荐(0)
poj 2503 Babelfish(字典树哈希)
摘要:Time Limit:3000MSMemory Limit:65536KTotal Submissions:29059Accepted:12565DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 10 阅读全文
posted @ 2013-10-19 18:38 straw_berry 阅读(295) 评论(0) 推荐(0)
poj 3007 Organize Your Train part II(静态字典树哈希)
摘要:Time Limit:1000MSMemory Limit:65536KTotal Submissions:6700Accepted:1922DescriptionRJ Freight, a Japanese railroad company for freight operations has recently constructed exchange lines at Hazawa, Yokohama. The layout of the lines is shown in Figure 1.Figure 1: Layout of the exchange linesA freight t 阅读全文
posted @ 2013-10-19 18:30 straw_berry 阅读(243) 评论(0) 推荐(0)
Surprising Strings(map类)
摘要:http://poj.org/problem?id=3096题意容易理解,开始直接暴力,还是用map写下吧,熟练一下; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int main() 8 { 9 char s[100];10 char t[5];11 int n,i;12 map mymap;13 14 while(~scanf("%s",s))15 {16 if(s[0] == '*')17 break... 阅读全文
posted @ 2013-10-15 20:28 straw_berry 阅读(190) 评论(0) 推荐(0)
Strange Way to Express Integers (一般模线性方程组)
摘要:Time Limit:1000MSMemory Limit:131072KTotal Submissions:8476Accepted:2554DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choosekdifferent positive integersa1,a2,…,ak. For some non-negativem, di 阅读全文
posted @ 2013-10-15 18:57 straw_berry 阅读(227) 评论(0) 推荐(0)
生理周期
摘要:http://poj.org/problem?id=1006中国剩余定理模板题 1 #include 2 #include 3 int p,e,i,d; 4 int a[5],m[5]; 5 int item = 1; 6 int extend_gcd(int a,int b,int &x,int &y) 7 { 8 if(b == 0) 9 {10 x = 1;11 y = 0;12 return a;13 }14 else15 {16 int r = extend_gcd(b,a%b,x... 阅读全文
posted @ 2013-10-14 19:55 straw_berry 阅读(165) 评论(0) 推荐(0)
C Looooops(扩展欧几里得求模线性方程)
摘要:http://poj.org/problem?id=2115题意:对于C的循环(for i = A; i != B; i+=C)问在k位存储系统内循环多少次结束; 若循环有限次能结束输出次数,否则输出FOREVER;解:设x为循环次数; (A+C*x)%2^k = B; 则 C*x+A = 2^k*y+B; 所以 C*x - 2^k*y = B-A; 类似于a*x+b*y = c (或 a*x = c(mod b))模线性方程的形式,所以可以根据扩展欧几里得算法解决 1 #include 2 #include 3 4 long long exGcd(long long a,... 阅读全文
posted @ 2013-10-12 21:56 straw_berry 阅读(214) 评论(0) 推荐(0)
Sumdiv(各种数学)
摘要:http://poj.org/problem?id=1845题意:求A^B的所有约数的和再对9901取模;做了这个学到了N多数学知识;一:任意一个整数都可以唯一分解成素因子的乘积;A = p1^k1*p2^k2*......*pn^kn; A先对2不断取模,当A%2==0时,2的次数加1,直到A%2!=0,A再尝试着对3不断取模.....依次进行下去,直到A = 1; 当A本身就是素数时,A^1就是素数本身的分解式(特殊情况,别忘了加判断); 这样A^B = p1^(k1*B) * p2(k2*B) * .......*pn^(kn*B);二:一个数用素因子乘积表示后其约数和公式; A... 阅读全文
posted @ 2013-10-12 20:14 straw_berry 阅读(782) 评论(0) 推荐(0)
River Hopscotch(二分)
摘要:Time Limit:2000MSMemory Limit:65536KTotal Submissions:5473Accepted:2379DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a rock at the start an 阅读全文
posted @ 2013-10-11 21:08 straw_berry 阅读(248) 评论(0) 推荐(0)
Monthly Expense(二分)
摘要:Time Limit:2000MSMemory Limit:65536KTotal Submissions:11196Accepted:4587DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that he will need to spen 阅读全文
posted @ 2013-10-10 17:13 straw_berry 阅读(251) 评论(0) 推荐(0)
The Embarrassed Cryptographer(高精度取模+同余模定理)
摘要:Time Limit:2000MSMemory Limit:65536KTotal Submissions:11435Accepted:3040DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are created from the produc 阅读全文
posted @ 2013-10-08 21:04 straw_berry 阅读(383) 评论(0) 推荐(0)
find the safest road(floyd)
摘要:Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5183Accepted Submission(s): 1868Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 阅读全文
posted @ 2013-10-08 16:58 straw_berry 阅读(224) 评论(0) 推荐(0)
Farm Irrigation(并查集)
摘要:Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4479Accepted Submission(s): 1942Problem DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these 阅读全文
posted @ 2013-10-07 18:25 straw_berry 阅读(262) 评论(0) 推荐(0)
find the mincost route(floyd变形 无向图最小环)
摘要:Time Limit: 1000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1630Accepted Submission(s): 664Problem Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的 阅读全文
posted @ 2013-10-07 17:18 straw_berry 阅读(222) 评论(0) 推荐(0)