vrintle's blog

By vrintle, history, 4 years ago, In English

Hello everyone!

Here is the link to the problem: https://mirror.codeforces.com/contest/1504/problem/B

In the 5th test case, $$$A$$$ can be converted to $$$B$$$ as:

000111 -> [000111] -> 111000
111000 -> 11[10]00 -> 110100

As, both the prefix contains equal $$$1$$$ and $$$0$$$, so I think this is correct. But, the answer says, it is impossible to convert $$$A$$$ to $$$B$$$. Why?

  • Vote: I like it
  • -22
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

read the question again

you can select any prefix of a with an equal number of 0 and 1 symbols

  • »
    »
    4 years ago, # ^ |
      Vote: I like it -13 Vote: I do not like it

    Oh, I just realized that prefix should start at position 1, right?

    But, I think it should be made clear in the problem statement, what a prefix is, like they do when the problem is related to subarray, substring or subsequences, which are more often terms than prefix.