There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit f ...
分类:
其他好文 时间:
2017-03-22 21:28:40
阅读次数:
230
Digit Counting 这题也是参考书上的习题3-2,题目也不贴了。题比较简单,值得留意的地方就是数组下角标的对应关系。C++实现如下: ...
分类:
其他好文 时间:
2017-03-17 17:57:37
阅读次数:
162
var digitUppercase = function(n) { var fraction = ['角', '分']; var digit = [ '零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖' ]; var unit = [ ['元', '万' ...
分类:
Web程序 时间:
2017-03-14 16:35:46
阅读次数:
197
题目链接:https://leetcode.com/problems/number-of-digit-one/?tab=Description 题意:求[1,n]内1的个数。 裸数位DP,好久不写都快不会写了。。这么水 ...
分类:
其他好文 时间:
2017-03-10 22:24:31
阅读次数:
207
如何用字符来描述字符: \d匹配数字 digit \w匹配字母或数字 word \s可以匹配空格 space * 表示任意个字符, +表示至少一个字符 ?表示0个或1个字符, {n} 表示n个字符, {n,m}表示n-m个字符 .可以匹配任意字符 例如: Kongxiangyu \w{11} 如何做 ...
分类:
编程语言 时间:
2017-03-10 19:14:05
阅读次数:
234
The daffodil number is one of the famous interesting numbers in the mathematical world. A daffodil number is a three-digit number whose value is equal ...
分类:
其他好文 时间:
2017-03-09 20:13:01
阅读次数:
163
BackgroundThe 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 dig ...
分类:
其他好文 时间:
2017-03-08 19:26:47
阅读次数:
133
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1061 题目大意:求N^N的个位数 关键思想:对1个N来说,乘方时末尾会循环。对所有N来说,结果以20为周期。 代码如下(第一个思想): (第二种方法:打表) ...
分类:
Web程序 时间:
2017-03-07 00:01:07
阅读次数:
207
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1060 题目大意:求N^N的最高位数字。 关键思想:换底公式使结果变为10^(N*log10(N)),再除以10^(digits-1)就OK了。 代码如下: ...
分类:
其他好文 时间:
2017-03-06 22:16:35
阅读次数:
147
# include # include # define N 66 int main(){ int s[N] = {0}, a[N] = {0};// s累加和,a累积求阶乘 int i,j,k,n,digit=1; //digit代表的是数字的位数 scanf("%d",&n); a[0]=1; ... ...
分类:
其他好文 时间:
2017-02-18 23:54:36
阅读次数:
272