码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
Palindrome Number
判断一个整数是否是回文数 注意点: 负数不是,因为多了一个负号 小心溢出,比较的时候不要将数字12345EDCBA变成ABCDE54321进行比较,而是将ABCDE5432和12345EDCB进行比较。 class Solution {public: bool isPalindrome(int x)...
分类:其他好文   时间:2015-03-08 11:34:19    阅读次数:129
格林时间转换成正常时间
uscdbmt@rac1:~> date +%s1414741902oracle中怎么把这个1414741902转换成正常时间格式select Numtodsinterval(1414741902+TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3))...
分类:其他好文   时间:2015-03-07 22:27:54    阅读次数:351
hdu2852 KiKi's K-Number 树状数组求第k大数
//再求第k大数时只需要getsum(b-1) //b就是a的第k大数 //又gesum(b-1) #include #include #include using namespace std; const int maxn=100010; int tree[maxn]; int lowbit(int i) {     return (i&(-i)); } int get...
分类:编程语言   时间:2015-03-07 18:45:35    阅读次数:173
1063. Set Similarity
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distinct n...
分类:其他好文   时间:2015-03-07 17:13:09    阅读次数:156
1069. The Black Hole of Numbers
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin...
分类:其他好文   时间:2015-03-07 17:11:22    阅读次数:124
leetcode 66. Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:其他好文   时间:2015-03-07 16:58:09    阅读次数:131
USACO--1.2Name That Number
题意还是很简单的,我们可以用dfs穷举出所有可能的名字;重要的是查询名字是不是合法,开始的时候用的map,没想到超时了;于是后面用的字典树,其实应该也可以用二分进行查找。另外好像USACO对内存限制很严,数组不能开太大。代码如下:/* ID: 15674811 LANG: C++ TASK: namenum */#include #include #include...
分类:其他好文   时间:2015-03-07 15:42:22    阅读次数:120
【POJ3468】【树状数组区间修改】A Simple Problem with Integers
DescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each ...
分类:编程语言   时间:2015-03-07 15:32:20    阅读次数:217
leetcode_129_Sum Root to Leaf Numbers
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢 Sum Root to Leaf Numbers Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1...
分类:其他好文   时间:2015-03-07 14:15:09    阅读次数:118
SGU[154] Factorial
Description描述You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2...
分类:其他好文   时间:2015-03-07 14:03:59    阅读次数:167
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!