ThinkAgain's blog

By ThinkAgain, history, 3 weeks ago, In English

Hello Codeforces Community, Here are the editorials for today's held Google Kickstart Round B 2021. Each and every problem along with their solutions are explained in detail.

Below are the links to the solutions:-

  1. Increasing Substring

  2. Longest Progression

  3. Consecutive Primes

Last problem will be updated soon.

Any suggestions are welcome, do comment in this blog post.

Thank You!!

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

»
3 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Your Explanation for Longest Progression is Awesome. Thanks a lot.

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Why 5 5 4 5 4 5 4 5 6 is not a solution for longest progress problem sample input 9 5 5 4 5 5 5 4 5 6 ?

  • »
    »
    3 weeks ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    have you read the problem statement?

    An arithmetic array is an array that contains at least two integers and the differences between consecutive integers are equal. and you have to find the length of the longest possible arithmetic subarray.

    here 5 5 4 5

    so, the differences are 0 1 -1

»
3 weeks ago, # |
  Vote: I like it +2 Vote: I do not like it

thanks for the solutions ^_^

»
3 weeks ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

in longest progression problem the answer of the second testcase is 6.......................... 5 5 4 5 5 5 4 5 6 -> 5 5 5 5 5 5 4 5 6(by changing the 3rd element) but if the 5th element is changed to 4 then we can get the max length 8................ 5 5 4 5 4 5 4 5 6(by changing the 5th element to 4) from 2nd to last element the difference is 1 and length is 8

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    We can't get 8 as the maximum possible answer. Note that the definition of arithmetic array says the difference b/w adjacent elements(consider forward-backward). If the question says that we have to consider the absolute value of difference b/w adjacent elements then our answer for this test case would be 8, otherwise, 6 is the correct answer for this TC.