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

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

I was solving question D of the latest div 2 contest. My idea is to pick the highest degree node at each step and set it first. I Know my first submission is a total mess, but it runs fine on my system, while it gives a runtime error when submitted. Can someone explain why this happens? Thanks! ps: I optimized the solution and got it accepted finally!

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

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

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

having an array $$$arr$$$ with $$$n$$$ elements we have two types of queries:

  1. given an index $$$idx$$$ and a value $$$val$$$, $$$arr_{idx}:=val$$$
  2. given a range $$$(l,r)$$$, find the $$$MEX$$$ of the range

what is the most efficient way to do this?

i'd be grateful if you could share some c++ code to do this.

thanks in advance guys.

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

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