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

Автор luka25, история, 7 лет назад, По-английски

I've written the solution for 543 B,I think it works fine but gets time limit on test 8.I ckecked and it doesn't pass inputing phase.How can it happen with 3000 numbers?

My submission

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

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

Автор luka25, история, 8 лет назад, По-английски

I've come across to weird thing, the problem itself is easy but I don't understand how to read input.I know only solving codeforces like problems so could anybody explain how to do it?

https://paradox.kattis.com/problems/paradoxpath

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

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

Автор luka25, история, 8 лет назад, По-английски

I just tried to delete some members from set while iterating with this code:

while(*it<=b){ if(*it!=x){m[*it]=x;s.erase(it);} else it++; }

I found out the right one was this, but can't figure out why

while(*it<=b){ if(*it!=x){m[*it]=x;s.erase(it++);} else it++; }

could anybody explain why it++ instead of it please?

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

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