上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页
摘要: 开始学dfs 与bfs 时一直喜欢用vis[][]来标记有没有访问过,现在我觉得没有必要用vis[][]标记了看代码用'#'表示墙,'.'表示道路if(所有情况都满足){ map[i][j]='#'; dfs(i,j); map[i][j]='.';}一般情况都可以这样做。 阅读全文
posted @ 2014-12-02 18:11 立刻行动 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1242水题,bfs代码#include#include#include#includeusing namespace std;int n,m,success;int stx,sty,ex,ey;char m... 阅读全文
posted @ 2014-12-02 18:02 立刻行动 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1241水题,不过这题有一点要注意, (not counting the end-of-line characters) (不包括行尾字符), 这里用%s输入好一些,我开始用%c输入,格式全不对,输入不完... 阅读全文
posted @ 2014-12-02 15:59 立刻行动 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1181水题一个,bfs ,dfs多可以。bfs时间更优一些,bfs代码#include#include#include#include#includeusing namespace std;int succ... 阅读全文
posted @ 2014-12-02 14:00 立刻行动 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1075做这题,开始输入没有输出没有考虑好,想着用%s输入,处理的时候不好处理,数据过了,但一直WA,思维角度有问题,到网上看了看,有人用map做,很好,我按照他的处理字符方式用我的方法做,A了。做这题还是有... 阅读全文
posted @ 2014-12-01 15:33 立刻行动 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 2011-05-17 21:261429人阅读评论(0)收藏举报算法网络blog八卦游戏读书转载自简单de数字最终编辑fading_codeby zfy0701本来以为HNU的huicpc035和我一样退役了,后来听说他组成了新的footman队,于是又关注了下他。035体现了两个我觉得非常重要的品... 阅读全文
posted @ 2014-12-01 00:00 立刻行动 阅读(331) 评论(0) 推荐(0) 编辑
摘要: STL中关于二分查找的函数有三个lower_bound 、upper_bound 、binary_search 。这三个函数都运用于有序区间(当然这也是运用二分查找的前提),下面记录一下这两个函数。ForwardIter lower_bound(ForwardIter first, ForwardI... 阅读全文
posted @ 2014-11-30 22:52 立刻行动 阅读(690) 评论(0) 推荐(0) 编辑
摘要: 一.unique函数类属性算法unique的作用是从输入序列中“删除”所有相邻的重复元素。该算法删除相邻的重复元素,然后重新排列输入范围内的元素,并且返回一个迭代器(容器的长度没变,只是元素顺序改变了),表示无重复的值范围得结束。 1 // sort words alphabetically so ... 阅读全文
posted @ 2014-11-30 22:29 立刻行动 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5124这题题目做的好悲催,比赛时题目意思不理解,也没有深究了,赛后又看了很久没有看懂,问了很多才搞懂,我有一种想哭的冲动,我一直把这题[x,y]这个线段看成了一个坐标,我想哭了,由于x,y坐标带来的惯性,,... 阅读全文
posted @ 2014-11-30 22:15 立刻行动 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5123水题一个,直接hash;代码#include#includeint main(void){ int i,j,k,n,t; int a[110]; int hash[110]; ... 阅读全文
posted @ 2014-11-30 21:08 立刻行动 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页