码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
Roman to Integer ——解题报告
【题目】     Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.     【分析】     这个和上篇博文中把数字转换为罗马数字正好相反,逻辑过程有点儿复杂。     其实解法来源于对罗马数字(字符串)的观察,...
分类:其他好文   时间:2015-05-06 23:07:28    阅读次数:180
[ZOJ 2836] Number Puzzle
Number PuzzleTime Limit: 2 Seconds Memory Limit: 65536 KBGiven a list of integers (A1, A2, ..., An), and a positive integer M, please find the number ...
分类:其他好文   时间:2015-05-06 19:31:00    阅读次数:106
Codeforces Round #174 (Div. 2)---D. Cow Program(dp, 记忆化搜索)
Farmer John has just given the cows a program to play with! The program contains two integer variables, x and y, and performs the following operations on a sequence a1,?a2,?…,?an of positive integers:I...
分类:其他好文   时间:2015-05-06 17:55:05    阅读次数:187
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? (ie, -1) If you are thinking of co...
分类:其他好文   时间:2015-05-06 13:26:23    阅读次数:115
power函数的非递归经典实现(时间复杂度仅仅为logn)
#include using namespace std; template T power(T x,Integer n) { if(n == 0) return 1; if(n == 1) return x; while((n&1) == 0) { x = x*x; n >>= 1; } T result = x...
分类:其他好文   时间:2015-05-06 13:18:36    阅读次数:125
【leetcode】Happy Number(easy)
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer...
分类:移动开发   时间:2015-05-06 10:54:56    阅读次数:146
Evaluate Reverse Polish Notation——LeetCode
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:其他好文   时间:2015-05-05 23:46:55    阅读次数:180
C/C++基本数据类型
基本类型C/C++语言有一组基本类型,对应于计算机的基本存储单元和使用这些单元去保存数据的一些常用方式:基本数据类型如下:NameDescriptionSize*Range*charCharacter or small integer.1bytesigned: -128 to 127unsigned...
分类:编程语言   时间:2015-05-05 23:44:06    阅读次数:196
【String to Integer (atoi) 】cpp
题目:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below a...
分类:其他好文   时间:2015-05-05 21:33:48    阅读次数:193
leetcode_191题——Number of 1 Bits(外运算)
Number of 1 BitsTotal Accepted:25965Total Submissions:70075My SubmissionsQuestionSolutionWrite a function that takes an unsigned integer and returns t...
分类:其他好文   时间:2015-05-05 21:14:37    阅读次数:124
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!