mr_warlock's blog

By mr_warlock, history, 18 months ago, In English

I am stuck on this following problem:

Statement:

Given n, r, x and P where P is a PRIME number.

Print the value nCr % P^x

Constraints:

1 <= r <= n <= 1e12
2 <= x <= 20
2 <= P^x <= 1e6

Thanks for reading the problem. It will be really helpful if you can give me a solution.

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By mr_warlock, history, 19 months ago, In English

I am stuck on this following problem:

Statement:

Given an array of size n and have to do q queries.

Query are---

Type-1) Update index k with value v.

Type-2) Print the unique count in range [L..R] which are less than v;

Constraints:

1<=n,q<=100000
1<=v<=1000000000
1<=k<=n
1<=L<=R<=n

Thanks for reading the problem. It will be really helpful if you can give me a solution.

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it