Блог пользователя RedNextCentury

Автор RedNextCentury, история, 8 лет назад, По-английски

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?

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится