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

Автор kinitic013, история, 15 месяцев назад, По-английски

I recently read this blog and tried to implement this data structure in problem 455D - Serega and Fun mentioned in comments but it's getting WA and I can't seem to find any bug in my data structure implementation , I know asking you all to debug my code is not good but it's a desperate move :<(

303760090 In my implementation i havn't stored size of each block as in the problem we are swapping so there's never going to be too many or too less blocks

Spoiler Code

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

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

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

Hello everyone

I was solving this problem on Leetcode (easy one), first I submitted my code with a comparator function to sort 2D vector using cmps() i.e. comparator function submission with comparator and then I submitted again without using comparator function as bydefault sort() sorted 2D vector based on first element of each vector element submission without comparator,on submission there's a huge gap in time taken as well as memory taken.

Can anyone help me/inform me how time/memory complexity changes with custom Comparator function.

By the way maximum size of vector element in 2D vector is 2 so more like vector of pair.

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

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