toxic_hack's blog

By toxic_hack, history, 4 years ago, In English

The problem is very simple:

Count the number of permutations of length $$$N$$$ where the maximum length of an increasing subarray is exactly $$$K$$$.

where: $$$1 \leq K \leq N \leq 200$$$.

I am stuck in this problem for days. It would be really great if someone could help me out here.

LINK

Full text and comments »

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

By toxic_hack, history, 5 years ago, In English

I have been trying to solve (Kth problem in the pdf) this problem for a couple of days. I find this problem very hard and the DP states and transitions are too confusing for me. I don't know how to go about thinking these types of problems :( Can someone please explain how to approach this problem? It will be very helpful.

Full text and comments »

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

By toxic_hack, history, 5 years ago, In English

Can someone help me in solving this question BOI16_swap.

You are given a sequence of n numbers $$$x_1, x_2, ..., x_n$$$. Each number appears exactly once in the sequence. You can modify the sequence using swaps. There are $$$n - 1$$$ consecutive turns numbered $$$k = 2, 3, 4, ... n$$$. On turn you can either swap values $$$x_k$$$ and $$$x_{k/2}$$$ in the sequence or do nothing. What is the lexicographically minimal sequence you can obtain? $$$n \leq 2 * 1e5$$$

Spoiler

Thanks!

Full text and comments »

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

By toxic_hack, history, 5 years ago, In English

I've been wanting some good easy to use geometry struct for a long time (in C++). It seems to be impossible to find. Everything that I see either doesn't contain enough functions or is very tough to use. It will be very useful if any of you could share your geometry library with me. Thanks

Full text and comments »

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