上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页
摘要: 感觉非常有意思,也不难想。f[i][j] |= f[i][k] & f[k][j]#include #include #include #include #include #include #include #include #include #include #include using name... 阅读全文
posted @ 2014-07-20 20:24 acm_roll 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 第一次做类似的题目,卡了好几天,最后看了爱酱的blog(http://blog.csdn.net/acm_cxlove/article/details/8679230)才会的,sad题意大概是这样,给你一个图,求起点1到N的最短时间,你有一双鞋子,可以加速,一次性花费0的时间行走M单位的路程,但是鞋... 阅读全文
posted @ 2014-07-20 13:55 acm_roll 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 其实就是枚举最高点和起点,然后以最高点为源点在两张图上分别做spfa。一遍最短路,一遍最长路。暴露出来的问题:思维不够清晰,代码能力还不够#include #include #include #include #include #include #include #include #include ... 阅读全文
posted @ 2014-07-17 16:09 acm_roll 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long ... 阅读全文
posted @ 2014-07-17 11:20 acm_roll 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 最短路水题,这次用SPFA写#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std... 阅读全文
posted @ 2014-07-17 10:31 acm_roll 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 其实本题非常的无脑,无脑拍完1A,写到blog里只因为TM无脑拍也拍了很久啊= =#include #include #include #include #include #include #include #include #include #include #include #include #... 阅读全文
posted @ 2014-07-16 19:57 acm_roll 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 很裸的最短路,不过节点数和边数都是1e6,直接dij肯定是不行了,稀疏图用heap优化一下就好o(╯□╰)o注意STL里面的优先队列是优先级大的(值大的)在前面的,一开始没注意WA了好几发,哎,太粗心了#include #include #include #include #include #inc... 阅读全文
posted @ 2014-07-16 17:15 acm_roll 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 这道题目真是充分显示了窝的智商低下,首先题目在有中文翻译的情况下看了半天没看懂,= =然后已知这题的分类是最短路了还是不会做,= =一开始想着在dij扩展的的时候就把最大运送值算好,不过后来发现正向运输和反向运输的值显然是不相等的o(╯□╰)o后来直接把每个城市作为起点dij了,反正n就一百,n^3... 阅读全文
posted @ 2014-07-16 09:40 acm_roll 阅读(297) 评论(1) 推荐(0) 编辑
摘要: 先生成MST,然后对于MST上的每一条边,如果有其他边的长度与之相等,将其删去之后再求一次MST,如果和原来的cost相同,则不唯一#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2014-07-15 19:12 acm_roll 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题意:变形的约瑟夫环模型,每个人有一个数字a,从第K个人开始出列,如果数字是正的,就往后数a个人出列,如果书负数,就往反方向数。然后用最基本的线段树处理约瑟夫环的方法即可但是题目要求的是第x个出列的人的名字,x为1-N中约数最多的数中的最小的那个。这里需要求反素数,即不大于N约数最多的。写起来比较多... 阅读全文
posted @ 2014-07-13 20:35 acm_roll 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页