上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: Dijkstra算法的核心思想就是两步排序,一个是对于一个点而言,他的最小边要经过所有其他点最小边的测试才能确认,也就是说要在这其中找一个最大的边出来;第二个是对于每次循环而言的,每次的更新d数组都是为了要选出最短的距离。 对于每次出队列的点,都更新他所有的邻边 #include <iostream 阅读全文
posted @ 2015-11-24 12:49 Miller_S 阅读(2335) 评论(0) 推荐(0)
摘要: Description Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number o 阅读全文
posted @ 2015-11-24 10:13 Miller_S 阅读(530) 评论(0) 推荐(0)
摘要:           阅读全文
posted @ 2015-11-21 20:21 Miller_S 阅读(514) 评论(0) 推荐(0)
摘要: While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed through Patrick's personal stuff a 阅读全文
posted @ 2015-11-21 09:01 Miller_S 阅读(559) 评论(0) 推荐(0)
摘要: Description Input Output Sample Input Sample Output   阅读全文
posted @ 2015-11-19 15:39 Miller_S 阅读(280) 评论(0) 推荐(0)
摘要: Description User ainta has a permutation p1, p2, ..., pn. As the New Year is coming, he wants to make his permutation as pretty as possible. Permutati 阅读全文
posted @ 2015-11-18 21:08 Miller_S 阅读(503) 评论(0) 推荐(0)
摘要:         阅读全文
posted @ 2015-11-17 13:04 Miller_S 阅读(370) 评论(0) 推荐(0)
摘要:   思路: 解法一: 新的认识get+1,对于一个数组,可以通过记录他'<'和'>'来判断数组的升降序状态,这种方法只需要n的复杂度就可以解决问题,需要注意的一点是,每次删除一个结点在消失两个关系的同时也会出现一个新的关系 解法二:找到非递减和非递增LIS中数量较大的一个,只要它大于等于n-1,答案 阅读全文
posted @ 2015-11-12 20:11 Miller_S 阅读(331) 评论(0) 推荐(0)
摘要:           阅读全文
posted @ 2015-11-12 15:45 Miller_S 阅读(345) 评论(0) 推荐(0)
摘要:           阅读全文
posted @ 2015-11-09 11:22 Miller_S 阅读(258) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页