显示/var/目录下所有以1开头,以一个小写字母结尾,且中间至少出现一位数字(可以有其他字符)的文件或目录。命令:ls -d /var/1*[0-9]*[a-z]显示/etc目录下,以任意一个数字开头,且以非数字结尾的文件或目录。命令:ls -d /etc/[[:digit:]]*[[1]]显示/e... ...
分类:
系统相关 时间:
2016-10-07 22:53:51
阅读次数:
307
递增递减差不多思路,不过他们计算的过程中像5555,444 这样的重复串会多算,所以要剪掉。个数是(pos-1)*9+digit[最高位],比如一位重复子串是:1,2,3,4...9,9个,二位重复子串:11,22,33,44,...,99,9个;同理,其他类推; 不过这个题如果dp值每算完一个[l ...
分类:
其他好文 时间:
2016-10-07 01:06:51
阅读次数:
223
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho ...
分类:
其他好文 时间:
2016-10-02 00:20:22
阅读次数:
192
符号与种别码对照表 单词符号 # begin if then while do End + - * / : : = 种别码 0 1 2 3 4 5 6 13 14 15 16 17 18 单词符号 < <> <= > >= = ; ( ) Letter(letter|digit) digit dig ...
分类:
其他好文 时间:
2016-09-30 18:31:26
阅读次数:
455
[题目] 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 ...
分类:
其他好文 时间:
2016-09-29 17:39:01
阅读次数:
134
Balanced Number Problem Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specific ...
分类:
其他好文 时间:
2016-09-28 22:32:57
阅读次数:
218
传送门 一句话怎么说来着 算法+高级数据结构=OI 现在我感觉到的是 我会的算法+我会的高级数据结构=WA 这道题提交了三四十次,从刚看题到完全写好花了好几天..,主要死于看错费马小定理的适用条件。 下面是正经题解: 首先,这道题的难点不在于找到有多少个路径(很明显的点分治),而是判断一条路径是否合 ...
分类:
其他好文 时间:
2016-09-28 15:48:05
阅读次数:
149
1、显示/var目录下所有以l开头,以一个小字母结尾,且中间出现一位数字的文件或目录; # ls /var/l*[[:digit:]]*[[:lower:]] 2、显示/etc目录下,以任意一位数字开头,且以非数字结尾的文件或目录; # ls -d /etc/[[:digit:]]*[^[:digi ...
分类:
其他好文 时间:
2016-09-27 20:16:07
阅读次数:
426
question: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the proces ...
分类:
其他好文 时间:
2016-09-26 21:44:58
阅读次数:
191
1.提取字符串中的数字$echo‘dsFUs34tg*fs5a%8ar%$#@‘|awk-F""‘
{
for(i=1;i<=NF;i++)
{
if($i~/[[:digit:]]/)
{
str=$i
str1=(str1str)
}
}
printstr1
}‘
输出
3458
或
$echo‘dsFUs34tg*fs5a%8ar%$#@‘|awk-F""‘
{
for(i=1;i<=NF;i++)
{
if($i~/[0-9]/)
{
str=$i
str1=..
分类:
其他好文 时间:
2016-09-22 07:44:25
阅读次数:
219