码迷,mamicode.com
首页 >  
搜索关键字:choose the best rout    ( 3445个结果
hdu 2680 Choose the best route 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2680题目意思:实质就是给定一个多源点到单一终点的最短路。 卑鄙题~~~有向图。初始化map时 千万不要写成 map[i][j] = map[j][i] = X。 1 #include 2 #inc...
分类:其他好文   时间:2014-05-26 12:45:46    阅读次数:255
HDU 3910 Liang Guo Sha
HDU 3910 Liang Guo Sha 题目大意: If both of them choose “Sha”, then Alice gets A points, and Bob loses A points; if both of them choose “Shan”, then Alice gets B points, and Bob loses B points; otherwise, Bob gets C points, and Alice loses C points. 给定A B ...
分类:其他好文   时间:2014-05-22 06:22:40    阅读次数:281
LeetCode Best Time to Buy and Sell Stock
class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len maxv) { maxv = cur; ...
分类:其他好文   时间:2014-05-22 05:09:49    阅读次数:256
Advices and Best Practices for Magento developers
I think everyone who is interested in ecommerce development get familiar with Magento earlier or later. It’s a very popular platform, where a lot of m...
分类:其他好文   时间:2014-05-22 00:35:05    阅读次数:555
Best Cow Line 解题报告
题目链接:http://poj.org/problem?id=3617题意: 已知一段长度为N的字符串,让你构造一个字典序最小的字符串.构造的规则如下:如果原始字符串的头部 尾部则删除尾部的字符添加到新字符串中.解题思路: 首先用两个索引记录首尾的位置,然后依次比较两者的值,若头部的值小则头部索引....
分类:其他好文   时间:2014-05-21 19:05:31    阅读次数:245
Best Time to Buy and Sell Stock III
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:其他好文   时间:2014-05-21 17:27:55    阅读次数:252
5 Best Books for Every IT Leader 2014
5 Best Books for Every IT Leader 2014Posted by vikas on May 20, 2014, filed in: Web Develoment Information technology is the largest industry, when we...
分类:其他好文   时间:2014-05-21 03:45:31    阅读次数:298
leetcode Best Time to Buy and Sell Stock III
思路:知道要用DP做,但是一开始思路是错的。后来参考了http://blog.csdn.net/pickless/article/details/12034365才意识到可以在整个区间的每一点切开,然后分别计算左子区间和右子区间的最大值,然后再用O(n)时间找到整个区间的最大值。看来以后碰到与2相关...
分类:其他好文   时间:2014-05-19 14:13:38    阅读次数:286
XTU1175:Hurry Up(三分)
Problem Description GG is some what afraid of his MM. Once his MM asks, he will always try his best to rush to their home.  Obvious, he can run home in straight line directly. Alternatively, he ca...
分类:其他好文   时间:2014-05-18 07:28:10    阅读次数:268
hdu 2680 Choose the best route
http://acm.hdu.edu.cn/showproblem.php?pid=2680这道题是有向图。把全部可以出发的点进队列spfa就可以。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn ...
分类:其他好文   时间:2014-05-18 00:20:31    阅读次数:248
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!