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...
分类:
其他好文 时间:
2015-10-05 09:18:50
阅读次数:
171
反过来推 题目大意:就是农夫和这只牛又杠上了(怎么老是牛啊,能换点花样吗),给出一行数(从1到N),按杨辉三角的形式叠加到最后,可以得到一个数,现在反过来问你,如果我给你这个数,你找出一开始的序列(可能存在多个序列,输出字典序最...
分类:
编程语言 时间:
2015-10-04 18:23:57
阅读次数:
263
1.词频统计sed -e s/'[[:punct:]]'/' '/g -e s/'[[:digit:]]'/' '/g $filename| tr [A-Z] [a-z] | tr '\n' ' '| tr ' ' '\n' | sed '/^$/d' >>newfilename#干掉文本中的标点和...
分类:
系统相关 时间:
2015-09-29 14:24:30
阅读次数:
368
1 //讲数字字符串转为数值型(此处不考虑输入字符串的合法性),不允许使用parseInt方法和Character.digit 2 public class ConvertNumstr { 3 public static void main(String[] args) { 4 ...
分类:
编程语言 时间:
2015-09-28 15:56:46
阅读次数:
217
#include #include using namespace std; #define DIGIT 4 //四位隔开,即万进制 #define DEPTH 10000 //万进制 #define MAX 251 //...
分类:
其他好文 时间:
2015-09-26 14:37:57
阅读次数:
177
FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 #include #include #include #include #include #include using na...
分类:
其他好文 时间:
2015-09-23 19:21:50
阅读次数:
242
求大量N^N的值最右边的数字,即最低位。它将能够解决一个简单二分法。只是要注意溢出,只要把N % 10之后。我不会溢出,代替使用的long long。#include int rightMost(int n, int N){ if (n == 0) return 1; int t = rightMo...
分类:
Web程序 时间:
2015-09-23 16:39:54
阅读次数:
138
Question:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is ...
分类:
其他好文 时间:
2015-09-23 16:19:25
阅读次数:
188
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 a...
分类:
其他好文 时间:
2015-09-22 10:11:38
阅读次数:
130
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...
分类:
其他好文 时间:
2015-09-22 06:38:14
阅读次数:
144