if(@ARGV!=2){
die "Usage: $0 sample_file sample_number\n";
}
my($sample_file, $sample_number) = @ARGV;
open my $FILE, "
my @content = ;
my $all_number = @content;
#print "|$all_number|\n";...
分类:
其他好文 时间:
2014-09-09 12:33:48
阅读次数:
351
Ahypervisorcalculates the total number of processor cycles (the number of processor cycles of one or more physical processors) in a first length of ti...
分类:
其他好文 时间:
2014-09-09 11:47:48
阅读次数:
320
Generalized Palindromic NumberTime Limit: 2 Seconds Memory Limit: 65536 KBA number that will be the same when it is written forwards or backwards i...
分类:
其他好文 时间:
2014-09-09 11:19:48
阅读次数:
351
ListList中的内容并不一定只有一种类型,一个List中可能既有number,又有string,还可能有子ListList用[]表示List的基本方法有:append,sort等要从一个List中删除某元素,可以使用del函数(它不是List的方法)#!/usr/bin/pythonmylist...
分类:
编程语言 时间:
2014-09-09 10:58:18
阅读次数:
290
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #i...
分类:
其他好文 时间:
2014-09-09 10:56:58
阅读次数:
340
Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes...
分类:
其他好文 时间:
2014-09-09 10:54:08
阅读次数:
190
思路: 这题 ugly 之处,在于 '*' 给的很不明朗, 其实'c*', 表示 '*' 可以代表 'ccc...cc'。
对 '*' 的理解,若出现 p中出现 '*', 则要比较用 s 和 p 中 '*' 之前的那个元素比较,从左往右找出 s 中第一个与 p 之前的元素不同的元素。
(若全相同...
分类:
其他好文 时间:
2014-09-09 10:43:38
阅读次数:
159
思路: 注意符号,溢出。
思路: 注意负数和溢出情况都是 false. 其余情况,就是反转再判断,参考上题.
分类:
其他好文 时间:
2014-09-09 10:40:08
阅读次数:
179
题目链接:点击打开链接
题意:
给定一串数字
下面有n个操作
每行格式形如 d->t
d为一位数字,t为任意长度的数字。
t的长度和不超过100000
问:最后的结果%1e9+7
思路:
首先我们可以得到一个结论:
同余定理使用后不能再修改数字。
那么为了让同余定理能够使用,我们倒序处理每个数字,这样就能保证能够使用同余定理。
记录每个数字实际代表的数字和实际对...
分类:
其他好文 时间:
2014-09-08 10:52:16
阅读次数:
251