Problem Description
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resultin...
分类:
其他好文 时间:
2014-10-12 19:46:59
阅读次数:
205
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...
分类:
其他好文 时间:
2014-10-12 13:29:18
阅读次数:
160
Problem Description
A sequence consisting of one digit, the number 1 is initially written into a computer. At each successive time step, the computer simultaneously tranforms each digit 0 into the...
分类:
其他好文 时间:
2014-10-11 20:04:56
阅读次数:
221
给定一个数,如果它是N位的,那么从1到N乘以这个数,得到的(指得到的N个数都满足条件)都是这个数的回文数。判断给定的数是否满足条件:大数乘法部分不是难点,本题的难点是怎么判断进行大数乘法之后得到的新数从某个digit开始读就是原数。假设存储原数的字符数组为ori_str,储存进行大数阶乘之后的数的字...
分类:
其他好文 时间:
2014-10-09 17:41:07
阅读次数:
189
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-10-09 17:15:15
阅读次数:
218
给出杨辉三角的顶点值,求底边各个数的值。直接DFS就好了
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll __int64
#define INF 0x3fffffff
#define rep(i,n) for(int (i)=0;(i)<n;(...
分类:
其他好文 时间:
2014-10-09 01:31:47
阅读次数:
174
//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.
//digits={9,9,9,...
分类:
其他好文 时间:
2014-10-06 13:46:10
阅读次数:
200
/*
数位dp
题意:找到1-n之间包含13这个子串并且能够整除13的数
解:刚开始dp[N][N][2]这里的2用来记录是否为13表示当前位是否为13,我把上一位为1当前位为13和上一位部位1
这种情况在数组中没有记录。
*/
#include
#include
#define N 14
int dp[N][N][3];
int digit[N];
int dfs(int len,int mod...
分类:
其他好文 时间:
2014-10-05 16:10:28
阅读次数:
115
/*
数位dp
水题
开两维一个记录长度,一个记录上一个数
*/
#include
#include
#define N 13
int dp[N][N];
int digit[N];
int dfs(int len,int cnt,int ok) {
if(!len)return 1;
if(!ok&&dp[len][cnt]!=-1)
return dp[len][cnt];
i...
分类:
其他好文 时间:
2014-10-05 16:09:18
阅读次数:
191
题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telep...
分类:
其他好文 时间:
2014-10-05 15:11:48
阅读次数:
206