码迷,mamicode.com
首页 >  
搜索关键字:digits    ( 2164个结果
LeetCode:Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return –321 这道题应该不用详细说了。比较简单。唯一的是要注意特殊值0. public class Solution { publ...
分类:其他好文   时间:2014-05-24 01:39:59    阅读次数:170
【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-05-23 07:43:23    阅读次数:246
Digital Roots,函数
Digital Roots 时间限制: 1 Sec  内存限制: 128 MB 提交: 91  解决: 29 [提交][状态][论坛] 题目描述 The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single d...
分类:其他好文   时间:2014-05-22 13:01:21    阅读次数:223
计算机的存储单位
位 bit (比特)(Binary Digits):存放一位二进制数,即 0 或 1,最小的存储单位。字节 byte:8个二进制位为一个字节(B),最常用的单位。计算机存储单位一般用B,KB,MB,GB,TB,PB,EB,ZB,YB,BB来表示,它们之间的关系是:1KB (Kilobyte 千字节)...
分类:其他好文   时间:2014-05-22 00:58:58    阅读次数:209
Leetcode: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 ...
分类:其他好文   时间:2014-05-20 10:42:14    阅读次数:244
LeetCode:Add Two Numbers
题目链接 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a si...
分类:其他好文   时间:2014-05-19 13:53:32    阅读次数:296
【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-05-19 12:05:23    阅读次数:386
HDU-4734-F(x)
Problem Description For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 * 1. Now you are given two numbers A and...
分类:其他好文   时间:2014-05-18 06:35:50    阅读次数:300
POJ 3373 Changing Digits
题目大意: 给出一个数n,求m,使得m的长度和n相等,能被k整除。有多个数符合条件输出与n在每位数字上改变次数最小的。改变次数相同的输出大小最小的。  共有三种解法:DP解法,记忆化搜索和DFS+强剪枝的算法。 后两种以后会更新。 1、DP解法: 解题思路: DP[i][j]表示数n的前i位除以k余j最小改变几位。 DP[len][0]就表示数n被k整除最小改变几位。 根据这个...
分类:其他好文   时间:2014-05-18 06:02:56    阅读次数:319
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!