Selected TopCoder Problems
The original date tag was 2018-01-11; it is now 4 August 2019.
| Round | Easy | Medium | Hard |
|---|---|---|---|
| SRM727 | Done | ||
| SRM726 | Done | ||
| SRM725 | Done |
SRM 727 Easy:
Given a string
X, insert characters at arbitrary positions so that:
The final string has length less than 1050.
It contains
SATNAas a subsequence.It does not contain
SATANas a subsequence.Construct such a final string.
Find the pattern in the positions of T and N. If every T is after every N, nothing needs to be done. Replace the first T with NT, or replace the last N with NT; then find the first preceding A and prepend S.
SRM 726 Easy:
There are $n$ boxes. Box $i$ contains $a_i$ red balls and $b_i$ blue balls and costs $c_i$. A box may have one ball whose colour has been reversed. In the end, at least one colour must have at least $K$ balls. Find the minimum cost.
$n \le 50, a_i \le 10000, b_i \le 10000$
- Min cost to make a[i] - 1 ≥ K
- Min Cost to make b[i] - 1 ≥ K.
- Min cost to make a[i] + b[i] ≥ 2 * k - 1. I got stuck here: if the two colours can be transferred between one another, consider that their sum is fixed.
SRM 725 Easy:
SRM 725 Easy was unexpected: it was the eight queens problem.