题目:There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costsco...
分类:
其他好文 时间:
2014-10-15 18:12:11
阅读次数:
218
测试脚本录制:方案一:我们先看看以下monkeyrecoder.py脚本:#Usage:monkeyrunnerrecorder.py#recorder.pyhttp://mirror.yongbok.net/linux/ ... ey_recorder.py;com.android.monkeyr...
分类:
移动开发 时间:
2014-10-14 22:01:39
阅读次数:
216
转自 :http://www.cnblogs.com/mrcoke/articles/Yii.htmlYii的Active Recorder包装了很多。特别是把SQL中 把where,order,limit,IN/not IN,like等常用短句都包含进CDbCriteria这个类中去,这样整个代码...
分类:
数据库 时间:
2014-10-11 12:14:25
阅读次数:
174
E -Funny Car RacingTime Limit:1000MSMemory Limit:0KB64bit IO Format:%lld & %lluThere is a funny car racing in a city with n junctions and m directed r...
分类:
其他好文 时间:
2014-10-09 23:04:41
阅读次数:
269
带原型的Constructor模式function Car(model, year, miles){ this.model = model; this.year = year; this.miles = miles;}Car.prototype.toString = function(){ ...
分类:
编程语言 时间:
2014-10-09 00:25:47
阅读次数:
207
执行如下代码:var query = from tr in _carrierRepository select new BaseCarrier { Car...
分类:
其他好文 时间:
2014-10-08 14:27:25
阅读次数:
137
题意:
给一张无向图,中午12:00从0点出发(充满电,支持240分钟的路程),在每个点都能充电,充2分钟的电能跑1分钟,每条路按分钟分为若干个时间段,每个时间段内通过这条路的时间为ti,问到达n-1号点最少要多少时间。
分析:
BFS+优先队列。按时间优先出队,要注意将电量的存储*2(当然有其他方法),因为如果充电时间为奇数,用int存会丢失0.5。其次是要跑两个周期(两天)。判重的话有很多方法,较普遍的是开两维,位置和剩余电量,我的方法是开一维松弛,将电量化为0(x.time-x.power)。要小心的...
分类:
其他好文 时间:
2014-10-07 18:43:34
阅读次数:
239
题目:点击打开链接
思路:对于当前位置的每一个时间段都要走一遍(除了那些需要的时间比最大允许的时间还大的),用 整形 vis[当前位置][剩余油量] 标记。
#include
#include
#include
#define INF 999999999
using namespace std;
struct S{
int pos,time,remain;
bool ...
分类:
其他好文 时间:
2014-10-06 12:14:40
阅读次数:
229
题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1333解题报告:一个图里面有n个点和m条单向边,注意是单向边,然后每条路开a秒关闭b秒,问从s点到t点的最短时间。一个简单的最短路稍微变了一下。卡了很久就因为没看到边是单向边,无语。可以用...
分类:
其他好文 时间:
2014-10-05 23:37:59
阅读次数:
231
#lang scheme
( define li '( 1 2 3 4 ) )
( define-syntax set-car!
( syntax-rules ()
( ( set-car! li elem )
( set! li ( cons elem ( cdr li ) ) ) ) ) )
( set-car! li '( a b ) )
#...
分类:
其他好文 时间:
2014-10-05 17:27:48
阅读次数:
189