调用系统函数,可以得到系统时间 1 #include 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 time_t rawtime; 8 9 while(true){10 time(&...
分类:
编程语言 时间:
2015-01-06 19:39:54
阅读次数:
184
https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/http://blog.csdn.net/linhuanmars/article/details/23164149publicclassSolution{
publicintmaxProfit(int[]prices){
//Ifasmanytransactions
//Gready
intpro=0;
intbuy=0;
booleanhold=false;
int..
分类:
其他好文 时间:
2015-01-06 18:13:23
阅读次数:
132
https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/http://blog.csdn.net/linhuanmars/article/details/23162793publicclassSolution{
publicintmaxProfit(int[]prices)
{
//SolutionA:
returnmaxProfit_DP(prices);
//SolutionB:
//returnmaxProfit_Binary(..
分类:
其他好文 时间:
2015-01-06 18:11:55
阅读次数:
176
今天专门把python的字典各种方法对比测试了一下性能效果.测试代码如下: 1 def dict_traverse(): 2 from time import clock 3 my_dict = {'name': 'Jim', 'age': '20', 'height': '180c...
分类:
编程语言 时间:
2015-01-06 17:48:14
阅读次数:
180
(1)(2)(3)-------------author:pkf------------------time:2015-1-6后面发现是connection 的server 地址是指定的 导致播放不了,然后用wireshark capture了一下一大堆udp的数据出来了,也不是端口问题,和rtsp...
分类:
其他好文 时间:
2015-01-06 17:18:12
阅读次数:
156
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may ...
分类:
其他好文 时间:
2015-01-06 15:41:54
阅读次数:
189
Read N Characters Given Read4
Total Accepted: 960
Total Submissions: 3775
The API: int read4(char *buf) reads 4 characters at a time from a file.
The return value is the actual number of char...
分类:
其他好文 时间:
2015-01-06 15:38:42
阅读次数:
222
项目中总是看到__FILE__ __LINE__的玩意,想起来曾经在Linux内核源码中也看到过类似的东西。抽时间查了查这玩意是什么。
简单而言。是ANSI C预定义的宏。有这么几个,注意前后都是两个下划线
__FILE__ :表示源文件名称(不是可执行文件),字符串类型
__LINE__:源码行数,整形
__DATE__:编译日期,字符串
__TIME__:编译时间,字符串
...
分类:
其他好文 时间:
2015-01-06 15:36:55
阅读次数:
172
Linux系统文件有三个主要的时间属性,分别是ctime(change time, 而不是create time), atime(access time), mtime(modify time)。后来为了解决atime的性能问题,还引入了一个relatime的属性,下面一一解释。 ctime, 很多...
分类:
其他好文 时间:
2015-01-06 15:24:49
阅读次数:
116
最近《算法导论》快看完图论部分了,很多有关图的算法都彻底搞懂并加以证明了。现在主要是将理解的思想用到题目中来加强下。这个题目主要是判断一下整个图是否是强连通的,很简单,可以用tarjan也可以用kosaraju。因为不要求找出所有的强连通分量,所以这里只是借用了kosaraju的思想,然后本题的解答简化的异常简单。
迷宫城堡
Time Limit: 2000/1000 MS (...
分类:
其他好文 时间:
2015-01-06 13:53:12
阅读次数:
142