RedNextCentury's blog

By RedNextCentury, history, 8 years ago, In English

I was looking at contest 200 div.1, but problem B has no statement, it shows an empty page with the following sentence: "Statement is not available".
What's wrong?

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

»
8 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I can't help with this problem, but I can help you with the statements as I have solved it before. If I remember correctly, you were given a string S consisting of +s and -s, and you are to determine whether the string is valid or not. The following conditions help you determine whether or not a string is valid:

  1. An empty string is valid.
  2. If S is valid, then +S+ and -S- are valid strings.

For example strings -- and +--+ are valid, where -+ is not.

If the string is valid print YES, otherwise print NO.

Input limits: |S| <= 10^5, where |S| is the length of the string S.

»
8 years ago, # |
  Vote: I like it +8 Vote: I do not like it