码迷,mamicode.com
首页 >  
搜索关键字:divide two integers    ( 17573个结果
leetcode--Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:其他好文   时间:2014-06-10 00:01:38    阅读次数:392
leetcode——Two Sum 两数之和(AC)
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-09 23:14:45    阅读次数:264
Light OJ 1278 Sum of Consecutive Integers N拆分成连续整数和
题目来源:Light OJ 1278 Sum of Consecutive Integers 题意:N拆分成连续整数和的方案数 思路:奇因数的个数 #include #include #include #include using namespace std; //筛素数 const int maxn = 10000010; bool vis[maxn]; int prime[10...
分类:其他好文   时间:2014-06-08 15:34:09    阅读次数:295
Recover Binary Search Tree
题目 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Cou...
分类:其他好文   时间:2014-06-08 15:32:45    阅读次数:245
leetcode——Add Two Numbers 两个链表表示的正整数对其求和(AC)
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-06-08 15:30:28    阅读次数:227
一入python深似海--函数与文件
先上写干货,几个开源网站: github.com launchpad.netgitorious.orgsourceforge.netfreecode.com 今天介绍一下python函数和文件读写的知识。 函数 def print_two(*args):#That tells Python to take all the arguments to the function a...
分类:编程语言   时间:2014-06-08 10:37:23    阅读次数:277
leetcode--Combinations
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:其他好文   时间:2014-06-08 08:08:29    阅读次数:294
【LeetCode】Single Number (2 solutions)
Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runti...
分类:其他好文   时间:2014-06-07 23:44:39    阅读次数:302
LeetCode: Container With Most Water 题解
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:其他好文   时间:2014-06-07 23:03:35    阅读次数:279
第四章 分治策略 4.1 最大子数组问题(自己想的,不知道是不是减治法)
package chap04_Divide_And_Conquer;import static org.junit.Assert.*;import java.util.Arrays;import org.junit.Test;/** * 算反导论第四章 4.1 最大子数组 * * @author ....
分类:其他好文   时间:2014-06-07 20:21:38    阅读次数:212
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!