Topcoder SRM 595 DIV2 500

Problem Statement

We are given cells. Initially all cells are completely white. We are provided with two colors white and black. We are also given two arrays L[ ] and R[ ]. At each iteration i, paint all the cells from L[i-1] to R[i-1] with either black or white. We have to find total number of configurations possible. Two configurations are different if at least on cell in white in one configuration and black in another.

You can find a detailed problem description here.

Continue reading

Advertisements

Topcoder SRM 595 DIV2 250

Problem Statement

In short, You are given a string containing only characters R,G,B. We can remove the string from either end at each move( from left or from right). Finally, the string must contain only R or G or B.

You can find a detailed problem description here.

Continue reading