03 2017 档案

POJ NOI MATH-7647 余数相同问题
摘要:问题链接:POJ NOI MATH-7647 余数相同问题。总时间限制: 1000ms内存限制: 65536kB描述已知三个正整数 a,b,c。现有一个大于1的整数x,将其作为除数分别除a,b,c,得到的余数相同。请问满足上述条件的x的最小值是多少?数据保证x有解。输... 阅读全文

posted @ 2017-03-31 22:55 海岛Blog 阅读(803) 评论(0) 推荐(0)

CCF NOI1000 加密算法
摘要:问题链接:CCF NOI1000 加密算法。时间限制: 1000 ms 空间限制: 262144 KB题目描述 神龙数码公司设计了一个加密算法:用a代替z,用b代替y,用c代替x,......,用z代替a。现要求输入一个小写字母,对其进行加密输出。输入 输入一个... 阅读全文

posted @ 2017-03-31 21:50 海岛Blog 阅读(740) 评论(0) 推荐(0)

Project Euler Problem 27 Quadratic primes
摘要:Quadratic primesProblem 27Euler discovered the remarkable quadratic formula:n2+n+41It turns out that the formula will produce 40 prime... 阅读全文

posted @ 2017-03-30 19:47 海岛Blog 阅读(158) 评论(0) 推荐(0)

Project Euler Problem 118 Pandigital prime sets
摘要:Pandigital prime setsProblem 118Using all of the digits 1 through 9 and concatenating them freely to form decimal integers, different ... 阅读全文

posted @ 2017-03-30 18:52 海岛Blog 阅读(381) 评论(0) 推荐(0)

Project Euler Problem 36 Double-base palindromes
摘要:Double-base palindromesProblem 36The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.Find the sum of all numb... 阅读全文

posted @ 2017-03-30 01:00 海岛Blog 阅读(250) 评论(0) 推荐(0)

Project Euler Problem 38 Pandigital multiples
摘要:Pandigital multiplesProblem 38Take the number 192 and multiply it by each of 1, 2, and 3:192 × 1 = 192192 × 2 = 384192 × 3 = 576By con... 阅读全文

posted @ 2017-03-29 22:01 海岛Blog 阅读(222) 评论(0) 推荐(0)

Project Euler Problem 104 Pandigital Fibonacci ends
摘要:Pandigital Fibonacci endsProblem 104The Fibonacci sequence is defined by the recurrence relation:Fn = Fn−1 + Fn−2, where F1 = 1 and F2... 阅读全文

posted @ 2017-03-29 11:38 海岛Blog 阅读(225) 评论(0) 推荐(0)

Project Euler Problem 32 Pandigital products
摘要:Pandigital productsProblem 32We shall say that an n-digit number is pandigital if it makes use of all the digits 1 ton exactly once; f... 阅读全文

posted @ 2017-03-29 06:38 海岛Blog 阅读(236) 评论(0) 推荐(0)

Project Euler Problem 41 Pandigital prime
摘要:Pandigital primeProblem 41We shall say that an n-digit number is pandigital if it makes use of all the digits 1 ton exactly once. For ... 阅读全文

posted @ 2017-03-28 18:33 海岛Blog 阅读(167) 评论(0) 推荐(0)

Project Euler Problem 34 Digit factorials
摘要:Digit factorialsProblem 34145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to... 阅读全文

posted @ 2017-03-28 17:48 海岛Blog 阅读(131) 评论(0) 推荐(0)

UVA10079 Pizza Cutting
摘要:问题链接:UVA10079 Pizza Cutting。问题描述:参见上述链接。问题分析:参考《具体数学》一书。也可以参考:直线分平面公式_百度百科。程序说明:(略)。AC的C++语言程序如下:/* UVA10079 Pizza Cutting */#include ... 阅读全文

posted @ 2017-03-28 16:53 海岛Blog 阅读(138) 评论(0) 推荐(0)

UVA100 POJ1207 HDU1032 The 3n + 1 problem
摘要:问题链接:UVA100 POJ1207 HDU1032 The 3n + 1 problem。问题描述:参见上述链接。问题分析:根据给定的算法计算整数循环到1的次数,可以用一个函数来实现,可以使用记忆存储来加快计算速度。程序说明:数组cs[]用于存储已经算过的次数,极... 阅读全文

posted @ 2017-03-28 16:31 海岛Blog 阅读(177) 评论(0) 推荐(0)

Project Euler Problem 23 Non-abundant sums
摘要:Non-abundant sumsProblem 23A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For e... 阅读全文

posted @ 2017-03-28 09:58 海岛Blog 阅读(153) 评论(0) 推荐(0)

Project Euler Problem 24 Lexicographic permutations
摘要:Lexicographic permutationsProblem 24A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation ... 阅读全文

posted @ 2017-03-28 08:22 海岛Blog 阅读(213) 评论(0) 推荐(0)

Project Euler Problem 19 Counting Sundays
摘要:Counting SundaysProblem 19You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was ... 阅读全文

posted @ 2017-03-27 04:01 海岛Blog 阅读(170) 评论(0) 推荐(0)

CCF201703-2 学生排队(100分)
摘要:试题编号:201703-2试题名称:学生排队时间限制:1.0s内存限制:256.0MB问题描述:问题描述 体育老师小明要将自己班上的学生按顺序排队。他首先让学生按学号从小到大的顺序排成一排,学号小的排在前面,然后进行多次调整。一次调整小明可能让一位同学出队,向前或者... 阅读全文

posted @ 2017-03-26 18:40 海岛Blog 阅读(523) 评论(0) 推荐(0)

Project Euler Problem 17 Number letter counts
摘要:Number letter countsProblem 17If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + ... 阅读全文

posted @ 2017-03-26 15:57 海岛Blog 阅读(317) 评论(0) 推荐(0)

CCF201703-1 分蛋糕(100分)
摘要:试题编号:201703-1试题名称:分蛋糕时间限制:1.0s内存限制:256.0MB问题描述:问题描述 小明今天生日,他有n块蛋糕要分给朋友们吃,这n块蛋糕(编号为1到n)的重量分别为a1, a2, …, an。小明想分给每个朋友至少重量为k的蛋糕。小明的朋友们已经... 阅读全文

posted @ 2017-03-25 15:48 海岛Blog 阅读(357) 评论(0) 推荐(0)

Project Euler Problem 92 Square digit chains
摘要:Square digit chainsProblem 92A number chain is created by continuously adding the square of the digits in a number to form a new numbe... 阅读全文

posted @ 2017-03-25 08:37 海岛Blog 阅读(141) 评论(0) 推荐(0)

Project Euler Problem 543 Prime-Sum Numbers
摘要:Prime-Sum NumbersProblem 543Define function P(n,k) = 1 ifn can be written as the sum of k prime numbers (with repetitions allowed), an... 阅读全文

posted @ 2017-03-24 08:04 海岛Blog 阅读(167) 评论(0) 推荐(0)

Project Euler Problem 99 Largest exponential
摘要:Largest exponentialProblem 99Comparing two numbers written in index form like 211 and 37 is not difficult, as any calculator would con... 阅读全文

posted @ 2017-03-23 21:12 海岛Blog 阅读(116) 评论(0) 推荐(0)

HDU4506 小明系列故事——师兄帮帮忙
摘要:问题链接:HDU4506 小明系列故事——师兄帮帮忙。问题描述:参见上述链接。问题分析:(略)。程序说明:函数powermod()是快速模幂函数。AC的C++语言程序如下:/* HDU4506 小明系列故事——师兄帮帮忙 */#include using namesp... 阅读全文

posted @ 2017-03-23 16:17 海岛Blog 阅读(132) 评论(0) 推荐(0)

Project Euler Problem 21 Amicable numbers
摘要:Amicable numbersProblem 21Let d(n) be defined as the sum of proper divisors ofn (numbers less thann which divide evenly into n).If d(a... 阅读全文

posted @ 2017-03-23 09:11 海岛Blog 阅读(154) 评论(0) 推荐(0)

Project Euler Problem 25 1000-digit Fibonacci number
摘要:1000-digit Fibonacci numberProblem 25The Fibonacci sequence is defined by the recurrence relation:Fn = Fn−1 + Fn−2, where F1 = 1 and F... 阅读全文

posted @ 2017-03-23 06:35 海岛Blog 阅读(198) 评论(0) 推荐(0)

Project Euler Problem 20 Factorial digit sum
摘要:Factorial digit sumProblem 20n! means n × (n − 1) × ... × 3 × 2 × 1For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,and the sum o... 阅读全文

posted @ 2017-03-23 00:11 海岛Blog 阅读(158) 评论(0) 推荐(0)

Project Euler Problem 67 Maximum path sum II
摘要:Maximum path sum IIProblem 67By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum... 阅读全文

posted @ 2017-03-22 23:06 海岛Blog 阅读(136) 评论(0) 推荐(0)

Project Euler Problem 18 Maximum path sum I
摘要:Maximum path sum IProblem 18By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum ... 阅读全文

posted @ 2017-03-22 22:55 海岛Blog 阅读(137) 评论(0) 推荐(0)

Project Euler Problem 16 Power digit sum
摘要:Power digit sumProblem 16215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 2... 阅读全文

posted @ 2017-03-22 19:28 海岛Blog 阅读(117) 评论(0) 推荐(0)

Project Euler Problem 16 Power digit sum
摘要:Power digit sumProblem 16215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 2... 阅读全文

posted @ 2017-03-22 19:28 海岛Blog 阅读(143) 评论(0) 推荐(0)

Project Euler Problem 47 Distinct primes factors
摘要:Distinct primes factorsProblem 47The first two consecutive numbers to have two distinct prime factors are:14 = 2 × 715 = 3 × 5The firs... 阅读全文

posted @ 2017-03-22 18:20 海岛Blog 阅读(240) 评论(0) 推荐(0)

Project Euler Problem 47 Distinct primes factors
摘要:Distinct primes factorsProblem 47The first two consecutive numbers to have two distinct prime factors are:14 = 2 × 715 = 3 × 5The firs... 阅读全文

posted @ 2017-03-22 18:20 海岛Blog 阅读(194) 评论(0) 推荐(0)

Project Euler Problem 15 Lattice paths
摘要:Lattice pathsProblem 15Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exa... 阅读全文

posted @ 2017-03-22 05:54 海岛Blog 阅读(110) 评论(0) 推荐(0)

Project Euler Problem 15 Lattice paths
摘要:Lattice pathsProblem 15Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exa... 阅读全文

posted @ 2017-03-22 05:54 海岛Blog 阅读(113) 评论(0) 推荐(0)

Project Euler Problem 14 Longest Collatz sequence
摘要:Longest Collatz sequenceProblem 14The following iterative sequence is defined for the set of positive integers:n → n/2 (n is even)n → ... 阅读全文

posted @ 2017-03-21 10:06 海岛Blog 阅读(166) 评论(0) 推荐(0)

Project Euler Problem 14 Longest Collatz sequence
摘要:Longest Collatz sequenceProblem 14The following iterative sequence is defined for the set of positive integers:n → n/2 (n is even)n → ... 阅读全文

posted @ 2017-03-21 10:06 海岛Blog 阅读(180) 评论(0) 推荐(0)

Project Euler Problem 13 Large sum
摘要:Large sumProblem 13Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.3710728753390210279879799822... 阅读全文

posted @ 2017-03-20 23:50 海岛Blog 阅读(120) 评论(0) 推荐(0)

Project Euler Problem 13 Large sum
摘要:Large sumProblem 13Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.3710728753390210279879799822... 阅读全文

posted @ 2017-03-20 23:50 海岛Blog 阅读(201) 评论(0) 推荐(0)

Project Euler Problem 12: Highly divisible triangular number
摘要:Highly divisible triangular numberProblem 12The sequence of triangle numbers is generated by adding the natural numbers. So the 7th tr... 阅读全文

posted @ 2017-03-20 22:17 海岛Blog 阅读(171) 评论(0) 推荐(0)

Project Euler Problem 12: Highly divisible triangular number
摘要:Highly divisible triangular numberProblem 12The sequence of triangle numbers is generated by adding the natural numbers. So the 7th tr... 阅读全文

posted @ 2017-03-20 22:17 海岛Blog 阅读(155) 评论(0) 推荐(0)

Project Euler Problem 11: Largest product in a grid
摘要:Largest product in a gridProblem 11In the 20×20 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 ... 阅读全文

posted @ 2017-03-20 20:40 海岛Blog 阅读(128) 评论(0) 推荐(0)

Project Euler Problem 11: Largest product in a grid
摘要:Largest product in a gridProblem 11In the 20×20 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 ... 阅读全文

posted @ 2017-03-20 20:40 海岛Blog 阅读(162) 评论(0) 推荐(0)

Project Euler Problem 10: Summation of primes
摘要:Summation of primesProblem 10The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.C++... 阅读全文

posted @ 2017-03-20 01:16 海岛Blog 阅读(112) 评论(0) 推荐(0)

Project Euler Problem 10: Summation of primes
摘要:Summation of primesProblem 10The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.C++... 阅读全文

posted @ 2017-03-20 01:16 海岛Blog 阅读(99) 评论(0) 推荐(0)

Project Euler Problem 9: Special Pythagorean triplet
摘要:Special Pythagorean tripletProblem 9A Pythagorean triplet is a set of three natural numbers,a using namespace std;int main(){ int n... 阅读全文

posted @ 2017-03-20 00:09 海岛Blog 阅读(123) 评论(0) 推荐(0)

Project Euler Problem 9: Special Pythagorean triplet
摘要:Special Pythagorean tripletProblem 9A Pythagorean triplet is a set of three natural numbers,a using namespace std;int main(){ int n... 阅读全文

posted @ 2017-03-20 00:09 海岛Blog 阅读(117) 评论(0) 推荐(0)

Project Euler Problem 8: Largest product in a series
摘要:Largest product in a seriesProblem 8The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9... 阅读全文

posted @ 2017-03-19 16:54 海岛Blog 阅读(132) 评论(0) 推荐(0)

Project Euler Problem 8: Largest product in a series
摘要:Largest product in a seriesProblem 8The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9... 阅读全文

posted @ 2017-03-19 16:54 海岛Blog 阅读(159) 评论(0) 推荐(0)

Project Euler Problem 7: 10001st prime
摘要:10001st primeProblem 7By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the ... 阅读全文

posted @ 2017-03-19 15:03 海岛Blog 阅读(171) 评论(0) 推荐(0)

Project Euler Problem 7: 10001st prime
摘要:10001st primeProblem 7By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the ... 阅读全文

posted @ 2017-03-19 15:03 海岛Blog 阅读(131) 评论(0) 推荐(0)

Project Euler Problem 48: Self powers
摘要:Self powersProblem 48The series, 11 + 22 + 33 + ... + 1010 = 10405071317.Find the last ten digits of the series, 11 + 22 + 33 + ... + ... 阅读全文

posted @ 2017-03-19 09:00 海岛Blog 阅读(200) 评论(0) 推荐(0)

Project Euler Problem 6: Sum square difference
摘要:Sum square differenceProblem 6The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the su... 阅读全文

posted @ 2017-03-19 08:03 海岛Blog 阅读(133) 评论(0) 推荐(0)

Project Euler Problem 6: Sum square difference
摘要:Sum square differenceProblem 6The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the su... 阅读全文

posted @ 2017-03-19 08:03 海岛Blog 阅读(123) 评论(0) 推荐(0)

Project Euler Problem 5: Smallest multiple
摘要:Smallest multipleProblem 52520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.Wh... 阅读全文

posted @ 2017-03-19 07:34 海岛Blog 阅读(147) 评论(0) 推荐(0)

Project Euler Problem 5: Smallest multiple
摘要:Smallest multipleProblem 52520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.Wh... 阅读全文

posted @ 2017-03-19 07:34 海岛Blog 阅读(133) 评论(0) 推荐(0)

Project Euler Problem 4: Largest palindrome product
摘要:Largest palindrome productProblem 4A palindromic number reads the same both ways. The largest palindrome made from the product of two ... 阅读全文

posted @ 2017-03-19 06:39 海岛Blog 阅读(120) 评论(0) 推荐(0)

Project Euler Problem 4: Largest palindrome product
摘要:Largest palindrome productProblem 4A palindromic number reads the same both ways. The largest palindrome made from the product of two ... 阅读全文

posted @ 2017-03-19 06:39 海岛Blog 阅读(111) 评论(0) 推荐(0)

Project Euler Problem 3: Largest prime factor
摘要:Largest prime factorProblem 3The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 60085147514... 阅读全文

posted @ 2017-03-18 07:45 海岛Blog 阅读(102) 评论(0) 推荐(0)

Project Euler Problem 3: Largest prime factor
摘要:Largest prime factorProblem 3The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 60085147514... 阅读全文

posted @ 2017-03-18 07:45 海岛Blog 阅读(180) 评论(0) 推荐(0)

Project Euler Problem 2: Even Fibonacci numbers
摘要:Even Fibonacci numbersProblem 2Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with... 阅读全文

posted @ 2017-03-17 23:34 海岛Blog 阅读(121) 评论(0) 推荐(0)

Project Euler Problem 2: Even Fibonacci numbers
摘要:Even Fibonacci numbersProblem 2Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with... 阅读全文

posted @ 2017-03-17 23:34 海岛Blog 阅读(135) 评论(0) 推荐(0)

Project Euler Problem 1: Multiples of 3 and 5
摘要:Multiples of 3 and 5Problem 1If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum o... 阅读全文

posted @ 2017-03-17 22:21 海岛Blog 阅读(129) 评论(0) 推荐(0)

Project Euler Problem 1: Multiples of 3 and 5
摘要:Multiples of 3 and 5Problem 1If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum o... 阅读全文

posted @ 2017-03-17 22:21 海岛Blog 阅读(110) 评论(0) 推荐(0)

UVA10252 POJ2629 Common Permutation【字符串排序】
摘要:问题链接:UVA10252 POJ2629 Common Permutation。问题描述:参见上文。两个小写字母构成的字符串a和b,求各自的置换的最长公共子串,按字母顺序输出。问题分析:(略)。程序说明:字符串类型变量的排序也是可以用函数sort()实现的。AC的C... 阅读全文

posted @ 2017-03-17 08:34 海岛Blog 阅读(133) 评论(0) 推荐(0)

UVA10252 POJ2629 Common Permutation【字符串排序】
摘要:问题链接:UVA10252 POJ2629 Common Permutation。问题描述:参见上文。两个小写字母构成的字符串a和b,求各自的置换的最长公共子串,按字母顺序输出。问题分析:(略)。程序说明:字符串类型变量的排序也是可以用函数sort()实现的。AC的C... 阅读全文

posted @ 2017-03-17 08:34 海岛Blog 阅读(160) 评论(0) 推荐(0)

程序设计竞赛(ACM)与认证(CCF)的概念集(百度百科)
摘要:后缀数组_百度百科后缀树_百度百科红黑树_百度百科伸展树_百度百科线段树_百度百科树状数组_百度百科笛卡尔树_百度百科二叉查找树_百度百科Trie树_百度百科字典树_百度百科划分树_百度百科并查集_百度百科rmq_百度百科LIS_百度百科威佐夫博弈_百度百科中位数_百... 阅读全文

posted @ 2017-03-16 07:49 海岛Blog 阅读(599) 评论(0) 推荐(0)

HDU1229 还是A+B
摘要:问题链接:HDU1229 还是A+B。问题描述:参见上述链接。问题分析:(略)。程序说明:函数power()可以用于计算10的k次方,是一个快速幂程序。AC的C++语言程序如下:/* HDU1229 还是A+B */#include #include using na... 阅读全文

posted @ 2017-03-12 23:47 海岛Blog 阅读(133) 评论(0) 推荐(0)

HDU1229 还是A+B
摘要:问题链接:HDU1229 还是A+B。问题描述:参见上述链接。问题分析:(略)。程序说明:函数power()可以用于计算10的k次方,是一个快速幂程序。AC的C++语言程序如下:/* HDU1229 还是A+B */#include #include using na... 阅读全文

posted @ 2017-03-12 23:47 海岛Blog 阅读(185) 评论(0) 推荐(0)

POJ2559 HDU1506 ZOJ1985 Largest Rectangle in a Histogram【堆栈】
摘要:问题链接:POJ2559 HDU1506 ZOJ1985 Largest Rectangle in a Histogram。问题描述:参见上述链接。问题分析:解决这个问题,一种是用暴力法(枚举法)来解决,任何一个矩形必然始于第i个直方图,终止于第j块直方图(i=1,这... 阅读全文

posted @ 2017-03-12 20:24 海岛Blog 阅读(109) 评论(0) 推荐(0)

POJ2559 HDU1506 ZOJ1985 Largest Rectangle in a Histogram【堆栈】
摘要:问题链接:POJ2559 HDU1506 ZOJ1985 Largest Rectangle in a Histogram。问题描述:参见上述链接。问题分析:解决这个问题,一种是用暴力法(枚举法)来解决,任何一个矩形必然始于第i个直方图,终止于第j块直方图(i=1,这... 阅读全文

posted @ 2017-03-12 20:24 海岛Blog 阅读(95) 评论(0) 推荐(0)

CCF201612-4 压缩编码(100分)
摘要:试题编号: 201612-4试题名称: 压缩编码时间限制: 3.0s内存限制: 256.0MB问题描述: 问题描述 给定一段文字,已知单词a1, a2, …, an出现的频率分别t1, t2, …, tn。可以用01串给这些单词编码,即... 阅读全文

posted @ 2017-03-12 17:28 海岛Blog 阅读(234) 评论(0) 推荐(0)

CCF201612-4 压缩编码(100分)
摘要:试题编号: 201612-4试题名称: 压缩编码时间限制: 3.0s内存限制: 256.0MB问题描述: 问题描述 给定一段文字,已知单词a1, a2, …, an出现的频率分别t1, t2, …, tn。可以用01串给这些单词编码,即... 阅读全文

posted @ 2017-03-12 17:28 海岛Blog 阅读(307) 评论(0) 推荐(0)

HDU1201 18岁生日【日期计算】
摘要:18岁生日Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32851 Accepted Submiss... 阅读全文

posted @ 2017-03-12 10:13 海岛Blog 阅读(211) 评论(0) 推荐(0)

HDU1201 18岁生日【日期计算】
摘要:18岁生日Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32851 Accepted Submiss... 阅读全文

posted @ 2017-03-12 10:13 海岛Blog 阅读(211) 评论(0) 推荐(0)

CCF201403-1 相反数(解法二)(100分)
摘要:试题编号:201403-1试题名称:相反数时间限制:1.0s内存限制:256.0MB问题描述:问题描述 有 N 个非零且各不相同的整数。请你编一个程序求出它们中有多少对相反数(a 和 -a 为一对相反数)。输入格式 第一行包含一个正整数 N。(1 ≤ N ≤ 50... 阅读全文

posted @ 2017-03-10 09:04 海岛Blog 阅读(256) 评论(0) 推荐(0)

CCF201403-1 相反数(解法二)(100分)
摘要:试题编号:201403-1试题名称:相反数时间限制:1.0s内存限制:256.0MB问题描述:问题描述 有 N 个非零且各不相同的整数。请你编一个程序求出它们中有多少对相反数(a 和 -a 为一对相反数)。输入格式 第一行包含一个正整数 N。(1 ≤ N ≤ 50... 阅读全文

posted @ 2017-03-10 09:04 海岛Blog 阅读(170) 评论(0) 推荐(0)

POJ3752 字母旋转游戏【水题】
摘要:问题链接:POJ3752 字母旋转游戏。问题描述:参见上文。问题分析:直接模拟,需要解决二维数组遍历和下标计算。对于输入的m和n,不知道其范围,需要一个动态的存储。程序说明:使用vector实现一个动态的二维数组matrix[][],是一个非常有效的做法。定义数组的代... 阅读全文

posted @ 2017-03-09 18:55 海岛Blog 阅读(168) 评论(0) 推荐(0)

POJ3752 字母旋转游戏【水题】
摘要:问题链接:POJ3752 字母旋转游戏。问题描述:参见上文。问题分析:直接模拟,需要解决二维数组遍历和下标计算。对于输入的m和n,不知道其范围,需要一个动态的存储。程序说明:使用vector实现一个动态的二维数组matrix[][],是一个非常有效的做法。定义数组的代... 阅读全文

posted @ 2017-03-09 18:55 海岛Blog 阅读(429) 评论(0) 推荐(0)

HDU1869 六度分离
摘要:问题链接:HDU1869 六度分离。问题描述:参见上文。问题分析:这是一个连通距离问题,这里使用Dijkstra算法来解决。对于各个结点,都用Dijkstra算法计算一次,然后判定其距离是否超出即可。应该还有其他算法可以实现,也许动态规划算法效果更好。判断连通性,求树... 阅读全文

posted @ 2017-03-09 10:08 海岛Blog 阅读(270) 评论(0) 推荐(0)

HDU1874 畅通工程续
摘要:问题链接:HDU1874 畅通工程续。问题描述:参见上文。问题分析:这是一个经典的单源最短路径问题,使用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用邻接表存储图,即g[]... 阅读全文

posted @ 2017-03-09 09:32 海岛Blog 阅读(126) 评论(0) 推荐(0)

HDU1874 畅通工程续
摘要:问题链接:HDU1874 畅通工程续。问题描述:参见上文。问题分析:这是一个经典的单源最短路径问题,使用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用邻接表存储图,即g[]... 阅读全文

posted @ 2017-03-09 09:32 海岛Blog 阅读(186) 评论(0) 推荐(0)

HDU2544 最短路
摘要:问题链接:HDU2544 最短路。问题描述:参见上文。问题分析:这是一个经典的单源最短路径问题,使用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用邻接表存储图,即g[],是... 阅读全文

posted @ 2017-03-05 19:00 海岛Blog 阅读(127) 评论(0) 推荐(0)

HDU2544 最短路
摘要:问题链接:HDU2544 最短路。问题描述:参见上文。问题分析:这是一个经典的单源最短路径问题,使用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用邻接表存储图,即g[],是... 阅读全文

posted @ 2017-03-05 19:00 海岛Blog 阅读(133) 评论(0) 推荐(0)

HDU1715 大菲波数
摘要:问题链接:HDU1715 大菲波数。问题简述:参见上述链接。问题分析:大数问题。为了避免重复计算,需要打表。程序说明:(略)。AC的C++语言程序如下:/* HDU1715 大菲波数 */#include #include using namespace std;co... 阅读全文

posted @ 2017-03-05 07:33 海岛Blog 阅读(131) 评论(0) 推荐(0)

HDU1715 大菲波数
摘要:问题链接:HDU1715 大菲波数。问题简述:参见上述链接。问题分析:大数问题。为了避免重复计算,需要打表。程序说明:(略)。AC的C++语言程序如下:/* HDU1715 大菲波数 */#include #include using namespace std;co... 阅读全文

posted @ 2017-03-05 07:33 海岛Blog 阅读(121) 评论(0) 推荐(0)

CCF201612-1 中间数(解法三)(100分)
摘要:试题编号:201612-1试题名称:中间数时间限制:1.0s内存限制:256.0MB问题描述:问题描述 在一个整数序列a1, a2, …, an中,如果存在某个数,大于它的整数数量等于小于它的整数数量,则称其为中间数。在一个序列中,可能存在多个下标不相同的中间数,这... 阅读全文

posted @ 2017-03-04 16:15 海岛Blog 阅读(252) 评论(0) 推荐(0)

CCF201612-1 中间数(解法三)(100分)
摘要:试题编号:201612-1试题名称:中间数时间限制:1.0s内存限制:256.0MB问题描述:问题描述 在一个整数序列a1, a2, …, an中,如果存在某个数,大于它的整数数量等于小于它的整数数量,则称其为中间数。在一个序列中,可能存在多个下标不相同的中间数,这... 阅读全文

posted @ 2017-03-04 16:15 海岛Blog 阅读(321) 评论(0) 推荐(0)

HDU3790 最短路径问题
摘要:问题链接:HDU3790 最短路径问题。问题描述:参见上文。问题分析:这是一个最优化的问题,也是一个单源最短路径问题,所有要用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用... 阅读全文

posted @ 2017-03-04 06:47 海岛Blog 阅读(149) 评论(0) 推荐(0)

HDU3790 最短路径问题
摘要:问题链接:HDU3790 最短路径问题。问题描述:参见上文。问题分析:这是一个最优化的问题,也是一个单源最短路径问题,所有要用Dijkstra算法。程序说明:图的表示主要有三种形式,一是邻接表,二是邻接矩阵,三是边列表。邻接矩阵对于结点多和边少的情况都不理想。程序中用... 阅读全文

posted @ 2017-03-04 06:47 海岛Blog 阅读(243) 评论(0) 推荐(0)

CCF201609-4 交通规划(100分)
摘要:试题编号:201609-4试题名称:交通规划时间限制:1.0s内存限制:256.0MB问题描述:问题描述 G国国王来中国参观后,被中国的高速铁路深深的震撼,决定为自己的国家也建设一个高速铁路系统。 建设高速铁路投入非常大,为了节约建设成本,G国国王决定不新建铁路,... 阅读全文

posted @ 2017-03-03 09:18 海岛Blog 阅读(163) 评论(0) 推荐(0)

CCF201609-4 交通规划(100分)
摘要:试题编号:201609-4试题名称:交通规划时间限制:1.0s内存限制:256.0MB问题描述:问题描述 G国国王来中国参观后,被中国的高速铁路深深的震撼,决定为自己的国家也建设一个高速铁路系统。 建设高速铁路投入非常大,为了节约建设成本,G国国王决定不新建铁路,... 阅读全文

posted @ 2017-03-03 09:18 海岛Blog 阅读(152) 评论(0) 推荐(0)

Dijkstra算法的C语言程序
摘要:Dijkstra算法用来寻找图的结点间最短路径,通常是指定一个起始结点后,寻找从该结点出发,到达各个结点的最短路径。该算法是有关最短路径问题的一个算法。由Dijkstra于1959年提出。百度百科:Dijkstra算法。维基百科:Dijkstra's Algorith... 阅读全文

posted @ 2017-03-02 09:00 海岛Blog 阅读(243) 评论(0) 推荐(0)

Dijkstra算法的C语言程序
摘要:Dijkstra算法用来寻找图的结点间最短路径,通常是指定一个起始结点后,寻找从该结点出发,到达各个结点的最短路径。该算法是有关最短路径问题的一个算法。由Dijkstra于1959年提出。百度百科:Dijkstra算法。维基百科:Dijkstra's Algorith... 阅读全文

posted @ 2017-03-02 09:00 海岛Blog 阅读(318) 评论(0) 推荐(0)

HDU2026 首字母变大写
摘要:问题链接:HDU2026 首字母变大写。问题描述:参见上述链接。问题分析:这是一个字符串输入处理问题,也是一个基本的输入处理训练问题。程序说明:通过这个例子,可以知道C++程序中如何读入一行,如何判定输入结束(文件结束),以及如何用库函数进行字母判定和大小写转换。如果... 阅读全文

posted @ 2017-03-01 07:00 海岛Blog 阅读(249) 评论(0) 推荐(0)

HDU2026 首字母变大写
摘要:问题链接:HDU2026 首字母变大写。问题描述:参见上述链接。问题分析:这是一个字符串输入处理问题,也是一个基本的输入处理训练问题。程序说明:通过这个例子,可以知道C++程序中如何读入一行,如何判定输入结束(文件结束),以及如何用库函数进行字母判定和大小写转换。如果... 阅读全文

posted @ 2017-03-01 07:00 海岛Blog 阅读(682) 评论(0) 推荐(0)

导航