码迷,mamicode.com
首页 >  
搜索关键字:digits    ( 2164个结果
HDU 5787 K-wolf Number 数位DP
K-wolf Number Problem Description Alice thinks an integer x is a K-wolf number, if every K adjacent digits in decimal representation of x is pairwised ...
分类:其他好文   时间:2016-08-04 19:22:41    阅读次数:215
LeetCode7 Reverse Integer
题意: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 分析: 思路很简单,注意特殊情况如10,100等和int溢出情况即可; 开始采用的是用一个数组把各位先存起来, ...
分类:其他好文   时间:2016-08-03 23:31:11    阅读次数:176
hdu 5787 数位dp,记忆化搜索
题意:求区间[l,r]内有多少个数符合,这个数的任意的相邻k位数(digits),这k个数都两两不相等 l,r范围是1~1e18,k是2~5 思路:数位DP,因为K<=5,我们最多需要保存下来当前位的前4位就足够了。因为dp[pos][p1][p2][p3][p4]表示,现在枚举取第pos位,pos ...
分类:其他好文   时间:2016-08-03 20:22:58    阅读次数:123
LeetCode 258 Add Digits
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: ...
分类:其他好文   时间:2016-08-03 13:13:19    阅读次数:110
leetcode No66. Plus One
Question: 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 the head of the list. 加1得...
分类:其他好文   时间:2016-08-03 10:40:03    阅读次数:139
LeetCode之链表
2. Add Two Numbers 2. Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and ...
分类:其他好文   时间:2016-08-03 01:28:36    阅读次数:135
Plus One Linked List
Given a non-negative number represented as a singly linked list of digits, plus one to the number. The digits are stored such that the most significan ...
分类:其他好文   时间:2016-08-03 01:24:13    阅读次数:155
Java [Leetcode 357]Count Numbers with Unique Digits
题目描述: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should b ...
分类:编程语言   时间:2016-08-03 01:19:54    阅读次数:278
题目1124:Digital Roots (方法超简单)
题目1124:Digital Roots 学到的新知识 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:3819 解决:1335 题目描述: The digital root of a positive integer is found by summing the digits of t ...
分类:其他好文   时间:2016-08-03 00:01:14    阅读次数:396
(LeetCode)Add Digits --- 整数各位相加
(LeetCode)Add Digits --- 整数各位相加...
分类:其他好文   时间:2016-08-02 11:45:53    阅读次数:103
2164条   上一页 1 ... 93 94 95 96 97 ... 217 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!