luka25's blog

By luka25, history, 8 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By luka25, history, 8 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • -12
  • Vote: I do not like it

By luka25, history, 9 years ago, In English

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?

Full text and comments »

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