海岛Blog

海是无垠的,岛在海中是独立的,有一片自己的天空

UVA160 Factors and Factorials【筛选法】

The factorial of a number N (written N!) is defined as the product of all the integers from 1 to N. It is often defined recursively as follows:1! = 1...

2018-06-17 20:26:17

阅读数:26

评论数:0

UVA10922 2 the 9s【大数模除+进制】

A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. Thi...

2018-05-03 08:48:37

阅读数:44

评论数:0

UVA10929 You can say 11【大数模除】

Your job is, given a positive number N, determine if it is a multiple of eleven.InputThe input is a file such that each line contains a positive numb...

2018-05-03 08:23:15

阅读数:48

评论数:0

UVA11040 Add bricks in the wall【数学】

This in not “another brick in the wall”, it’s just a matter of adding numbers. Suppose you have a wall with the shape of a triangle, like the one sho...

2018-04-06 11:01:40

阅读数:34

评论数:0

UVA11582 Colossal Fibonacci Numbers!【快速模幂+数列模除】

The i'th Fibonacci number f(i) is recursively defined in the following way:    • f(0) = 0 and f(1) = 1    • f(i + 2) = f(i + 1) + f(i) forevery i ≥ 0...

2018-04-06 00:35:47

阅读数:56

评论数:0

HDU1019 ZOJ1797 Least Common Multiple【最小公倍数】

Least Common MultipleTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 59471    Accepted Submis...

2018-03-22 08:43:52

阅读数:76

评论数:0

UVA10090 Marbles【扩展欧几里得算法】

I have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. The boxes are of two types:Type 1: each box costs c1...

2018-02-23 17:06:52

阅读数:110

评论数:0

POJ2649 ZOJ1850 UVA10139 Factovisors【筛选法+勒让德定理】

FactovisorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4511 Accepted: 1116DescriptionThe factorial function, n! is defined thus for n a...

2018-02-23 12:00:44

阅读数:122

评论数:0

UVA583 UVALive5406 Prime Factors【素数因子+筛选法】

Webster defines prime as:prime (pr¯im) n. [ME, fr. MF, fem. of prin first, L primus; akin to L prior] 1: first in time: original 2 a: having no facto...

2018-02-20 08:59:44

阅读数:195

评论数:0

POJ2407 ZOJ1906 UVA10229 Relatives【欧拉函数+数论】

RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15625 Accepted: 7932DescriptionGiven n, a positive integer, how many positive inte...

2018-02-19 17:27:03

阅读数:127

评论数:0

UVA294 UVALive5595 Divisors【正因子数】

Mathematicians love all sorts of odd properties of numbers. For instance, they consider 945 to be an interesting number, since it is the first odd nu...

2018-02-17 07:00:01

阅读数:151

评论数:0

UVA10699 Count the factors【素数因子个数+筛选法】

Write a program, that computes the number of different prime factors in a positive integer.InputThe input tests will consist of a series of positive ...

2018-02-13 00:02:06

阅读数:106

评论数:0

UVA10831 Gerg's Cake【快速幂+勒让德记号】

Gerg is having a party, and he has invited his friends. p of them have arrived already, but a are running late. To occupy his guests, he tried playin...

2018-02-12 21:15:09

阅读数:110

评论数:0

UVA11752 The Super Powers【超级幂+暴力+数论】

We all know the Super Powers of this world and how they manage to get advantages in political warfare or even in other sectors. But this is not a pol...

2018-02-11 17:20:39

阅读数:138

评论数:0

UVA10015 Joseph's Cousin【筛选法】

The Josephs problem is notoriously known. For those who are not familiar with the problem, among n people numbered 1, 2, . . . , n, standing in circl...

2018-02-10 23:14:40

阅读数:165

评论数:0

UVA10104 Euclid Problem【扩展欧几里得算法】

From Euclid it is known that for any positive integers A and B there exist such integers X and Y thatAX + BY = D, where D is the greatest common divi...

2018-01-17 20:16:50

阅读数:190

评论数:0

UVA10533 Digit Primes【筛选法+前缀和】

A prime number is a positive number, which is divisible by exactly two different integers. A digit primeis a prime number whose sum of digits is also...

2018-01-09 23:47:06

阅读数:142

评论数:0

UVA10168 Summation of Four Primes【筛选法】

Euler proved in one of his classic theorems that prime numbers are infinite in number. But can everynumber be expressed as a summation of four positi...

2018-01-09 23:16:56

阅读数:111

评论数:0

AOJ0009 Prime Number【筛选法+前缀和】

Prime Number  Aizu - 0009 Write a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A ...

2018-01-08 00:03:01

阅读数:418

评论数:0

AOJ0005 GCD and LCM【GCD+LCM】

GCD and LCM  Aizu - 0005 Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a an...

2018-01-06 06:40:28

阅读数:307

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭