
joj acm_bfs
kongming_acm
kongming_acm
展开
-
1185: Knight Moves
<br />1185: Knight MovesResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K590278Standard<br />A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each squ原创 2010-07-10 19:43:00 · 481 阅读 · 0 评论 -
2410: The knight problem
2410: The knight problemResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K23093StandardCan you play international chess?This problem has something about that,as you see ,on a normal 8*8 chessboard,there may be some barrier on some of the grids.If we原创 2010-07-10 19:44:00 · 539 阅读 · 0 评论 -
2431: Shift and Increment
<br />2431: Shift and IncrementResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE5s16384K1132174Standard<br />Shift and increment is the basic operations of the ALU (Arithmetic Logical Unit) in CPU. One number can be transform to any other number by these原创 2010-07-10 19:46:00 · 506 阅读 · 0 评论 -
2534: The Hero Rescued The Princess
<br />2534: The Hero Rescued The Princess<br />ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K21061Standard<br />美丽的公主被关在古老的施了咒语的城堡中,你作为当今世上最勇敢的英雄,决定救出这位美丽的公主。<br />如果你成功了,最后公主就会嫁给你。当然故事有点俗套,至少如果你把她救出了,我会免费送你一个气球。<br />但是有很多的英雄去救,如果别人在你之前把公主救了,那原创 2010-07-10 19:47:00 · 529 阅读 · 0 评论 -
2534: The Hero Rescued The Princess 用的是queue
<br />#include<iostream><br />#include<queue><br />#include<cstring><br />using namespace std;<br />int maze[15][30];<br />int moves[4][2]={{0,1},{0,-1},{-1,0},{1,0}};<br />int bx,by,ex,ey;<br />int visited[15][30];<br />int n;<br />int main()<br />{<br />原创 2010-07-10 19:48:00 · 457 阅读 · 0 评论 -
1828: The Stamps
<br />1828: The StampsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K30899Standard<br />4th JOJ Cup Online VContest Problem<br />An envelop can be pasted at most N(1<=N<=100) pieces of stamps. Now you have M(1<=M<=100) different kinds of stamps,原创 2010-07-10 19:50:00 · 406 阅读 · 0 评论 -
1313: Dungeon Master 三维的迷宫问题
#include#include#include#include#includeusing namespace std;int l,r,c;struct node { int x,y,z,l;};node begin,end;int flag[40][40][40]; char map[40][40][40];int xx[6]={0, 0,0, 0,1,-1};int yy[6]={0, 0,1,-1,0, 0};int zz[6]={1,-1,0, 0,0, 0};int bfs(){ q原创 2010-08-08 14:07:00 · 692 阅读 · 0 评论 -
2687: C 8数码问题 哈西表
<br />#include<iostream><br />#include<string><br />#include<cstdio><br />#include<queue><br />#include<cstring><br />#include<map><br />#include<algorithm><br />using namespace std;<br />const int HASHING=600001;<br />int hash_table[HASHING+1];<br />int h原创 2010-08-21 09:50:00 · 1143 阅读 · 0 评论