Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

mobit's blog

By mobit, 10 years ago, In English

Hello , I have a question and it's how should we find the number of groups of -1s in a sequence of 1s and -1s ...?

For example if we have the sequence of length n that n=5 like this :

-1 , 1 , -1 , -1 , 1

In this example we have two groups first group contains the first number and the second group contains the 3rd and 4th number .

Given N and the sequence can you please tell me the number of groups of -1s that are after each other ?

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