转载请注明来源,谢谢——by GuavaNotification 既iOS中的“通知”(广播站)机制可以用来监听系统、模型的变化。接收端:通过[NSNotificationCenter defaultCenter]获得一个共享实例,就用这个对象来接收广播。收听广播的方法是,向对象发送消息:- (vo...
分类:
Web程序 时间:
2015-10-15 15:53:36
阅读次数:
157
1. 假设要编写一个发生在太空的游戏,其中有飞船(spaceship),太空站(space station)和小行星(ssteroid),使它们继承自一个抽象基类GameObject,整个继承体系像这样:class GameObject { ... };class SpaceShip: public...
分类:
编程语言 时间:
2015-10-13 01:38:04
阅读次数:
213
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs...
分类:
其他好文 时间:
2015-10-08 16:15:38
阅读次数:
124
ProblemThere 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 cos...
分类:
其他好文 时间:
2015-10-07 10:45:13
阅读次数:
173
LeetCode -- Gas Station...
分类:
其他好文 时间:
2015-10-04 17:14:42
阅读次数:
158
原题链接在这里:https://leetcode.com/problems/gas-station/参见这篇帖子:http://pisxw.com/algorithm/Gas-Station.htmlsumCur是走到当前油站的剩余油量,totalCir是走完一整圈的剩余油量。若是从起始站走到i站,...
分类:
其他好文 时间:
2015-09-24 07:02:59
阅读次数:
202
Building a Space Station题目:http://poj.org/problem?id=2031空间站之间建立通道, 使得所有空间站连通, 最小生成树问题。 道路长度不会有负权。#include #include #include #include using namespace ...
分类:
其他好文 时间:
2015-09-21 23:51:57
阅读次数:
299
环形路线上有N个加油站,每个加油站有汽油gas[i],从每个加油站到下一站消耗汽油cost[i],问从哪个加油站出发能够回到起始点,如果都不能则返回-1,最后题目提到解是唯一的。...
分类:
其他好文 时间:
2015-09-13 07:06:57
阅读次数:
170
1072. Gas Station (30)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such a location that the minimum dist...
分类:
其他好文 时间:
2015-09-04 18:32:56
阅读次数:
215
1.题目描述:点击打开链接
2.解题思路:本题利用DFS解决。不过本题的解法颇为巧妙,注意到2^0+2^1+...+2^(i-1)
3.代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include...
分类:
其他好文 时间:
2015-08-27 23:12:03
阅读次数:
209