码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
9. Palindrome Number
题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes?...
分类:其他好文   时间:2015-04-15 23:20:59    阅读次数:159
ACM学习历程——POJ3468 A Simple Problem with Integers(线段树)
DescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to ...
分类:其他好文   时间:2015-04-15 23:11:05    阅读次数:133
6. ZigZag Conversion
题目:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font...
分类:其他好文   时间:2015-04-15 22:53:32    阅读次数:153
深度优先搜索:奇怪的电梯
DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 2 #include 3 #include 4 #include 5...
分类:其他好文   时间:2015-04-15 21:20:22    阅读次数:206
冒泡法为何又错了,运行起来不对求解
#includeint main(){ int a[50],i,j,t,n; //scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("\n input number of date:"); scanf("%d",&n); printf("input %d munb...
分类:其他好文   时间:2015-04-15 21:16:56    阅读次数:120
判断一个整数中有多少bit为1
Counting bits set (naive way)unsigned int v; // count the number of bits set in vunsigned int c; // c accumulates the total bits set in vfor (c = 0; v...
分类:其他好文   时间:2015-04-15 21:07:12    阅读次数:256
Single Number II
/* 题意:给一个整数数组,每一个元素出现三次,只有一个元素出现一次,找出那个数(target数) 解法:用位运算做,统计整个数组每一位1的个数,然后对3取模,因为如果在第i位target数为0, 那么bit%3就为0,否则为1,对bit进行左移操作,然后直接累加结果。*/clas...
分类:其他好文   时间:2015-04-15 20:53:55    阅读次数:109
FreeMarker map 遍历
FreeMaker 在遍历map ,当Map的key 定义了Integer时,会报Expected number, sequence, or string. i.imageUrl evaluated instead to freemarker.template.SimpleHash 异常,因为FreeMaker不支持遍历key为Integer...
分类:其他好文   时间:2015-04-15 19:47:31    阅读次数:367
[LeetCode 200] Number of Islands
题目链接:number-of-islands /** * Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent land...
分类:其他好文   时间:2015-04-15 19:40:44    阅读次数:179
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 nu...
分类:其他好文   时间:2015-04-15 19:16:18    阅读次数:127
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!