http://cs.au.dk/~mis/dOvs/slides/Kevin-linear-scan-reg-alloc.pdf ftp://ftp.ssw.uni-linz.ac.at/pub/Papers/Moe02.PDF Greedy Register Allocation in LLVM 3.0 http://blog.llvm.org/2011/09/greedy-registe...
分类:
其他好文 时间:
2014-09-18 20:49:45
阅读次数:
577
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.
You should pack your words in a greedy approach; that is,...
分类:
其他好文 时间:
2014-09-17 15:18:52
阅读次数:
201
Problem Description
After repeated attempts, LL finds the greedy strategy is very awful in practice. Even there is no apparent evidence to proof it is better than a random one. So he has to drop th...
分类:
其他好文 时间:
2014-09-02 12:29:04
阅读次数:
226
给出n个点,m条有向边,Edward驾车要从点1到点n,车的满油量是c,在n个点中有p个点是加油站,Edward每到一个加油站都可以加满油(不用钱),每条边都有个权值L,表示通过这条边至少要有L个单位的油。然后题目给出了Q个点,在这Q个点Edward可以卖掉一些油,第qi个点油价格为vi,但是前提是...
分类:
其他好文 时间:
2014-08-29 02:39:27
阅读次数:
278
第一次在赛后迅速地解决所有问题,这种感觉还是蛮不错的!...
分类:
其他好文 时间:
2014-08-28 00:55:28
阅读次数:
280
题意: 给定n 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #includ...
分类:
其他好文 时间:
2014-08-22 20:59:49
阅读次数:
326
首先正向跑一遍1为起点的最短路,注意松弛过程如果走到加油站则dis=0,并且路上任意时刻dis都不能大于C,判断dis[n]是否
然后反向建图再跑一次N为起点的最短路,这样可以求到每个点到n点的最短路。
对于每一个可以交易的城市,C-dis1[i]-dis2[i]就是多出来可以卖掉的油。
#include
#include
#include
#include
#include
#includ...
分类:
其他好文 时间:
2014-08-21 09:47:54
阅读次数:
248
题意:给定n个点,m条有向边,邮箱容量。起点在1,终点在n,開始邮箱满油。以下m行表示起点终点和这条边的耗油量(就是长度)再以下给出一个数字m表示有P个加油站,能够免费加满油。以下一行P个数字表示加油站的点标。再以下一个整数Q以下Q行 u v 表示在u点有销售站,能够卖掉邮箱里的随意数量的油,每以单...
分类:
其他好文 时间:
2014-08-20 13:52:22
阅读次数:
222
O(n^2) is a naive solution. As rule of thumb, there must be O(n) soluion. Yes - greedy (WHY?)class Solution {public: int maxArea(vector &height) ...
分类:
其他好文 时间:
2014-08-16 15:04:30
阅读次数:
153