Selected TopCoder Problems

Chong Wang Lv6

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:

  1. The final string has length less than 1050.

  2. It contains SATNA as a subsequence.

  3. It does not contain SATAN as 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$

  1. Min cost to make a[i] - 1 ≥ K
  2. Min Cost to make b[i] - 1 ≥ K.
  3. 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.

On this page
Selected TopCoder Problems