摘要: 诡异的楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 6457 Accepted Submission(s): 1523 Problem DescriptionHogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目 阅读全文
posted @ 2013-05-14 13:15 芷水 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Knight MovesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4547 Accepted Submission(s): 2799 Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight move 阅读全文
posted @ 2013-05-13 19:27 芷水 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Oil Depositshttp://acm.hdu.edu.cn/showproblem.php?pid=1241寻找石油,找有几片的油田。 经典的广度搜索。亮点{ 1.map的使用,空间 + 时间双丰收。 2.使用了转化,把字符 变成 数字。当然对这一题来说是没有什么必要~ 3.在使用栈的时候,进入的顺序是 x y 出的时候是 y x,这个考虑到了。 }Ok~#include<stdio.h>#include<string.h>char c[102][102];int a[102][102],f[102][102],zhan[402],f1;int map[8][2 阅读全文
posted @ 2013-05-12 23:07 芷水 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 素数环, 经典的搜索题。学了线段树之后,对递归有了一些体会,写这一题还是可以的。ans的地方表示的是,寻找下一个数、素数环,经典的搜索题。学了线段树之后,对递归有了一些体会,写这一题还是可以的。ans的地方表示的是,寻找下一个数、#include<stdio.h>int ss[41],visit[21],b[21];void getss(){ int i,j; for(i=1;i<=40;i++) ss[i]=1; ss[1]=0; for(i=2;i<=7;i++) for(j=i*i;j<=40;j=j+i) ss[... 阅读全文
posted @ 2013-05-12 23:02 芷水 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3667HotelTime Limit:3000MSMemory Limit:65536KTotal Submissions:8874Accepted:3769DescriptionThe cows are journeying north to ... 阅读全文
posted @ 2013-05-06 18:59 芷水 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Sequence operationTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4393Accepted Submission(s): 1272Problem Descriptionlxhgww got a sequence contains n characters which are all '0's or '1's.We have five operations here:Change operati 阅读全文
posted @ 2013-05-04 17:03 芷水 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Black And WhiteTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3561Accepted Submission(s): 1062Pro... 阅读全文
posted @ 2013-05-03 21:39 芷水 阅读(184) 评论(1) 推荐(0) 编辑
摘要: LCISTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2640Accepted Submission(s): 1143Problem Descri... 阅读全文
posted @ 2013-05-02 19:34 芷水 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6471Accepted Submission(s): 3940Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文
posted @ 2013-04-29 20:40 芷水 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http://acm.hrbeu.edu.cn/index.php?act=problem&id=1008&cid=115线段树,标记。How ManyTimeLimit: 10 Second MemoryLimit: 32 MegabyteTotalsubmit: 188 Accepted: 35 Descriptionyou are given a sequence A[1], A[2],..., A[N]. On this sequence you have to apply M operations: Add all the elements whose positio 阅读全文
posted @ 2013-04-27 17:33 芷水 阅读(153) 评论(0) 推荐(0) 编辑