Блог пользователя Brankonymous

Автор Brankonymous, история, 3 года назад, По-английски

In a now finished competition, I stumbled across a task that I didn't manage to solve it.

Define F(n,m) to be the number of sequences of length n which satisfy:

  • All elements of the sequence are positive divisors of m
  • For any two adjacent elements, say p and q, there exists at least one prime which divides both of them.

You are given two integers, n and m. Find the values of F(1,m), F(2,m), ... ,F(n,m) modulo 10^9+7

0 < n ≤ 10^5

0 < m ≤ 10^18

Here's link to the full task description.

Can somebody explain to me solution to this problem in detail?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор Brankonymous, история, 5 лет назад, По-английски

Does anyone know any source material or code, when given n coordinate points, you need to calculate area of given non-convex polygone.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

Автор Brankonymous, история, 5 лет назад, По-английски

Hi, can someone help me solve this problem:

Input consist of integer n and array a of n integers. Output number of pairs (a[i],a[j]), i<j who are adjacent or for all k (i<k<j) this equation is true: a[k]<=min(a[i],a[j]).

1<=n<=10^6

0<=a[i]<=2^31

example:

8

4 1 2 3 6 5 1 2

Output: 11

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится