Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

Автор yaminote, история, 2 года назад, По-английски

I have using Chelper plugin for CP for quite a while. I am encountering problems with it now. When I declare an array as a global variable in my code then in Main.java int ar[] appears as int ar. How to fix this issue.

Полный текст и комментарии »

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

Автор yaminote, история, 2 года назад, По-английски

I am getting WA on three of the test cases on following solution- https://www.codechef.com/viewsolution/54539476 My logic

If K is 0 and all indices are same then print N else -1; Now moving to when K>0 I check for each letter using a loop seeing what would be the answer if the given letter were remaining, I find the number of consecutive set of gaps in between the given letters. Now If gaps are less than or equal to K then the answer is the number of letters itself. Otherwise we are supposed to remove any of the (gaps-(k-1)) consecutive gaps and see how many of the given letter are removed in the process. Anything wrong with the approach?

Полный текст и комментарии »

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