上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页

2014年5月19日

Hdu 4493

摘要: 题目链接注意四舍五入,保留到小数点后两位(如果存在的话)。附上代码: 1 /************************************************************************* 2 > File Name: 4493.cpp 3 > Au... 阅读全文

posted @ 2014-05-19 23:37 Stomach_ache 阅读(425) 评论(0) 推荐(0)

Leetcode ---- Swap Nodes in Pairs

摘要: 题目链接题意:给出单链表头指针,要求交换链表中每一对相邻的结点.注意:不可以改变链表中结点的值,只可以使用常量空间.附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val;... 阅读全文

posted @ 2014-05-19 18:24 Stomach_ache 阅读(137) 评论(0) 推荐(0)

2014年5月18日

LeetCode --- Linked List Cycle II

摘要: 题目链接题意: 给出单链表,判断是否存在环,如果存在要求输出环开始的结点.思路及证明:It is a famous known problem Hare and Tortoise.Length of head to cycle started node: xLength of the cycle: ... 阅读全文

posted @ 2014-05-18 11:51 Stomach_ache 阅读(108) 评论(0) 推荐(0)

2014年5月17日

Python sorted

摘要: sorted函数:iterable:是可迭代类型;cmp:用于比较的函数,比较什么由key决定,有默认值,迭代集合中的一项;key:用列表元素的某个属性和函数进行作为关键字,有默认值,迭代集合中的一项;reverse:排序规则. reverse = True 或者 reverse = False,有... 阅读全文

posted @ 2014-05-17 19:29 Stomach_ache 阅读(235) 评论(0) 推荐(0)

2014年5月16日

每天一个linux命令(2): nl命令

摘要: 0.学习时间 2014-05-161.命令格式 nl [参数] 文件名 (文件名也缺省的情况下, 从标准输入中读入)2.命令参数 -b t 空行不加行号(默认) -b a 空行也加行号(类似于cat -n) -n ln 设置行号显示左对齐 -n rn 设置行号显示右对齐(默认) ... 阅读全文

posted @ 2014-05-16 21:38 Stomach_ache 阅读(171) 评论(0) 推荐(0)

Codeforces 432C

摘要: 题目链接题意: 给出一个长度为n(n File Name: C.cpp 3 > Author: Stomach_ache 4 > Mail: sudaweitong@gmail.com 5 > Created Time: 2014年05月15日 星期四 23时51分15秒... 阅读全文

posted @ 2014-05-16 19:15 Stomach_ache 阅读(405) 评论(0) 推荐(1)

2014年5月15日

LeetCode -- Linked List Cycle

摘要: 题目链接题意: 给出单链表, 判断是否存在环.方法就是大步小步...附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next... 阅读全文

posted @ 2014-05-15 22:54 Stomach_ache 阅读(109) 评论(0) 推荐(0)

每天一个linux命令(1): which命令

摘要: 0.学习时间: 2014-05-15which命令用来在PATH指定的路径中查找特定的文件, 并返回第一个找到的结果.1. 命令格式: which 文件名2.命令功能 一般使用which命令来查看某个系统命令(可执行文件)是否存在, 以及该命令所在的目录.3.命令参数 -n 指定文件名长度... 阅读全文

posted @ 2014-05-15 21:10 Stomach_ache 阅读(214) 评论(0) 推荐(0)

Hdu 1867 KMP

摘要: 题目链接题目意思: 给出两个字符串a, b, 求最长的公共字串c, c是a的后缀,也是b的前缀. 本题没有具体说明哪个字符串是文本串和匹配串, 所以都要考虑思路: 查找的时候, 当文本串结束的时候, 返回匹配串的位1 /****************************************... 阅读全文

posted @ 2014-05-15 12:42 Stomach_ache 阅读(144) 评论(0) 推荐(0)

c++11的新特性

摘要: 好奇心来源于下面的一段代码, 一个是unordered_map, 这是c++11新加的container. 另外还有unordered_set, unordered_multimap, unordered_multiset.另外在for循环中, 可以使用下列形式:1 for (auto &eleme... 阅读全文

posted @ 2014-05-15 10:21 Stomach_ache 阅读(122) 评论(0) 推荐(0)

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页

导航