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

2014年5月27日

LeetCode --- Reverse Integer

摘要: 题目链接从代码的健壮性考虑, 应该顾及到把数字翻转后发生溢出的情况,但是此题中并没有这种测试数据。附上代码: 1 class Solution { 2 public: 3 int reverse(int x) { 4 int tmp = abs(x); 5 i... 阅读全文

posted @ 2014-05-27 09:59 Stomach_ache 阅读(101) 评论(0) 推荐(0)

LeetCode --- Add Two Numbers

摘要: 题目链接说来算是个基础题目,可是还是各种CE,各种WA,基础还是不扎实。附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *ne... 阅读全文

posted @ 2014-05-27 09:29 Stomach_ache 阅读(136) 评论(0) 推荐(0)

LeetCode --- Climbing Stairs

摘要: 题目链接简单递推附上代码: 1 class Solution { 2 public: 3 int climbStairs(int n) { 4 int f0 = 1, f1 = 1, f2 = 1; 5 for (int i = 2; i <= n; i++)... 阅读全文

posted @ 2014-05-27 08:28 Stomach_ache 阅读(153) 评论(0) 推荐(0)

2014年5月26日

LeetCode --- Best Time to Buy and Sell Stock II

摘要: 题目链接附上代码: 1 class Solution { 2 public: 3 int maxProfit(vector &prices) { 4 unsigned int len = prices.size(); 5 if (len == 0) retur... 阅读全文

posted @ 2014-05-26 23:50 Stomach_ache 阅读(109) 评论(0) 推荐(0)

LeedCode --- Best Time to Buy and Sell Stock

摘要: 题目链接题意: find the maximum positive difference between the price on the ith day and the jth day附上代码: 1 class Solution { 2 public: 3 int maxProfit(ve... 阅读全文

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

2014年5月22日

git命令总结

摘要: 学会这些命令,你就可以熟练的使用Git工具了,什么?想精通,那是不可能的。基本上,Git就是以下面的命令顺序学习的。文中笔记是从廖雪峰老师的Git教程中总结出来的,方面查阅命令。详细原理请看Git教程。1、基础git config --global user.name "Your Name"设置你的... 阅读全文

posted @ 2014-05-22 18:12 Stomach_ache 阅读(234) 评论(0) 推荐(1)

2014年5月21日

LeetCode --- Jump Game II

摘要: 题目链接题目描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents ... 阅读全文

posted @ 2014-05-21 13:34 Stomach_ache 阅读(109) 评论(0) 推荐(0)

2014年5月20日

Hdu 4497

摘要: 题目链接已知 gcd(x, y, z) = G, lcm(x, y, z) = L, 求有多少种组合(x, y, z)可以满足条件。G, L都在32位int范围内。思路: 素数分解 + 容斥L : p1^t1 * p2^t2 ... * pi^tiG: q1^s1 * q2^s2... * qi^s... 阅读全文

posted @ 2014-05-20 23:53 Stomach_ache 阅读(298) 评论(0) 推荐(0)

数据库lib7第4题创建存储过程

摘要: 1. 传入2个字符串变量,其中,每个字符串是用分号(;)分隔的字串形式, 比如str1=’ab12;ab;cccc;tty’, str2=’1;6sf;8fffff;dd’, 注意,字符串是用户输入的,不能固定值、长度、和分号个数。2. 执行完毕存储过程后,要求根据分号提取字符串的字... 阅读全文

posted @ 2014-05-20 14:35 Stomach_ache 阅读(280) 评论(0) 推荐(0)

Hdu 4496

摘要: 题目链接并查集简单题,赛前复习 :.....附上代码: 1 /************************************************************************* 2 > File Name: 4496.cpp 3 > Author: S... 阅读全文

posted @ 2014-05-20 00:38 Stomach_ache 阅读(189) 评论(0) 推荐(0)

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

导航