### toxic_hack's blog

By toxic_hack, history, 3 years ago,

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.

• +15

By toxic_hack, history, 3 years ago,

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.

• +13

By toxic_hack, history, 3 years ago,

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!

• +11

By toxic_hack, history, 3 years ago,

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

• +21