最新 最热

HDU 1512 - Monkey King

Once in a forest, there lived N aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each other. But monkeys can’t ...

2021-08-11
1

HDU 4857 - 逃生

现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。...

2021-08-11
0

ACMSGURU 499 - Greatest Greatest Common Divisor

Andrew has just made a breakthrough in sociology: he realized how to predict whether two persons will be good friends or not. It turns out that each person has ...

2021-08-11
1

ACMSGURU 231 - Prime Sum

Find all pairs of prime numbers (A, B) such that A<=B and their sum is also a prime number and does not exceed N.

2021-08-11
0

ACMSGURU 100 - A+B

Read integers A and B from input file and write their sum in output file.

2021-08-11
1

ACMSGURU 123 - The sum

The Fibonacci sequence of numbers is known: F1 = 1; F2 = 1; Fn+1 = Fn + Fn-1, for n>1. You have to find S - the sum of the first K Fibonacci numbers.

2021-08-11
1

ACMSGURU 105 - Div 3

There is sequence 1, 12, 123, 1234, …, 12345678910, … . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible b...

2021-08-11
0

ACMSGURU 112 - a^b-b^a

You are given natural numbers a and b. Find a^b-b^a.

2021-08-11
1

ACMSGURU 403 - Scientific Problem

Once upon a time Professor Idioticideasinventor was travelling by train. Watching cheerless landscape outside the window, he decided to invent the theme of his ...

2021-08-11
1

ACMSGURU 460 - Plural Form of Nouns

In the English language, nouns are inflected by grammatical number - that is singular or plural. In this problem we use a simple model of constructing plural fr...

2021-08-11
1