码迷,mamicode.com
首页 >  
搜索关键字:numbers    ( 7657个结果
[leetcode]Two Sum @ Python
原题地址:http://oj.leetcode.com/problems/two-sum/题意:找出数组numbers中的两个数,它们的和为给定的一个数target,并返回这两个数的索引,注意这里的索引不是数组下标,而是数组下标加1。比如numbers={2,7,11,17}; target=9。那...
分类:编程语言   时间:2014-04-30 21:45:43    阅读次数:528
UVA 10891 Game of Sum(DP)
This is a two player game. Initially there areninteger numbers in an array and playersAandBget chance to take them alternatively. Each player can take...
分类:其他好文   时间:2014-04-30 20:34:38    阅读次数:519
LeetCode1:Two Sum
题目: 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 t...
分类:其他好文   时间:2014-04-30 03:20:07    阅读次数:502
HDU1719 Friend (数学推导)
friend numbers = 2^x + 3^y -1 1 #include 2 int main() 3 { 4 __int64 a; 5 while(scanf("%I64d",&a)!=EOF) 6 { 7 if(!a) 8 { 9...
分类:其他好文   时间:2014-04-30 01:43:36    阅读次数:322
《Cracking the Coding Interview》——第18章:难题——题目1
2014-04-29 00:56题目:不用算数运算,完成加法。解法:那就位运算吧,用加法器的做法就可以了。代码: 1 // 18.1 add two numbers wihout using arithmetic operator. 2 #include 3 using namespace std....
分类:其他好文   时间:2014-04-29 14:58:53    阅读次数:383
LeetCode——Add Two Numbers
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 ...
分类:其他好文   时间:2014-04-29 10:17:46    阅读次数:406
LeetCode OJ - Sum Root to Leaf Numbers
这道题也很简单,只要把二叉树按照宽度优先的策略遍历一遍,就可以解决问题,采用递归方法越是简单。下面是AC代码: 1 /** 2 * Sum Root to Leaf Numbers 3 * 采用递归的方法,宽度遍历 4 */ 5 int result=0; 6...
分类:其他好文   时间:2014-04-28 10:05:40    阅读次数:682
7657条   上一页 1 ... 764 765 766
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!