码迷,mamicode.com
首页 >  
搜索关键字:big number    ( 29667个结果
leetcode第一刷_Letter Combinations of a Phone Number
水题。数字一共就9个,去掉1是用来显示标点的,剩下8个。 穷举一下map,然后有几个数字,就输出这几个数字的排列,是一个dfs嘛。 map num; void allCombinations(string &digits, int start, int len, string &pres, vector &res){ if(len == digits.length()){ ...
分类:其他好文   时间:2014-05-15 01:42:26    阅读次数:264
Humble Numbers
Humble Numbers 题目描述 A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the fi...
分类:其他好文   时间:2014-05-15 01:36:22    阅读次数:230
LeetCode--Single Number II
Single Number II  Total Accepted: 14472 Total Submissions: 44420My Submissions Given an array of integers, every element appears three times except for one. Find that single one. Note: Y...
分类:其他好文   时间:2014-05-15 01:23:42    阅读次数:273
POJ 1002 487-3279
Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the Universit...
分类:其他好文   时间:2014-05-15 00:20:39    阅读次数:332
【LeetCode】- 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 two numbers such that they add up to the ta...
分类:其他好文   时间:2014-05-15 00:04:39    阅读次数:377
学习JavaScript王者归来_02
JS异常try { var n = prompt("Please enter a positive number"); var f = factorial(...
分类:编程语言   时间:2014-05-14 23:46:00    阅读次数:405
HDU 1171 Big Event in HDU --暴力+生成函数
题意:给n种房子,每种房子有一个值val和个数cnt,现在要把这些房子分成两部分,争取两部分总值相等,如果不能相等,让A>B,且A-B最小。解法:先跑一次生成函数,c[n]表示组成总值为n的方法种数,然后从Total/2~0枚举B的总值,如果c[i]不为0,说明可以达到 i 这个状态,说明这就是B的...
分类:其他好文   时间:2014-05-14 23:43:59    阅读次数:410
document是什么(what is a document)
大部分的应用中的大部分的实体类型对象都可以使用key-value被序列化到JSON中。key就是field的name或这property,value是string,number,boolean,另外的对象,数组,或者其他的类型如用string表示的date类型,或者表示地理位置信息的对象。{ "n....
分类:其他好文   时间:2014-05-14 23:02:34    阅读次数:390
LeetCode 009 Palindrome Number
【题目】 Determine whether an integer is a palindrome. Do this without extra space. 【题意】 题意判断一个整数是否是回文数 注意一下几点: 1. 不能用额外的空间 2. 负数不是回文数...
分类:其他好文   时间:2014-05-14 20:31:10    阅读次数:298
leetcode -day 15 Distinct Subsequences
1、 ?? Distinct Subsequences  Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from the original str...
分类:其他好文   时间:2014-05-14 20:22:58    阅读次数:275
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!