码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
leetcode------Excel Sheet Column Title
标题:Excel Sheet Column Title通过率:17.3%难度:简单Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1...
分类:其他好文   时间:2015-01-19 20:46:34    阅读次数:131
[C++]LeetCode: 110 Spiral Matrix II (螺旋写入矩阵)
题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the following matrix: [ [ 1, 2, 3 ], [ 8, 9, ...
分类:编程语言   时间:2015-01-19 19:13:19    阅读次数:189
leetcode------Palindrome Number
标题:Palindrome Number通过率:29.1%难度:简单Determine whether an integer is a palindrome. Do this without extra space. 这个题没有理解是因为单词不认识,然后就是不知道什么是回文数,翻译一下,百度一下才....
分类:其他好文   时间:2015-01-19 19:01:54    阅读次数:177
Be careful about the upper limit of integer
在面对整数时,要留心整数溢出的情况。 在探索一个数有多少个除数的程序中,原本我们只要累加自然数到大于根号N停止即可。 不过因为计算机的整数范围的限制,我们需要判断是否i*i<(i-1)*(i-1)。 如果发生这种情况,说明整数溢出了~
分类:其他好文   时间:2015-01-19 18:45:12    阅读次数:130
Leetcode Integer to Roman
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 题意:将阿拉伯数字转换为罗马数字表示 思路:首先了解罗马数字的表示,然后就是从大到小找符合的数字了 class Solution { public: strin...
分类:其他好文   时间:2015-01-19 15:52:35    阅读次数:137
基础搜索算法题解(I-M)
搜索 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18823 Accepted: 7618 Special Judge Description Given a positive integer n,...
分类:编程语言   时间:2015-01-19 14:28:22    阅读次数:303
[LeetCode] A Distance Maximizing Problem
Question:GivenanarrayAofintegers,findthemaximumofj-isubjectedtotheconstraintofA[i]<A[j].publicintmaxDistance(int[]A) { //Assumptions... intlocal=Integer.MIN_VALUE; intglobal=Integer.MIN_VALUE; for(inti=1;i<A.length;i++) { if(A[i]>A[i-1]) { local+..
分类:其他好文   时间:2015-01-19 11:04:11    阅读次数:230
[LeetCode][Python]Roman to Integer
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/roman-to-integer/Roman to IntegerGiven a roman numeral, c...
分类:编程语言   时间:2015-01-19 06:46:47    阅读次数:172
delphi的一个ScanLine内存找子图的函数,不知道有没有问题。
functionTForm1.findimg(pBmpMain,pBmpSub:TBitmap):Boolean; var Pmain,psub,ptmp:PByteArray; x,y,z:Integer; b:boolean; begin result:=false; b:=false; fory:=0topBmpMain.Height-pBmpSub.Heightdo begin Pmain:=pBmpMain.ScanLine[y]; psub:=pBmpSub.ScanLine[0]; forx:=..
分类:Windows程序   时间:2015-01-18 15:51:29    阅读次数:221
First Missing Positive -- leetcode
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant...
分类:其他好文   时间:2015-01-18 15:47:14    阅读次数:126
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!