NoobCoder1998's blog

By NoobCoder1998, history, 14 months ago, In English

Given an array nums containing N distinct integers and an integer K. You can perform any number of operations:

Select a sub-array of length K in nums and replace all the elements in the sub- array with the maximum number present in the current sub-array.

Find the minimum number of operations such that nums[1]=nums[n].

Input Format

The first line contains an integer N, where N denotes the number of elements in the array in the array. The second line contains N space- separated integers. The third line contains an integer, K.

Output Format

Print the minimum number of operations such that nums[1] nums[n].

Constraints:

•2sN,Ks10^5 • 1s am[i] $10^9

-I tried solving it but not able to find any optimal approach for the same.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By NoobCoder1998, history, 4 years ago, In English

Im recently struggling a lot with problems based on combinatorics. Can someone please share some good and useful resource for combinatorics? Will be really helpful.

Full text and comments »

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

By NoobCoder1998, history, 5 years ago, In English

Im finally able to break the newbie zone in last few of the rounds on CF..and I just want to share what really worked for me- and it is by giving virtual contests a lot. Yes giving virtual contests has increased my speed drastically during ongoing competitions and also solving just one question above your level is what I have done. So I really recommend people trying to break the newbie zone to try this it works..and I believe this method can even help to achieve much more higher ratings.

Full text and comments »

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