上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: Agri-Net Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 51653 Accepted: 21544 Description Farmer John has been elected may... 阅读全文
posted @ 2016-08-02 17:28 弃用博客 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Constructing Roads Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 22440 Accepted: 9588 Description There are N villages, w... 阅读全文
posted @ 2016-08-02 17:10 弃用博客 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Prim算法 1.概览 普里姆算法(Prim算法),图论中的一种算法,可在加权连通图里搜索最小生成树。意即由此算法搜索到的边子集所构成的树中,不但包括了连通图里的所有顶点(英语:Vertex (graph theory)),且其所有边的权值之和亦为最小。该算法于1930年由捷克数学家沃伊捷赫... 阅读全文
posted @ 2016-08-02 11:22 弃用博客 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12755 Accepted: 5481 Description The cornfield m... 阅读全文
posted @ 2016-08-02 10:24 弃用博客 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 75331 Accepted: 23781 Description Farmer John has been info... 阅读全文
posted @ 2016-08-01 17:00 弃用博客 阅读(132) 评论(0) 推荐(0) 编辑
摘要: A Knight's Journe Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 40970 Accepted: 13938 Description Background The knight i... 阅读全文
posted @ 2016-08-01 15:18 弃用博客 阅读(103) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1572 看了网上那么多行的C++代码的做法我也是被吓到了,其实用C++的string类函数很简单啊 关键是替换的字符串不能回头,不然有些测试数据,一个循环过后,你又回头重新再新串中去查,很可能就无限循环了。 1.假如定义一个str... 阅读全文
posted @ 2016-07-30 17:16 弃用博客 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15775 Accepted: 9389 Description 定义一个二维数组: int maze[5][5] = { 0, 1, ... 阅读全文
posted @ 2016-07-30 16:33 弃用博客 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 和上个DFS的问题一样,这次用BFS的思想,BFS没有像DFS那样专门有个step累加,是靠队列思想实现,更像一群路径竞速,最快的到达后,就break输出了 #include struct node{ int x; int y; int f;//父亲在队列中的编号,本题不要求... 阅读全文
posted @ 2016-07-30 09:45 弃用博客 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 解救人质,给一张二维地图,有障碍的点不能移动,给定起始点和人质坐标,求到达人质路程的最短路程,DFS模型#include #include using namespace std;int n,m,p,q,Min=99999999;int a[51][51],book[51][51];void d... 阅读全文
posted @ 2016-07-29 20:52 弃用博客 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页