clerisy47's blog

By clerisy47, history, 6 months ago, In English

IEEE Xtreme just ended. Let's discuss it here.

There were a lot of amazing problems.Pretty tough for me in my opinion.

I got stucked on bitonic sequence, I found the sequence on oeis but it was hard to optimise. Also, is there a simple way for Diameter Problem Again. Another one was sequence decompositon, very easy to implement but no idea where my code was failing after 70%.

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

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by clerisy47 (previous revision, new revision, compare).

»
6 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

I was the setter of Bitonic Sequences. I did see some submissions that used FFT, although the main intended idea was an $$$O(N\sqrt N)$$$ solution, with a small constant factor, which allowed for $$$O(N)$$$ memory.
You can find the method here: degwer's blog.

Basically, it’s about optimizing the $$$O(N^2)$$$ idea that relies on the recursion:

$$$dp[N][K] = \sum\limits_{1 \le i \le K} dp[N-K][i] * (K - i + 1)$$$
$$$\Rightarrow dp[N][K] = dp[N-1][K-1] + \sum\limits_{1 \le i \le K} dp[N-K][i]$$$

but only for $K < \sqrt{N}$. For $$$K \ge \sqrt{N}$$$:

$$$x[N][t] = \sum\limits_{K \ge \sqrt N}^{{10}^{100}} dp[N - t * K][K]$$$

Here, we only care about $t \le \sqrt N$, since otherwise $$$K * t \gt N$$$.
The important is to link $$$x$$$ with $$$dp$$$ simply by substitution, yielding a recursion in terms of $$$x$$$. The same analysis applies to $$$\sum\limits_{1 \le i \le K} dp[N][i]$$$. The answer is $$$\sum\limits_{1 \le i \lt \lceil \sqrt N \rceil} dp[N][i] + x[N][0]$$$.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How is "Sequence Decomposition" solved?

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I can give a somewhat informal sketch of the solution, although there are several cases that need to be analyzed by hand.

    First claim: the last 2 can always be paired with the last 1.

    Proof: if not, that 1 pairs with another 2, but we can swap 2s without breaking the pattern, so the last 1 can match the last 2.

    Second claim: each 1 (from right to left) can be matched with the last available 2 to its right.

    Proof: if a 1 matches a 2 that "should" belong to an earlier 1 ($$$s_0$$$), we can swap this 2 with the 2 of that earlier 1. All such 1s and 2s are interchangeable, so the greedy pairing is safe. If no 2 is available, the 1 starts a new subsequence.

    Idea: first, greedily match 12 pairs from right to left. Then, scan left to right taking the unused 1s: greedily form 12 pairs as new subsequences when possible, otherwise consider them secondary. Note that this is always possible without running out of 0s, so all subsequences can be completed.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

problems seem very interesting, where can I solve them?