▼页尾
摘要: ≤Consider all integer combinations of ab for 2 a 5 and 2 img style="vertical-align: middle;" src="http://projecteuler.net/images/symbol_le.gif" alt="≤" width="10" height="12" border="0 阅读全文
posted @ 2011-06-29 10:38 xiatwhu 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 何为LUT,就是指显示查找表(Look-Up-Table),LUT(Look-Up Table)实际上就是一张像素灰度值的映射表,它将实际采样到的像素灰度值经过一定的变换如阈值、反转、二值化、对比度调整、线性变换等,变成了另外一个与之对应的灰度值,这样可以起到突出图像的有用信息,增强图像的光对比度的作用。我在以前写的python灰度变换就是和这个是一个意思我们来看看实际运用效果:#include <cv.h>#include <highgui.h>using namespace std;int main(int argc, char** argv) { IplImage 阅读全文
posted @ 2011-03-28 11:10 xiatwhu 阅读(8333) 评论(0) 推荐(0) 编辑
摘要: Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows: 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 It can be verified that the sum of the numbers on the diagonals is 101. What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way? 阅读全文
posted @ 2011-03-27 17:51 xiatwhu 阅读(327) 评论(0) 推荐(0) 编辑
摘要: Euler published the remarkable quadratic formula: n² + n + 41 It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41² + 41 + 41 is clearly divisible by 41. Using computers, the incredible formula n² − 79n + 1601 was discovered, which produces 80 primes for the consecutive values n = 0 to 79. The product of the coefficients, −79 and 1601, is −1264 阅读全文
posted @ 2011-03-27 17:18 xiatwhu 阅读(582) 评论(0) 推荐(0) 编辑
摘要: cvAbsDiffCalculates absolute difference between two arrays.void cvAbsDiff(const CvArr* src1, const CvArr* src2, CvArr* dst);src1 The first source arraysrc2 The second source arraydst The destination arrayThe function calculates absolute difference between two arrays.dst(i)c = |src1(I)c − src2(I)c |Al 阅读全文
posted @ 2011-03-25 18:54 xiatwhu 阅读(12342) 评论(1) 推荐(3) 编辑
摘要: A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 = 0.1 Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle. Find the value of d 1000 for which 1/d contains the longest recurring cycle 阅读全文
posted @ 2011-03-23 15:42 xiatwhu 阅读(736) 评论(0) 推荐(0) 编辑
摘要: The Fibonacci sequence is defined by the recurrence relation: 阅读全文
posted @ 2011-03-07 23:05 xiatwhu 阅读(361) 评论(1) 推荐(0) 编辑
摘要: A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are: 012 021 102 120 201 210 What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? 阅读全文
posted @ 2011-03-07 21:37 xiatwhu 阅读(749) 评论(4) 推荐(2) 编辑
摘要: A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A number n is called deficient if the sum of its proper divisors is less than n and it is called abundant if this sum exceeds n. As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers 阅读全文
posted @ 2011-03-06 23:22 xiatwhu 阅读(613) 评论(1) 推荐(1) 编辑
摘要: Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = 49714. 阅读全文
posted @ 2011-03-06 22:29 xiatwhu 阅读(445) 评论(0) 推荐(0) 编辑
▲页首
西